From owner-svn-src-all@freebsd.org Sun Apr 9 01:35:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B247D34B04; Sun, 9 Apr 2017 01:35:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13005B8; Sun, 9 Apr 2017 01:35:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v391ZKRE064490; Sun, 9 Apr 2017 01:35:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v391ZJ6p064486; Sun, 9 Apr 2017 01:35:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704090135.v391ZJ6p064486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 9 Apr 2017 01:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316647 - in head: . share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 01:35:21 -0000 Author: emaste Date: Sun Apr 9 01:35:19 2017 New Revision: 316647 URL: https://svnweb.freebsd.org/changeset/base/316647 Log: Introduce LLD_BOOTSTRAP to control lld as bootstrap linker Add WITH_LLD_BOOTSTRAP and WITHOUT_LLD_BOOTSTRAP knobs, similar to the Clang bootstrap knobs. Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10249 Added: head/tools/build/options/WITHOUT_LLD_BOOTSTRAP (contents, props changed) head/tools/build/options/WITH_LLD_BOOTSTRAP (contents, props changed) Modified: head/Makefile.inc1 head/share/mk/src.opts.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Apr 8 21:57:59 2017 (r316646) +++ head/Makefile.inc1 Sun Apr 9 01:35:19 2017 (r316647) @@ -171,7 +171,7 @@ CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN # riscv64-binutils port or package. .if !make(showconfig) .if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ - ${MK_LLD_IS_LD} == "no" && \ + ${MK_LLD_BOOTSTRAP} == "no" && \ !defined(CROSS_BINUTILS_PREFIX) CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ .if !exists(${CROSS_BINUTILS_PREFIX}) @@ -1665,9 +1665,10 @@ ${_bt}-usr.bin/yacc: ${_bt}-lib/liby _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif -# We need to build tblgen when we're building clang either as -# the bootstrap compiler, or as the part of the normal build. -.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" +# We need to build tblgen when we're building clang or lld, either as +# bootstrap tools, or as the part of the normal build. +.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \ + ${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no" _clang_tblgen= \ lib/clang/libllvmminimal \ usr.bin/clang/llvm-tblgen \ @@ -1828,9 +1829,6 @@ _elftctools= lib/libelftc \ # cross-build on a FreeBSD 10 host: _elftctools+= usr.bin/addr2line .endif -.if ${MK_LLD_IS_LD} != "no" -_lld= usr.bin/clang/lld -.endif .elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no" # If cross-building with an external binutils we still need to build strip for # the target (for at least crunchide). @@ -1841,6 +1839,11 @@ _elftctools= lib/libelftc \ .if ${MK_CLANG_BOOTSTRAP} != "no" _clang= usr.bin/clang +.endif +.if ${MK_LLD_BOOTSTRAP} != "no" +_lld= usr.bin/clang/lld +.endif +.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_LLD_BOOTSTRAP} != "no" _clang_libs= lib/clang .endif .if ${MK_GCC_BOOTSTRAP} != "no" Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat Apr 8 21:57:59 2017 (r316646) +++ head/share/mk/src.opts.mk Sun Apr 9 01:35:19 2017 (r316647) @@ -250,9 +250,9 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif .if ${__T} == "aarch64" -__DEFAULT_YES_OPTIONS+=LLD_IS_LD +__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD .else -__DEFAULT_NO_OPTIONS+=LLD_IS_LD +__DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD .endif .if ${__T} == "aarch64" || ${__T} == "amd64" __DEFAULT_YES_OPTIONS+=LLDB Added: head/tools/build/options/WITHOUT_LLD_BOOTSTRAP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LLD_BOOTSTRAP Sun Apr 9 01:35:19 2017 (r316647) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build the LLD linker during the bootstrap phase of +the build. +To be able to build the system, either Binutils or LLD bootstrap must be +enabled unless an alternate linker is provided via XLD. Added: head/tools/build/options/WITH_LLD_BOOTSTRAP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLD_BOOTSTRAP Sun Apr 9 01:35:19 2017 (r316647) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build the LLD linker during the bootstrap phase of the build. From owner-svn-src-all@freebsd.org Sun Apr 9 02:00:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66222D35058; Sun, 9 Apr 2017 02:00:07 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30C3FC8D; Sun, 9 Apr 2017 02:00:07 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39206nQ072891; Sun, 9 Apr 2017 02:00:06 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39203Vf072867; Sun, 9 Apr 2017 02:00:03 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201704090200.v39203Vf072867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 9 Apr 2017 02:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 02:00:07 -0000 Author: pkelsey Date: Sun Apr 9 02:00:03 2017 New Revision: 316648 URL: https://svnweb.freebsd.org/changeset/base/316648 Log: Corrected misspelled versions of rendezvous. The MFC will include a compat definition of smp_no_rendevous_barrier() that calls smp_no_rendezvous_barrier(). Reviewed by: gnn, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10313 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/counter.h head/sys/arm/arm/pmap-v6.c head/sys/arm/include/counter.h head/sys/arm64/include/counter.h head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/arm/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c head/sys/cddl/dev/dtrace/mips/dtrace_subr.c head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c head/sys/dev/acpica/acpi_cpu.c head/sys/i386/i386/pmap.c head/sys/i386/include/counter.h head/sys/kern/kern_rmlock.c head/sys/kern/subr_smp.c head/sys/mips/include/counter.h head/sys/powerpc/include/counter.h head/sys/powerpc/ofw/ofw_machdep.c head/sys/riscv/include/counter.h head/sys/sparc64/include/counter.h head/sys/sys/smp.h head/sys/x86/x86/tsc.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/amd64/amd64/pmap.c Sun Apr 9 02:00:03 2017 (r316648) @@ -1733,7 +1733,7 @@ pmap_update_pde(pmap_t pmap, vm_offset_t act.newpde = newpde; CPU_SET(cpuid, &active); smp_rendezvous_cpus(active, - smp_no_rendevous_barrier, pmap_update_pde_action, + smp_no_rendezvous_barrier, pmap_update_pde_action, pmap_update_pde_teardown, &act); } else { pmap_update_pde_store(pmap, pde, newpde); Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/amd64/include/counter.h Sun Apr 9 02:00:03 2017 (r316648) @@ -69,8 +69,8 @@ static inline void counter_u64_zero_inline(counter_u64_t c) { - smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, - smp_no_rendevous_barrier, c); + smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu, + smp_no_rendezvous_barrier, c); } #endif Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/arm/arm/pmap-v6.c Sun Apr 9 02:00:03 2017 (r316648) @@ -3322,7 +3322,7 @@ pmap_change_pte1(pmap_t pmap, pt1_entry_ act.va = va; act.npte1 = npte1; act.update = PCPU_GET(cpuid); - smp_rendezvous_cpus(all_cpus, smp_no_rendevous_barrier, + smp_rendezvous_cpus(all_cpus, smp_no_rendezvous_barrier, pmap_update_pte1_action, NULL, &act); sched_unpin(); } else { Modified: head/sys/arm/include/counter.h ============================================================================== --- head/sys/arm/include/counter.h Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/arm/include/counter.h Sun Apr 9 02:00:03 2017 (r316648) @@ -70,8 +70,8 @@ static inline void counter_u64_zero_inline(counter_u64_t c) { - smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, - smp_no_rendevous_barrier, c); + smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu, + smp_no_rendezvous_barrier, c); } #endif Modified: head/sys/arm64/include/counter.h ============================================================================== --- head/sys/arm64/include/counter.h Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/arm64/include/counter.h Sun Apr 9 02:00:03 2017 (r316648) @@ -68,8 +68,8 @@ static inline void counter_u64_zero_inline(counter_u64_t c) { - smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, - smp_no_rendevous_barrier, c); + smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu, + smp_no_rendezvous_barrier, c); } #endif Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Sun Apr 9 02:00:03 2017 (r316648) @@ -134,8 +134,8 @@ dtrace_xcall(processorid_t cpu, dtrace_x else CPU_SETOF(cpu, &cpus); - smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, - smp_no_rendevous_barrier, arg); + smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, + smp_no_rendezvous_barrier, arg); } static void Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sun Apr 9 02:00:03 2017 (r316648) @@ -125,8 +125,8 @@ dtrace_xcall(processorid_t cpu, dtrace_x else CPU_SETOF(cpu, &cpus); - smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, - smp_no_rendevous_barrier, arg); + smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, + smp_no_rendezvous_barrier, arg); } static void @@ -331,7 +331,7 @@ dtrace_gethrtime_init(void *arg) smp_rendezvous_cpus(map, NULL, dtrace_gethrtime_init_cpu, - smp_no_rendevous_barrier, (void *)(uintptr_t) i); + smp_no_rendezvous_barrier, (void *)(uintptr_t) i); tsc_skew[i] = tgt_cpu_tsc - hst_cpu_tsc; } Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Sun Apr 9 02:00:03 2017 (r316648) @@ -136,8 +136,8 @@ dtrace_xcall(processorid_t cpu, dtrace_x else CPU_SETOF(cpu, &cpus); - smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, - smp_no_rendevous_barrier, arg); + smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, + smp_no_rendezvous_barrier, arg); } static void Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun Apr 9 02:00:03 2017 (r316648) @@ -127,8 +127,8 @@ dtrace_xcall(processorid_t cpu, dtrace_x else CPU_SETOF(cpu, &cpus); - smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, - smp_no_rendevous_barrier, arg); + smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, + smp_no_rendezvous_barrier, arg); } static void @@ -333,7 +333,7 @@ dtrace_gethrtime_init(void *arg) smp_rendezvous_cpus(map, NULL, dtrace_gethrtime_init_cpu, - smp_no_rendevous_barrier, (void *)(uintptr_t) i); + smp_no_rendezvous_barrier, (void *)(uintptr_t) i); tsc_skew[i] = tgt_cpu_tsc - hst_cpu_tsc; } Modified: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Sun Apr 9 02:00:03 2017 (r316648) @@ -131,8 +131,8 @@ dtrace_xcall(processorid_t cpu, dtrace_x else CPU_SETOF(cpu, &cpus); - smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, - smp_no_rendevous_barrier, arg); + smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, + smp_no_rendezvous_barrier, arg); } static void Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Sun Apr 9 02:00:03 2017 (r316648) @@ -133,8 +133,8 @@ dtrace_xcall(processorid_t cpu, dtrace_x else CPU_SETOF(cpu, &cpus); - smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, - smp_no_rendevous_barrier, arg); + smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, + smp_no_rendezvous_barrier, arg); } static void @@ -212,7 +212,7 @@ dtrace_gethrtime_init(void *arg) smp_rendezvous_cpus(map, NULL, dtrace_gethrtime_init_cpu, - smp_no_rendevous_barrier, (void *)(uintptr_t) i); + smp_no_rendezvous_barrier, (void *)(uintptr_t) i); timebase_skew[i] = tgt_cpu_tsc - hst_cpu_tsc; } Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Sun Apr 9 02:00:03 2017 (r316648) @@ -137,8 +137,8 @@ dtrace_xcall(processorid_t cpu, dtrace_x else CPU_SETOF(cpu, &cpus); - smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func, - smp_no_rendevous_barrier, arg); + smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, + smp_no_rendezvous_barrier, arg); } static void Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/dev/acpica/acpi_cpu.c Sun Apr 9 02:00:03 2017 (r316648) @@ -466,8 +466,8 @@ disable_idle(struct acpi_cpu_softc *sc) * is called and executed in such a context with interrupts being re-enabled * right before return. */ - smp_rendezvous_cpus(cpuset, smp_no_rendevous_barrier, NULL, - smp_no_rendevous_barrier, NULL); + smp_rendezvous_cpus(cpuset, smp_no_rendezvous_barrier, NULL, + smp_no_rendezvous_barrier, NULL); } static void Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/i386/i386/pmap.c Sun Apr 9 02:00:03 2017 (r316648) @@ -1195,7 +1195,7 @@ pmap_update_pde(pmap_t pmap, vm_offset_t act.newpde = newpde; CPU_SET(cpuid, &active); smp_rendezvous_cpus(active, - smp_no_rendevous_barrier, pmap == kernel_pmap ? + smp_no_rendezvous_barrier, pmap == kernel_pmap ? pmap_update_pde_kernel : pmap_update_pde_user, pmap_update_pde_teardown, &act); } else { Modified: head/sys/i386/include/counter.h ============================================================================== --- head/sys/i386/include/counter.h Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/i386/include/counter.h Sun Apr 9 02:00:03 2017 (r316648) @@ -148,8 +148,8 @@ counter_u64_zero_inline(counter_u64_t c) *(uint64_t *)((char *)c + sizeof(struct pcpu) * i) = 0; critical_exit(); } else { - smp_rendezvous(smp_no_rendevous_barrier, - counter_u64_zero_one_cpu, smp_no_rendevous_barrier, c); + smp_rendezvous(smp_no_rendezvous_barrier, + counter_u64_zero_one_cpu, smp_no_rendezvous_barrier, c); } } #endif Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/kern/kern_rmlock.c Sun Apr 9 02:00:03 2017 (r316648) @@ -556,9 +556,9 @@ _rm_wlock(struct rmlock *rm) */ #ifdef SMP smp_rendezvous_cpus(readcpus, - smp_no_rendevous_barrier, + smp_no_rendezvous_barrier, rm_cleanIPI, - smp_no_rendevous_barrier, + smp_no_rendezvous_barrier, rm); #else Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/kern/subr_smp.c Sun Apr 9 02:00:03 2017 (r316648) @@ -451,7 +451,7 @@ smp_rendezvous_action(void) * function. Ensure all CPUs have completed the setup * function before moving on to the action function. */ - if (local_setup_func != smp_no_rendevous_barrier) { + if (local_setup_func != smp_no_rendezvous_barrier) { if (smp_rv_setup_func != NULL) smp_rv_setup_func(smp_rv_func_arg); atomic_add_int(&smp_rv_waiters[1], 1); @@ -462,7 +462,7 @@ smp_rendezvous_action(void) if (local_action_func != NULL) local_action_func(local_func_arg); - if (local_teardown_func != smp_no_rendevous_barrier) { + if (local_teardown_func != smp_no_rendezvous_barrier) { /* * Signal that the main action has been completed. If a * full exit rendezvous is requested, then all CPUs will @@ -815,10 +815,10 @@ SYSINIT(cpu_mp_setvariables, SI_SUB_TUNA #endif /* SMP */ void -smp_no_rendevous_barrier(void *dummy) +smp_no_rendezvous_barrier(void *dummy) { #ifdef SMP - KASSERT((!smp_started),("smp_no_rendevous called and smp is started")); + KASSERT((!smp_started),("smp_no_rendezvous called and smp is started")); #endif } Modified: head/sys/mips/include/counter.h ============================================================================== --- head/sys/mips/include/counter.h Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/mips/include/counter.h Sun Apr 9 02:00:03 2017 (r316648) @@ -72,8 +72,8 @@ static inline void counter_u64_zero_inline(counter_u64_t c) { - smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, - smp_no_rendevous_barrier, c); + smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu, + smp_no_rendezvous_barrier, c); } #endif Modified: head/sys/powerpc/include/counter.h ============================================================================== --- head/sys/powerpc/include/counter.h Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/powerpc/include/counter.h Sun Apr 9 02:00:03 2017 (r316648) @@ -72,8 +72,8 @@ static inline void counter_u64_zero_inline(counter_u64_t c) { - smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, - smp_no_rendevous_barrier, c); + smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu, + smp_no_rendezvous_barrier, c); } #endif @@ -138,8 +138,8 @@ static inline void counter_u64_zero_inline(counter_u64_t c) { - smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, - smp_no_rendevous_barrier, c); + smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu, + smp_no_rendezvous_barrier, c); } #endif Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/powerpc/ofw/ofw_machdep.c Sun Apr 9 02:00:03 2017 (r316648) @@ -528,8 +528,8 @@ openfirmware(void *args) #ifdef SMP rv_args.args = args; rv_args.in_progress = 1; - smp_rendezvous(smp_no_rendevous_barrier, ofw_rendezvous_dispatch, - smp_no_rendevous_barrier, &rv_args); + smp_rendezvous(smp_no_rendezvous_barrier, ofw_rendezvous_dispatch, + smp_no_rendezvous_barrier, &rv_args); result = rv_args.retval; #else result = openfirmware_core(args); Modified: head/sys/riscv/include/counter.h ============================================================================== --- head/sys/riscv/include/counter.h Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/riscv/include/counter.h Sun Apr 9 02:00:03 2017 (r316648) @@ -71,8 +71,8 @@ static inline void counter_u64_zero_inline(counter_u64_t c) { - smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, - smp_no_rendevous_barrier, c); + smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu, + smp_no_rendezvous_barrier, c); } #endif Modified: head/sys/sparc64/include/counter.h ============================================================================== --- head/sys/sparc64/include/counter.h Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/sparc64/include/counter.h Sun Apr 9 02:00:03 2017 (r316648) @@ -71,8 +71,8 @@ static inline void counter_u64_zero_inline(counter_u64_t c) { - smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, - smp_no_rendevous_barrier, c); + smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu, + smp_no_rendezvous_barrier, c); } #endif Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/sys/smp.h Sun Apr 9 02:00:03 2017 (r316648) @@ -240,7 +240,7 @@ extern struct mtx smp_ipi_mtx; int quiesce_all_cpus(const char *, int); int quiesce_cpus(cpuset_t, const char *, int); -void smp_no_rendevous_barrier(void *); +void smp_no_rendezvous_barrier(void *); void smp_rendezvous(void (*)(void *), void (*)(void *), void (*)(void *), Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Sun Apr 9 01:35:19 2017 (r316647) +++ head/sys/x86/x86/tsc.c Sun Apr 9 02:00:03 2017 (r316648) @@ -443,12 +443,12 @@ retry: for (i = 0, tsc = data; i < N; i++, tsc += size) smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc); smp_tsc = 1; /* XXX */ - smp_rendezvous(smp_no_rendevous_barrier, comp_smp_tsc, - smp_no_rendevous_barrier, data); + smp_rendezvous(smp_no_rendezvous_barrier, comp_smp_tsc, + smp_no_rendezvous_barrier, data); if (!smp_tsc && adj < smp_tsc_adjust) { adj++; - smp_rendezvous(smp_no_rendevous_barrier, adj_smp_tsc, - smp_no_rendevous_barrier, data); + smp_rendezvous(smp_no_rendezvous_barrier, adj_smp_tsc, + smp_no_rendezvous_barrier, data); goto retry; } free(data, M_TEMP); From owner-svn-src-all@freebsd.org Sun Apr 9 03:50:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74284D35F07; Sun, 9 Apr 2017 03:50:49 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45D4B8E6; Sun, 9 Apr 2017 03:50:49 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v393om2M017689; Sun, 9 Apr 2017 03:50:48 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v393omna017688; Sun, 9 Apr 2017 03:50:48 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201704090350.v393omna017688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sun, 9 Apr 2017 03:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316649 - head/lib/libz X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 03:50:49 -0000 Author: kan Date: Sun Apr 9 03:50:48 2017 New Revision: 316649 URL: https://svnweb.freebsd.org/changeset/base/316649 Log: Add missing double quote to fix r316635 commit. Modified: head/lib/libz/Makefile Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Sun Apr 9 02:00:03 2017 (r316648) +++ head/lib/libz/Makefile Sun Apr 9 03:50:48 2017 (r316649) @@ -40,7 +40,7 @@ SRCS+= uncompr.c SRCS+= zopen.c SRCS+= zutil.c -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64 +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" CFLAGS+= -DUNALIGNED_OK .endif From owner-svn-src-all@freebsd.org Sun Apr 9 04:54:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6701ED35DAC for ; Sun, 9 Apr 2017 04:54:12 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3D4B3E5 for ; Sun, 9 Apr 2017 04:54:11 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f66.google.com with SMTP id x72so1456817lfb.1 for ; Sat, 08 Apr 2017 21:54:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=4sDyreoZ57lEKFLEaTxeAWmDMOzH++bca9a2LKIQ9ck=; b=toEfE8F4Rp5tjjbEqLVE5TQwHgUHV+rpwiqU0KdLS19BC4vIPg0WYZfoCujjjs4HV6 sr34JTRX4BSdDFjzu+G7+QX9lVtRI8QhPZNHvwBjD3Brl/yhn72IW8hogW1JyNnOR219 +oaQ0lNCCLEM8gKa2CZ1heRRPAJoWM5tUZeMbGGJRx+baSUFzwQBpQc3zAt2sR9lvEUk mvzq6axY78ukU1p/duB848tdFviKtxvOSj3/B2KeL71TDPAPqUNxK5w7S1OZM8kqIwDY XIThWAMAd2xlgAuIO446vCV16gkAB6gjXTWfxcTkb45HQmFUmV7kuhH9Hu+zedE/yYcC kzkw== X-Gm-Message-State: AFeK/H2ZIP4UZADoGYheeBkjmWFyKsp+5WigD03uu2sQXQlQiena0EnsVw9bgGrhGnReTA== X-Received: by 10.46.69.133 with SMTP id s127mr13507950lja.44.1491713649481; Sat, 08 Apr 2017 21:54:09 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id i1sm2000887ljd.47.2017.04.08.21.54.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Apr 2017 21:54:08 -0700 (PDT) Subject: Re: svn commit: r316642 - head/sys/dev/syscons To: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704081000.v38A0dBU078784@repo.freebsd.org> From: Andrey Chernov Message-ID: <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> Date: Sun, 9 Apr 2017 07:54:04 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201704081000.v38A0dBU078784@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 04:54:12 -0000 On 08.04.2017 13:00, Bruce Evans wrote: > Log: > Quick fix for removal of the mouse cursor in vga direct graphics modes > (that is, in all supported 8, 15, 16 and 24-color modes). Moving the > mouse cursor while holding down a button (giving cut marking) left a > trail of garbage from misremoved mouse cursors (usually colored > rectangles and not cursor shapes). Cases with a button not held down > worked better and may even have worked. > > No renderer support for removing (software) mouse cursors is needed > (and many renderers don't have any), since sc_remove_mouse_image() > marks for update the region containing the image and usually much > more. The mouse cursor can be (partially) over as many as 4 character > cells, and removing it in only the 1-4 cells occupied by it would be > best for efficiency and for avoiding flicker. Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for the case they overlap valid characters region for some code tables. From owner-svn-src-all@freebsd.org Sun Apr 9 05:24:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A36FD35434 for ; Sun, 9 Apr 2017 05:24:03 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBBA9CA for ; Sun, 9 Apr 2017 05:24:02 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f67.google.com with SMTP id i3so2304242lfh.2 for ; Sat, 08 Apr 2017 22:24:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=1fnU/57/69WsPAPZDyrTfgev2j7+LI7nrpZ2LxO/2kQ=; b=Tztcl6ai7mp+dM4h+aH5kni3nDgLGZJGDRJNG3IHDoGgoMsFD15gjG75kpErZh8tTS SkS/U0IPYOBkcuQkW7TOf+av5XZ6evlXRgAXpFFtrNkxxyCf2ynIV+WdAND7PlSZHEQM guf2wlK8slBe0Bqcp8lMk59nPH13kRJyNpaJZg6Uu2meKt90lk28Y7waPDmxHxv8IDsP I+A3pDFl6SFgB24sBgvhGkv1T2nAeYZ0DE4QY34YhcFY4RSyWx1JDY9oGgyKXMgWW97w qZM/3J9plxXMyth+Hxb+eEef4N7wx4wXi1u6Ggb6e43IgQV/U9Pos9Qo1MukiCOO2uLR CWrA== X-Gm-Message-State: AFeK/H2s1vl+JKPI63SZCgVcBX+IYIRUqykmHs+SQTVTjfNP5T5HiRxXSnuLAgFxV46lJw== X-Received: by 10.25.43.205 with SMTP id r196mr13847821lfr.116.1491715440488; Sat, 08 Apr 2017 22:24:00 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id e124sm1969792lfg.8.2017.04.08.22.23.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Apr 2017 22:23:59 -0700 (PDT) Subject: Re: svn commit: r316642 - head/sys/dev/syscons To: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704081000.v38A0dBU078784@repo.freebsd.org> <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> From: Andrey Chernov Message-ID: <23b8c635-f856-51b5-a338-d9bb53aefc7c@freebsd.org> Date: Sun, 9 Apr 2017 08:23:55 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 05:24:03 -0000 On 09.04.2017 7:54, Andrey Chernov wrote: > On 08.04.2017 13:00, Bruce Evans wrote: >> Log: >> Quick fix for removal of the mouse cursor in vga direct graphics modes >> (that is, in all supported 8, 15, 16 and 24-color modes). Moving the >> mouse cursor while holding down a button (giving cut marking) left a >> trail of garbage from misremoved mouse cursors (usually colored >> rectangles and not cursor shapes). Cases with a button not held down >> worked better and may even have worked. >> >> No renderer support for removing (software) mouse cursors is needed >> (and many renderers don't have any), since sc_remove_mouse_image() >> marks for update the region containing the image and usually much >> more. The mouse cursor can be (partially) over as many as 4 character >> cells, and removing it in only the 1-4 cells occupied by it would be >> best for efficiency and for avoiding flicker. > > Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes > SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for > the case they overlap valid characters region for some code tables. Probably we just can change default to remove additional vidcontrol -M setup. I usually have this range started with 0x03. From owner-svn-src-all@freebsd.org Sun Apr 9 06:44:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D17E2D356E1; Sun, 9 Apr 2017 06:44:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96780F7; Sun, 9 Apr 2017 06:44:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v396i155089286; Sun, 9 Apr 2017 06:44:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v396i17S089285; Sun, 9 Apr 2017 06:44:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704090644.v396i17S089285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 9 Apr 2017 06:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316650 - stable/11/sys/dev/usb/controller X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 06:44:02 -0000 Author: mav Date: Sun Apr 9 06:44:01 2017 New Revision: 316650 URL: https://svnweb.freebsd.org/changeset/base/316650 Log: MFC r316412: Add IDs for Intel Cougar Point USB 2.0 controller. Modified: stable/11/sys/dev/usb/controller/ehci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/11/sys/dev/usb/controller/ehci_pci.c Sun Apr 9 03:50:48 2017 (r316649) +++ stable/11/sys/dev/usb/controller/ehci_pci.c Sun Apr 9 06:44:01 2017 (r316650) @@ -124,6 +124,10 @@ ehci_pci_match(device_t self) case 0x0f348086: return ("Intel BayTrail USB 2.0 controller"); + case 0x1c268086: + return ("Intel Cougar Point USB 2.0 controller"); + case 0x1c2d8086: + return ("Intel Cougar Point USB 2.0 controller"); case 0x1d268086: return ("Intel Patsburg USB 2.0 controller"); case 0x1d2d8086: From owner-svn-src-all@freebsd.org Sun Apr 9 06:44:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83010D35752; Sun, 9 Apr 2017 06:44:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52DCE22B; Sun, 9 Apr 2017 06:44:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v396iVJS089359; Sun, 9 Apr 2017 06:44:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v396iVEw089358; Sun, 9 Apr 2017 06:44:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704090644.v396iVEw089358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 9 Apr 2017 06:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316651 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 06:44:32 -0000 Author: mav Date: Sun Apr 9 06:44:31 2017 New Revision: 316651 URL: https://svnweb.freebsd.org/changeset/base/316651 Log: MFC r316412: Add IDs for Intel Cougar Point USB 2.0 controller. Modified: stable/10/sys/dev/usb/controller/ehci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/ehci_pci.c Sun Apr 9 06:44:01 2017 (r316650) +++ stable/10/sys/dev/usb/controller/ehci_pci.c Sun Apr 9 06:44:31 2017 (r316651) @@ -124,6 +124,10 @@ ehci_pci_match(device_t self) case 0x0f348086: return ("Intel BayTrail USB 2.0 controller"); + case 0x1c268086: + return ("Intel Cougar Point USB 2.0 controller"); + case 0x1c2d8086: + return ("Intel Cougar Point USB 2.0 controller"); case 0x1d268086: return ("Intel Patsburg USB 2.0 controller"); case 0x1d2d8086: From owner-svn-src-all@freebsd.org Sun Apr 9 06:47:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0505D357FC; Sun, 9 Apr 2017 06:47:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 8C74A3D2; Sun, 9 Apr 2017 06:47:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id F24C042727A; Sun, 9 Apr 2017 16:46:54 +1000 (AEST) Date: Sun, 9 Apr 2017 16:46:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316642 - head/sys/dev/syscons In-Reply-To: <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> Message-ID: <20170409150512.B1318@besplex.bde.org> References: <201704081000.v38A0dBU078784@repo.freebsd.org> <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=2kjGuNizMhM4yULxnWoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 06:47:04 -0000 On Sun, 9 Apr 2017, Andrey Chernov wrote: > On 08.04.2017 13:00, Bruce Evans wrote: >> Log: >> Quick fix for removal of the mouse cursor in vga direct graphics modes >> (that is, in all supported 8, 15, 16 and 24-color modes). Moving the >> mouse cursor while holding down a button (giving cut marking) left a >> trail of garbage from misremoved mouse cursors (usually colored >> rectangles and not cursor shapes). Cases with a button not held down >> worked better and may even have worked. >> >> No renderer support for removing (software) mouse cursors is needed >> (and many renderers don't have any), since sc_remove_mouse_image() >> marks for update the region containing the image and usually much >> more. The mouse cursor can be (partially) over as many as 4 character >> cells, and removing it in only the 1-4 cells occupied by it would be >> best for efficiency and for avoiding flicker. > > Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes > SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for > the case they overlap valid characters region for some code tables. I didn't forget it, but these cells are only used in text mode and there are only 4 of them AFAIK (-M goes up to 252, which leaves space for only 4 cells 252-255). Text mode is is one case that has no renderer support for the mouse cursor. Later I found that some renderer support is needed in all graphics modes and would be needed in text mode too if it supported a reduced window (say 79x24) so that the mouse cursor works better. Normally the mouse course is reduced to 1 dot if it is at the right or bottom border, but in graphics modes there is sometimes extra space outside of the text window. E.g., in 800x600 mode, the default text window with an 8x16 font is 100x37 which occupies 800x592, so there is no extra space at the right border and 8 pixels at the bottom border. Users who wantt to see the full mouse cursor at the borders should configure a 99x36 or just an 80x25 text window. In text modes, there is no option to reduce the text window. So in graphics but not in text modes, the mouse cursor renderer must have special support for erasing the mouse outside of the text window, since other drawing methods top at the border. I don't understand SC_CURSOR_CHAR completely yet, but my cursor fixes so far are mainly to prepare for improving the keyboard cursor. SC_CURSOR_CHAR is normally statically configured as (0x07) SC_MOUSE_CHAR as (0xd0) (both with bogus parentheses). SC_CURSOR_CHAR is ifdefed but is not a supported option. SC_MOUSE_CHAR is a supported option. NOTES gives the example of setting it to 0x3. Then if the configured SC_CURSOR_CHAR is inside the 4-char range for the mouse cursor, then SC_CURSOR_CHAR is moved to (SC_MOUSE_CHAR + 4), although this is even more broken if the mouse range is 252-255 and the cursor char is in this range -- then the cursor char ends up as the invalid char 256. Reconfiguring the mouse char range using -M causes similar problems. There is no way to reconfigure the cursor char AFAIK. In fact, it doesn't even seem to be configured -- SC_CURSOR_CHAR is never used, so I think sc->cursor_char is only statically initialized to 0. This is a smaller bug with scteken. Teken breaks support for printing character 0 (which is normally blank in syscons' fonts), so this font position for this character is always available for use as the cursor character. I tested using the cursor char a little. I normally use a non-blinking normal keyboard cursor and see only negative advantages for the cursor character. But it would be useful to switch the cursor character(s) or attributes occasionally to highlight the cursor by blinking it once or twice, as is done using ripples for mouse cursors in some systems. Changing the charcter is more interesting than blinking, and needed more if there are only 2 colors. The "normal" keyboard cursor should be the character under the cursor with its bg modified to a unique color. This only happens in some cases now. Text mode usually works right, except the preferred unique color is hard-coded as white and when the fg or bg or the current char is also white, reverse video is used instead. Other modes mostly use reverse video. Reverse video is worse than usual when it is done more than once. Cur marking also gives reverse video. The sc cursor over cut marking is reversed again, making it look strange. The vt cursor over cut marking is not reversed again, making it invisible. The mouse cursor mostly works better by being destructive. Bruce From owner-svn-src-all@freebsd.org Sun Apr 9 07:53:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8320D36852; Sun, 9 Apr 2017 07:53:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B861A64F; Sun, 9 Apr 2017 07:53:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v397rVpZ017352; Sun, 9 Apr 2017 07:53:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v397rVI3017350; Sun, 9 Apr 2017 07:53:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704090753.v397rVI3017350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 9 Apr 2017 07:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316652 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 07:53:33 -0000 Author: mav Date: Sun Apr 9 07:53:31 2017 New Revision: 316652 URL: https://svnweb.freebsd.org/changeset/base/316652 Log: Fix few minor issues found by Clang Analyzer. MFC after: 2 weeks Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Apr 9 06:44:31 2017 (r316651) +++ head/sys/dev/isp/isp.c Sun Apr 9 07:53:31 2017 (r316652) @@ -2662,7 +2662,8 @@ isp_plogx(ispsoftc_t *isp, int chan, uin break; } if (msg) { - isp_prt(isp, ISP_LOGERR, "Chan %d PLOGX PortID 0x%06x to N-Port handle 0x%x: %s", chan, portid, handle, msg); + isp_prt(isp, lev, "Chan %d PLOGX PortID 0x%06x to N-Port handle 0x%x: %s", + chan, portid, handle, msg); } return (rval); } Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sun Apr 9 06:44:31 2017 (r316651) +++ head/sys/dev/isp/isp_freebsd.c Sun Apr 9 07:53:31 2017 (r316652) @@ -3779,7 +3779,6 @@ changed: nlstate = reason = 0; } va_end(ap); - fc = ISP_FC_PC(isp, bus); if (evt == ISPASYNC_CHANGE_PDB) { msg = "Port Database Changed"; From owner-svn-src-all@freebsd.org Sun Apr 9 07:54:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44AF9D368B8; Sun, 9 Apr 2017 07:54:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF703821; Sun, 9 Apr 2017 07:54:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v397sekH017431; Sun, 9 Apr 2017 07:54:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v397sdxA017429; Sun, 9 Apr 2017 07:54:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704090754.v397sdxA017429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 9 Apr 2017 07:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316653 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 07:54:41 -0000 Author: mav Date: Sun Apr 9 07:54:39 2017 New Revision: 316653 URL: https://svnweb.freebsd.org/changeset/base/316653 Log: Fix few minor issues found by Clang Analyzer. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Apr 9 07:53:31 2017 (r316652) +++ head/sys/cam/ctl/ctl.c Sun Apr 9 07:54:39 2017 (r316653) @@ -7047,7 +7047,7 @@ ctl_get_lba_status(struct ctl_scsiio *ct lbalen->len = total_len; lbalen->flags = 0; retval = lun->backend->config_read((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + return (retval); } int Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Apr 9 07:53:31 2017 (r316652) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Apr 9 07:54:39 2017 (r316653) @@ -321,11 +321,10 @@ cfiscsi_pdu_handle(struct icl_pdu *reque static void cfiscsi_receive_callback(struct icl_pdu *request) { +#ifdef ICL_KERNEL_PROXY struct cfiscsi_session *cs; cs = PDU_SESSION(request); - -#ifdef ICL_KERNEL_PROXY if (cs->cs_waiting_for_ctld || cs->cs_login_phase) { if (cs->cs_login_pdu == NULL) cs->cs_login_pdu = request; @@ -1709,6 +1708,13 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) sbuf_finish(sb); error = copyout(sbuf_data(sb), cilp->conn_xml, sbuf_len(sb) + 1); + if (error != 0) { + sbuf_delete(sb); + snprintf(ci->error_str, sizeof(ci->error_str), + "copyout failed with error %d", error); + ci->status = CTL_ISCSI_ERROR; + return; + } cilp->fill_len = sbuf_len(sb) + 1; ci->status = CTL_ISCSI_OK; sbuf_delete(sb); @@ -2163,9 +2169,9 @@ cfiscsi_ioctl_port_create(struct ctl_req retval = ctl_port_register(port); if (retval != 0) { ctl_free_opts(&port->options); - cfiscsi_target_release(ct); free(port->port_devid, M_CFISCSI); free(port->target_devid, M_CFISCSI); + cfiscsi_target_release(ct); req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), "ctl_port_register() failed with error %d", retval); From owner-svn-src-all@freebsd.org Sun Apr 9 07:58:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99557D369C8; Sun, 9 Apr 2017 07:58:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 2EEB1A45; Sun, 9 Apr 2017 07:58:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 2CDA3D6823A; Sun, 9 Apr 2017 17:33:10 +1000 (AEST) Date: Sun, 9 Apr 2017 17:33:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r316642 - head/sys/dev/syscons In-Reply-To: <23b8c635-f856-51b5-a338-d9bb53aefc7c@freebsd.org> Message-ID: <20170409164754.E1567@besplex.bde.org> References: <201704081000.v38A0dBU078784@repo.freebsd.org> <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> <23b8c635-f856-51b5-a338-d9bb53aefc7c@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=zyuj5AaQCvbWOqxV1wsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 07:58:47 -0000 On Sun, 9 Apr 2017, Andrey Chernov wrote: > On 09.04.2017 7:54, Andrey Chernov wrote: >> On 08.04.2017 13:00, Bruce Evans wrote: >>> Log: >>> Quick fix for removal of the mouse cursor in vga direct graphics modes >>> ... >> >> Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes >> SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for >> the case they overlap valid characters region for some code tables. > > Probably we just can change default to remove additional vidcontrol -M > setup. I usually have this range started with 0x03. That can only work if you also avoid 9-bit text modes. 9-bit modes give 1-bit separations between characters, except for those in the graphics range (starting at about 0xd0). Hmm, syscons already seems to have bugs handling this. The mouse cursor is always 8x16, usually split into 4. For cells placed outside the graphics region, this gives 1-bit gaps in 9-bit mode. For cells placed in the graphics region, it is a difficult or impossible transformation which is not done to rearrange the pixels to fill in the gaps correctly. 9-bit mode basically gives an 9x16 cursor, but the 9th bit is already unusable within a single cell, since it would extend the rightmost pixels in the 8x16 cursor in an ugly way. These pixels are for 1 end of the arrow and the end of its right barb. The extension occurs every 8th x position when the cursor is moved from left to right. Also, when the cursor is moved over an ordinary character, the ordinary character is merged into the cursor and drawn as part of the cursor. This gives ugly extensions of '0' characters in a font carefully designed for 9-bit mode (the '0' characters are a full 8 bits wide and if they are in the graphics range the become 9 bits wide with extra pixels on the right). This problem doesn't occur in graphics mode. However, graphics mode should support 9-bit mode in software, so that the fonts carefully designed for 9-bit mode can be used. 8 bits wide is too narrow for a good font (it requires '0' to be only 7 bits wide...), and is even worse when used with fonts designed for 9-bit mode (their '0's and 'M's are not separated). vt uses a 10x16 mouse cursor and only supports it in graphics mode. The extra bit makes it look much better. Support for 9-bit mode is otherwise worse in vt than in sc. E.g, the cp437 glyphs for line drawing characters don't work in 9-bit text mode, since a gap is left between then. I think the bit that controls extension is forced off together with the bit that controls blinking fg/bg brightness, so even if these glyphs are rendered using a char in the graphics range, they are not extended. 9-bit text modes are hard to avoid. 90-column sc modes avoid them, but tend to be broken on newer hardware. The newer hardware tends to force 9-bit modes because this is normal and works better. I have just 1 system (an 11 year old laptop) than forces 8-bit mode instead. Bruce From owner-svn-src-all@freebsd.org Sun Apr 9 08:12:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9687DD36FDC; Sun, 9 Apr 2017 08:12:19 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BC433A7; Sun, 9 Apr 2017 08:12:19 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OO400I00UEDRU00@st13p35im-asmtp001.me.com>; Sun, 09 Apr 2017 08:12:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1491725538; bh=kGzK2dSWXEL7PDU/fEfFVBvd+FvXoBDLvXGsyUroNvw=; h=From:Message-id:Content-type:MIME-version:Subject:Date:To; b=VOmlUlKeGTrTvfSMlqvS6OU7uXSOchILVaGIGLu+LhXzOF0dZAqaZ3/ynIRiHt0/S jvANv193/vtpMRiNqc4dtxf/QfChWz+ZQyImDYFI+oNWWyL3l1OHPxOwq9bEsldNCe CpiNLZszcVCJKohvYZlR5M3KrktaAahuNTxZTNGkvAVKhaa8vomtDJb49XPkTezrSV ioC05mgnRVa9GPmD5YQSBd2glaIRxnrtHKlcRKoUw+/fbnolVPbS+ea6PkZ5DXqtge CpR+u4NdkE9QxYEWnFmxlbY3+vWfOOjdIVKMat5LixKV/nuXCrB01bUFQRloUlGhhT Yc2YhGOLvSnPg== Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OO400DSGUSEYM00@st13p35im-asmtp001.me.com>; Sun, 09 Apr 2017 08:12:17 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-09_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1704090074 From: Toomas Soome Message-id: <32C6ACC7-C1A5-4797-81E1-7F630FB94D14@me.com> MIME-version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r316585 - in head/sys/boot: efi/boot1 efi/loader i386/common i386/loader i386/zfsboot zfs Date: Sun, 09 Apr 2017 11:12:14 +0300 In-reply-to: <20170408221653.qtqdvgcosguvugtt@mutt-hbsd> Cc: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Shawn Webb References: <201704061817.v36IHT8i088712@repo.freebsd.org> <20170408221653.qtqdvgcosguvugtt@mutt-hbsd> X-Mailer: Apple Mail (2.3273) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 08:12:19 -0000 > On 9. apr 2017, at 1:16, Shawn Webb = wrote: >=20 > On Thu, Apr 06, 2017 at 06:17:29PM +0000, Toomas Soome wrote: >> Author: tsoome >> Date: Thu Apr 6 18:17:29 2017 >> New Revision: 316585 >> URL: https://svnweb.freebsd.org/changeset/base/316585 >>=20 >> Log: >> loader: zfs reader should check all labels >>=20 >> The current zfs reader is only checking first label from each = device, however, >> we do have 4 labels on device and we should check all 4 to be = protected >> against disk failures and incomplete label updates. >>=20 >> The difficulty is about the fact that 2 label copies are in front of = the >> pool data, and 2 are at the end, which means, we have to know the = size of >> the pool data area. >>=20 >> Since we have now the mechanism from common/disk.c to use the = partition >> information, it does help us in this task; however, there are still = some >> corner cases. >>=20 >> Namely, if the pool is created without partition, directly on the = disk, >> and firmware will give us the wrong size for the disk, we only can = check >> the first two label copies. >>=20 >> Reviewed by: allanjude >> Differential Revision: https://reviews.freebsd.org/D10203 >=20 > This breaks bhyve userboot: >=20 > # sh /usr/share/examples/bhyve/vmrun.sh -c 8 -m 16g -t tap4 -C = /dev/nmdm-laptop-dev-03-A -d = /dev/zvol/enctank/bhyve/laptop-dev-03/disk-01 laptop-dev-03 > /boot/userboot.so: Undefined symbol "ldi_get_size" >=20 > Thanks, >=20 > --=20 > Shawn Webb > Cofounder and Security Engineer > HardenedBSD >=20 > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 = 6EEE Yep, the fix is posted as part of https://reviews.freebsd.org/D10302 = - I=E2=80=99m currently running the = build to double check and I think I=E2=80=99ll make the userboot commit = as soon as it is verified. Sorry for the mess. rgds, toomas From owner-svn-src-all@freebsd.org Sun Apr 9 08:55:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82700D35B35 for ; Sun, 9 Apr 2017 08:55:16 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32129B09 for ; Sun, 9 Apr 2017 08:55:16 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f68.google.com with SMTP id x72so1662370lfb.1 for ; Sun, 09 Apr 2017 01:55:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=b/oUDmp7cG8z4xoz+xQyltif3CN0KWPfj4gt6vvmPDY=; b=lTHZSJEcP6qPN/Y/cqvNsjOp4KVp7st+4Up88fBirWptzGyoq3PwRdVhaUzHB66CSw RYnrr3BHdnEdhHNdYyi5cdLUWurekkYxCCWLBzulpoMgl3Qrvmnyir+l6YffQrcOxSiU Mypn0pwgOkW71l6FqUH63A+TOUaDWbeMi4kDTUegzm1kNAefY69OuS92Am9kU6NQSjEJ 7W6EEP53BMMcQG29vQGxXDKiltgXXz1PZlk1zI08LY60I6plrOVzcmKVor/biIGPlnCb 071dLO3WZZj6QyNp49FEyNmTE902e7dPQA+z5tDXBUpWw4GjGA+jY46Ku4jZgvc2KUdv +zNw== X-Gm-Message-State: AFeK/H0zRxxEHIhEsU93EqXV9JstmsTOygGCNJLSFHmQOvuI/G8rdWlST8Vau5/EKR0lFA== X-Received: by 10.25.17.153 with SMTP id 25mr15794043lfr.39.1491728107592; Sun, 09 Apr 2017 01:55:07 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id l2sm2050866lfe.69.2017.04.09.01.55.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 01:55:07 -0700 (PDT) Subject: Re: svn commit: r316642 - head/sys/dev/syscons To: Bruce Evans References: <201704081000.v38A0dBU078784@repo.freebsd.org> <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> <20170409150512.B1318@besplex.bde.org> Cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <5d76f933-7d70-411f-9233-0f1e6b72023e@freebsd.org> Date: Sun, 9 Apr 2017 11:55:00 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170409150512.B1318@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 08:55:16 -0000 On 09.04.2017 9:46, Bruce Evans wrote: >> Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes >> SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for >> the case they overlap valid characters region for some code tables. > > I didn't forget it, but these cells are only used in text mode and there > are only 4 of them AFAIK (-M goes up to 252, which leaves space for only > 4 cells 252-255). Text mode is is one case that has no renderer support > for the mouse cursor. Here is 5th one (depends of SC_MOUSE_CHAR which can be set in the kernel config): #if SC_MOUSE_CHAR <= SC_CURSOR_CHAR && SC_CURSOR_CHAR < (SC_MOUSE_CHAR + 4) #undef SC_CURSOR_CHAR #define SC_CURSOR_CHAR (SC_MOUSE_CHAR + 4) #endif > NOTES gives the example of setting it to 0x3. Then if the configured > SC_CURSOR_CHAR is inside the 4-char range for the mouse cursor, then AFAIK SC_CURSOR_CHAR kernel config or vidcontrol is not supported. > There is no way to reconfigure the cursor char AFAIK. In fact, it > doesn't even seem to be configured -- SC_CURSOR_CHAR is never used, I remember times it was used but not remember how, log history needs to be browsed. From owner-svn-src-all@freebsd.org Sun Apr 9 09:00:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23161D35DF1 for ; Sun, 9 Apr 2017 09:00:51 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C28D9CD4 for ; Sun, 9 Apr 2017 09:00:50 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f65.google.com with SMTP id i3so2493606lfh.2 for ; Sun, 09 Apr 2017 02:00:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=7ua5i1h1pb7agbu5zTqmjGE/SdLgvAfURASwwB1XgXI=; b=iV1boeDDvsj8iH8V04PC9EutnLH+SI86xEHU74adxQXWFwOtUBgoCZcQhYSmmAkS35 dE4I79C4dDAFpearP++x+cCF5md5vIDJB19vIlNZO0RsHKPqhFy6V27Gr+k/s+uRkCX5 24yOmA+hWS2Tdn8nPR2//52YIyqxK153xUtjcMjz0hC8fqnlz0HinQydc9XyuUUOBOzc PB8varnrl3bK5v2unfitdJRe5sSmvA3/T7+T8354vmoeR6h1HuQKbM9ZasNgaHStWBTh F5hRxOS7fdDpSfXHRe8/7SXzf09nlTtucCvJ3GJekvpGOc7vTvwb8Fg7g8Pnd/xX4qFy sUkw== X-Gm-Message-State: AFeK/H0Ury+FyWkSc0lZPvQHNZfQaPrQvzr7HNP9OK/PUK03Sai3DoE26Wl+miJLS/59eQ== X-Received: by 10.46.22.11 with SMTP id w11mr13676064ljd.68.1491728448415; Sun, 09 Apr 2017 02:00:48 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id o80sm2056831lff.25.2017.04.09.02.00.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 02:00:48 -0700 (PDT) Subject: Re: svn commit: r316642 - head/sys/dev/syscons To: Bruce Evans References: <201704081000.v38A0dBU078784@repo.freebsd.org> <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> <23b8c635-f856-51b5-a338-d9bb53aefc7c@freebsd.org> <20170409164754.E1567@besplex.bde.org> Cc: Bruce Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Andrey Chernov Message-ID: Date: Sun, 9 Apr 2017 12:00:43 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170409164754.E1567@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 09:00:51 -0000 On 09.04.2017 10:33, Bruce Evans wrote: > On Sun, 9 Apr 2017, Andrey Chernov wrote: > >> On 09.04.2017 7:54, Andrey Chernov wrote: >>> On 08.04.2017 13:00, Bruce Evans wrote: >>>> Log: >>>> Quick fix for removal of the mouse cursor in vga direct graphics >>>> modes >>>> ... >>> >>> Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes >>> SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for >>> the case they overlap valid characters region for some code tables. >> >> Probably we just can change default to remove additional vidcontrol -M >> setup. I usually have this range started with 0x03. > > That can only work if you also avoid 9-bit text modes. 9-bit modes > give 1-bit separations between characters, except for those in the > graphics range (starting at about 0xd0). Then let is stays as it is. For me small line in the mouse cursor looks less distractive that junk in all 4 chars around, which happens if fonts codepage have 0xd0-0xd3 as valid characters. From owner-svn-src-all@freebsd.org Sun Apr 9 10:32:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F52CD34FE9; Sun, 9 Apr 2017 10:32:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 682F6B6; Sun, 9 Apr 2017 10:32:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 7B4B21A092C; Sun, 9 Apr 2017 20:32:37 +1000 (AEST) Date: Sun, 9 Apr 2017 20:32:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316642 - head/sys/dev/syscons In-Reply-To: <5d76f933-7d70-411f-9233-0f1e6b72023e@freebsd.org> Message-ID: <20170409195358.I2327@besplex.bde.org> References: <201704081000.v38A0dBU078784@repo.freebsd.org> <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> <20170409150512.B1318@besplex.bde.org> <5d76f933-7d70-411f-9233-0f1e6b72023e@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=lf6DMTtkoMZp8MRgiEkA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 10:32:45 -0000 On Sun, 9 Apr 2017, Andrey Chernov wrote: > On 09.04.2017 9:46, Bruce Evans wrote: >>> Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes >>> SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for >>> the case they overlap valid characters region for some code tables. >> >> I didn't forget it, but these cells are only used in text mode and there >> are only 4 of them AFAIK (-M goes up to 252, which leaves space for only >> 4 cells 252-255). Text mode is is one case that has no renderer support >> for the mouse cursor. > > Here is 5th one (depends of SC_MOUSE_CHAR which can be set in the kernel > config): > > #if SC_MOUSE_CHAR <= SC_CURSOR_CHAR && SC_CURSOR_CHAR < (SC_MOUSE_CHAR + 4) > #undef SC_CURSOR_CHAR > #define SC_CURSOR_CHAR (SC_MOUSE_CHAR + 4) > #endif > >> NOTES gives the example of setting it to 0x3. Then if the configured >> SC_CURSOR_CHAR is inside the 4-char range for the mouse cursor, then > > AFAIK SC_CURSOR_CHAR kernel config or vidcontrol is not supported. > >> There is no way to reconfigure the cursor char AFAIK. In fact, it >> doesn't even seem to be configured -- SC_CURSOR_CHAR is never used, > > I remember times it was used but not remember how, log history needs to > be browsed. The initializations are well hidden in MD code: {arm,mips,powerpc,sparc64} /.../sc_machdep.c and isa/syscons_isa.c. This is sort of backwards. The MI initializations of sc->cursor_char are in MD files, while the more MD default value of SC_CURSOR_CHAR is in an MI file. Then sc->cursor_char is only used by the vga renderer for text mode. This is closely associated with isa, so the initializations are mostly irrelevant since their result is not used. How do you initialize actual use of sc->cursor_char? It is only used when SC_NO_FONT_LOADING is not defined. Configuring SC_PIXEL_MODE forces SC_NO_FONT_LOADING to be undefined. Except to test sc->cursor_char, I removed the #undef for this. Next, sc->cursor_char is only used if scp->curs.attr_flags & CONS_CHAR_CURSOR. vidcontrol only supports this with blinking too, and I know I don't want that. Anyway, font loading is almost always defined. Apparently the char cursor is turned off with loadable fonts since it would mess up special fonts more than the default font. But not as much as the mouse cursor. Bruce From owner-svn-src-all@freebsd.org Sun Apr 9 11:09:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1402DD366F6; Sun, 9 Apr 2017 11:09:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id D12F01C1; Sun, 9 Apr 2017 11:09:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 408B91A1881; Sun, 9 Apr 2017 21:09:14 +1000 (AEST) Date: Sun, 9 Apr 2017 21:09:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Bruce Evans , Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316642 - head/sys/dev/syscons In-Reply-To: Message-ID: <20170409203245.I2327@besplex.bde.org> References: <201704081000.v38A0dBU078784@repo.freebsd.org> <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> <23b8c635-f856-51b5-a338-d9bb53aefc7c@freebsd.org> <20170409164754.E1567@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=pFTmfaicEet0DjLtfrUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 11:09:16 -0000 On Sun, 9 Apr 2017, Andrey Chernov wrote: > On 09.04.2017 10:33, Bruce Evans wrote: >> On Sun, 9 Apr 2017, Andrey Chernov wrote: >> >>> On 09.04.2017 7:54, Andrey Chernov wrote: >>>> On 08.04.2017 13:00, Bruce Evans wrote: >>>>> Log: >>>>> Quick fix for removal of the mouse cursor in vga direct graphics >>>>> modes >>>>> ... >>>> >>>> Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes >>>> SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for >>>> the case they overlap valid characters region for some code tables. >>> >>> Probably we just can change default to remove additional vidcontrol -M >>> setup. I usually have this range started with 0x03. >> >> That can only work if you also avoid 9-bit text modes. 9-bit modes >> give 1-bit separations between characters, except for those in the >> graphics range (starting at about 0xd0). > > Then let is stays as it is. For me small line in the mouse cursor looks > less distractive that junk in all 4 chars around, which happens if fonts > codepage have 0xd0-0xd3 as valid characters. Both look bad. Low characters are a better choice if you don't mind the gap, since sc has too many magic characters whose magic can't be turned off with a flag line -opost. These chars are 7-13 and 27. Also 0 with scteken. I don't know of any way to reach the glyphs behind these characters using syscons. The cursor would have to have to consist of vertical lines of width 2 or more for it to be translatable across all positions (reduce to width 1 at the gap so that the hardware extends back to width 2). 8x16 doesn't have enough pixels for that. The border has width 1 in most places. Bruce From owner-svn-src-all@freebsd.org Sun Apr 9 11:16:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DABD5D36AEE; Sun, 9 Apr 2017 11:16:17 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DE61A59; Sun, 9 Apr 2017 11:16:17 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39BGGij001025; Sun, 9 Apr 2017 11:16:16 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39BGGJu001023; Sun, 9 Apr 2017 11:16:16 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201704091116.v39BGGJu001023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 9 Apr 2017 11:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316654 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 11:16:18 -0000 Author: tsoome Date: Sun Apr 9 11:16:16 2017 New Revision: 316654 URL: https://svnweb.freebsd.org/changeset/base/316654 Log: loader: r316585 did miss userboot update The work to implement zfs reader to inspect all pool label copies did miss the userboot, this update does correct this issue. Since userboot is already using common/disk.c API (disk_open() etc), the fix is quite simple - we only need to make sure the userdisk_iocl() will call disk_ioctl(). In addition, the diskioctl callback does return int, not pointer. Note, the review request is actually addressing the sparc and userboot, but as testing the fix for sparc will take some more time, I am posting the userboot fix now. This patch is part of the implementation presented in review: https://reviews.freebsd.org/D10302 Once we have the sparc part tested, we will have the complete fix for the issue. Reviewed by: imp Modified: head/sys/boot/userboot/userboot/main.c head/sys/boot/userboot/userboot/userboot_disk.c Modified: head/sys/boot/userboot/userboot/main.c ============================================================================== --- head/sys/boot/userboot/userboot/main.c Sun Apr 9 07:54:39 2017 (r316653) +++ head/sys/boot/userboot/userboot/main.c Sun Apr 9 11:16:16 2017 (r316654) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bootstrap.h" #include "disk.h" @@ -270,6 +271,16 @@ command_reloadbe(int argc, char *argv[]) return (CMD_OK); } + +uint64_t +ldi_get_size(void *priv) +{ + int fd = (uintptr_t) priv; + uint64_t size; + + ioctl(fd, DIOCGMEDIASIZE, &size); + return (size); +} #endif /* USERBOOT_ZFS_SUPPORT */ COMMAND_SET(quit, "quit", "exit the loader", command_quit); Modified: head/sys/boot/userboot/userboot/userboot_disk.c ============================================================================== --- head/sys/boot/userboot/userboot/userboot_disk.c Sun Apr 9 07:54:39 2017 (r316653) +++ head/sys/boot/userboot/userboot/userboot_disk.c Sun Apr 9 11:16:16 2017 (r316654) @@ -91,8 +91,8 @@ userdisk_init(void) return (ENOMEM); for (i = 0; i < userdisk_maxunit; i++) { if (CALLBACK(diskioctl, i, DIOCGSECTORSIZE, - §orsize) != NULL || CALLBACK(diskioctl, i, - DIOCGMEDIASIZE, &mediasize) != NULL) + §orsize) != 0 || CALLBACK(diskioctl, i, + DIOCGMEDIASIZE, &mediasize) != 0) return (ENXIO); ud_info[i].mediasize = mediasize; ud_info[i].sectorsize = sectorsize; @@ -230,7 +230,12 @@ static int userdisk_ioctl(struct open_file *f, u_long cmd, void *data) { struct disk_devdesc *dev; + int rc; dev = (struct disk_devdesc *)f->f_devdata; + rc = disk_ioctl(dev, cmd, data); + if (rc != ENOTTY) + return (rc); + return (CALLBACK(diskioctl, dev->d_unit, cmd, data)); } From owner-svn-src-all@freebsd.org Sun Apr 9 11:43:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25712D342E2 for ; Sun, 9 Apr 2017 11:43:47 +0000 (UTC) (envelope-from yee.cassity@51succ.com) Received: from sv.51succ.com (sv.51succ.com [107.174.240.188]) by mx1.freebsd.org (Postfix) with ESMTP id CF86B966 for ; Sun, 9 Apr 2017 11:43:46 +0000 (UTC) (envelope-from yee.cassity@51succ.com) Received: from mx-a21-host1 (mx-a21-host1 [192.168.20.1]) by mail1 (Postfix) with SMTP id 5588E6054B for ; Sun, 9 Apr 2017 04:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=51succ.com; s=51succ_com; t=1491737621; bh=f3wqdsI6Tv2Tpwh22YOAYOVB9CLnd41uayGoy64U+PI=; h=MIME-Version:From:To:Reply-To:Date:Message-ID:Subject: Content-Type; b=G7Uni/qQWnfKBQpWotaoONmXay7zS3GNnLaRwYcKeqzsllLwhRJpw0Lx1461gYESP LxIbNjhdj/Gud/+GV17o5nsUHxQuKZFcKzxSnoE4aLnqrAMZ8xj48LPglsQdcpOaDb tC+RzutLzbtOu5KojVh05c8pAAF/xRslgg4JXst8= MIME-Version: 1.0 From: "Domain Notice" To: "Domain Owner" Reply-To: Domain Notice Date: Sun, 09 Apr 2017 05:33:40 -0700 Message-ID: <1491737620.8.84095144jifeta@51succ.com> Subject: g-c-u.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 11:43:47 -0000 Hi, Domain Owner. Domain Availability Notice - g-c-u.com We would like to give you an opportunity to acquire g-c-u.com before it is offered to the general public. By surrounding yourself with all the variations of your name will assure you that you will not miss out on any new potential customers. Follow this link here to make a bid on domain http://51succ.com/84095144jifeta-QDI Some of the benefits you will receive by owning this domain: * Adds more links to your website * Increase profitability * Stops prospective clients from going to other sites Unsubscribe: http://51succ.com/u/84095144jifeta-QDI With respect, Backorder Team 71 Hilliard St Manchester, CT 06042-3001 'Leverage the sales that come from this wave. Ensure there is an upsell and something further that your early adopters can buy into. from The Secret Collaborative Economy: More Clients, More Exposure, More Profit, FASTER!' - Marsha Wright, TV Business Expert - Entrepreneur From owner-svn-src-all@freebsd.org Sun Apr 9 12:32:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAECDD2AFB9; Sun, 9 Apr 2017 12:32:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACC6A620; Sun, 9 Apr 2017 12:32:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39CWM5D033704; Sun, 9 Apr 2017 12:32:22 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39CWMDn033703; Sun, 9 Apr 2017 12:32:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704091232.v39CWMDn033703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 9 Apr 2017 12:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316655 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 12:32:24 -0000 Author: rmacklem Date: Sun Apr 9 12:32:22 2017 New Revision: 316655 URL: https://svnweb.freebsd.org/changeset/base/316655 Log: Fix parsing failure for NFSv4 Setattr operation for failed case. If an operation that preceeds a Setattr in an NFSv4 compound fails, there is no bitmap of attributes to parse. Without this patch, the parsing would fail and return EBADRPC instead of the correct failure error. This could break recovery from a server crash/reboot. Tested by: cperciva PR: 215883 MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sun Apr 9 11:16:16 2017 (r316654) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sun Apr 9 12:32:22 2017 (r316655) @@ -1190,7 +1190,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vat return (error); if (nd->nd_flag & (ND_NFSV3 | ND_NFSV4)) error = nfscl_wcc_data(nd, vp, rnap, attrflagp, NULL, stuff); - if ((nd->nd_flag & ND_NFSV4) && !error) + if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == ND_NFSV4 && !error) error = nfsrv_getattrbits(nd, &attrbits, NULL, NULL); if (!(nd->nd_flag & ND_NFSV3) && !nd->nd_repstat && !error) error = nfscl_postop_attr(nd, rnap, attrflagp, stuff); From owner-svn-src-all@freebsd.org Sun Apr 9 12:55:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82FEDD35595 for ; Sun, 9 Apr 2017 12:55:39 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14FBEEC4 for ; Sun, 9 Apr 2017 12:55:38 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f68.google.com with SMTP id 75so1006827lfs.3 for ; Sun, 09 Apr 2017 05:55:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=g0kPzCUkskRCJJ4ke2bpsEyJr6SWqsM1Hyks52MTSP0=; b=XC0GR/GV3pncKnCiPpvFPHtfL6qMcLJtPnQ4Zwcf3Fr58RQoH+HTb8zgi+R9mMR/nb hDlt4iLAzR9Bo1N0wJZMD9QzAJ+nwZdoSAQubdbHUbPFVeOhNinwll2ETtxoBfxahTzx AOGnaaFjkBRnhBqVX/bFZES2OZ5sXfQ8l/s2AevkHAKldHlOCoGd78jebplKB4RpI5hK Kyul6gQQPVE6ZZ0o/RcFHsjprEvOzi590lzAGBHppnWUN99WI//EEViw8W+dMfH2c9tO YlwtjKToLQt+8poKfv9c1ag+Yz/12kqd00lLbEopRKqqROOhvzKGCw8iVp6CN//A64Qf u/BQ== X-Gm-Message-State: AFeK/H1wMMggBDeY4STPGw24kjOsQBg7IDqWr11qeH/ZCf+ILqabnRMWYKSjYIGtLL4SuQ== X-Received: by 10.46.92.65 with SMTP id q62mr13648794ljb.48.1491742536546; Sun, 09 Apr 2017 05:55:36 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id q123sm2138961ljb.18.2017.04.09.05.55.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 05:55:36 -0700 (PDT) Subject: Re: svn commit: r316642 - head/sys/dev/syscons To: Bruce Evans References: <201704081000.v38A0dBU078784@repo.freebsd.org> <4a498d83-3b64-18ac-bb0f-890a0c2893fc@freebsd.org> <20170409150512.B1318@besplex.bde.org> <5d76f933-7d70-411f-9233-0f1e6b72023e@freebsd.org> <20170409195358.I2327@besplex.bde.org> Cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <579d9011-a042-4f69-892a-703042706bd3@freebsd.org> Date: Sun, 9 Apr 2017 15:55:31 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170409195358.I2327@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 12:55:39 -0000 On 09.04.2017 13:32, Bruce Evans wrote: > How do you initialize actual use of sc->cursor_char? It is only used > when SC_NO_FONT_LOADING is not defined. Configuring SC_PIXEL_MODE > forces SC_NO_FONT_LOADING to be undefined. Except to test sc->cursor_char, I use text console mode with loading national codepage font. I don't touch sc->cursor_char directly, I only use 'vidcontrol -M' to move range start to 0x03 since 0xd0-0xd3 and 0xd4 are valid characters in my codepage. Loading font and changing mousechar start are both through rc.conf variables: font8x14="cp866-8x14" font8x16="cp866b-8x16" font8x8="cp866-8x8" mousechar_start="3" > is almost always defined. Apparently the char cursor is turned off with > loadable fonts since it would mess up special fonts more than the default > font. But not as much as the mouse cursor. If you mean just cursor, I have it (even not block but underline cursor). It is not strictly char (i.e. text cursor), but emulation of it via loaded font change on the fly. Via rc.conf variable too: cursor="destructive" From owner-svn-src-all@freebsd.org Sun Apr 9 13:42:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D9DED35891; Sun, 9 Apr 2017 13:42:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4783D97B; Sun, 9 Apr 2017 13:42:17 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5582F1FE021; Sun, 9 Apr 2017 15:40:37 +0200 (CEST) Subject: Re: svn commit: r316033 - in head/sys/compat/linuxkpi/common: include/asm include/linux src To: Ed Maste References: <201703271704.v2RH4BBl084239@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <6358cefa-37b4-6e5a-43ad-1b283bb169f1@selasky.org> Date: Sun, 9 Apr 2017 15:40:15 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 13:42:18 -0000 On 04/08/17 20:08, Ed Maste wrote: > On 27 March 2017 at 13:04, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Mon Mar 27 17:04:11 2017 >> New Revision: 316033 >> URL: https://svnweb.freebsd.org/changeset/base/316033 > > powerpc.GENERIC is now failing with: > > In file included from > /scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/gfp.h:39, > from > /scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/slab.h:41, > from > /scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/sched.h:44, > from > /scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/kernel.h:49, > from > /scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/kobject.h:36, > from > /scratch/tmp/emaste/freebsd/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_compat.c:58: > /scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/page.h:43: > error: conflicting types for 'pte_t' > ./machine/pte.h:127: error: previous declaration of 'pte_t' was here > cc1: warnings being treated as errors > /scratch/tmp/emaste/freebsd/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_compat.c: > In function 'linux_cdev_pager_populate': > /scratch/tmp/emaste/freebsd/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_compat.c:414: > warning: cast to pointer from integer of different size > [-Wint-to-pointer-cast] > *** [linux_compat.o] Error code 1 > > I'm on it. Thank you for the notice. --HPS From owner-svn-src-all@freebsd.org Sun Apr 9 14:31:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1196D3642C; Sun, 9 Apr 2017 14:31:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A15DDE1; Sun, 9 Apr 2017 14:31:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39EVfoR078865; Sun, 9 Apr 2017 14:31:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39EVfLW078861; Sun, 9 Apr 2017 14:31:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201704091431.v39EVfLW078861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 9 Apr 2017 14:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316656 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 14:31:42 -0000 Author: hselasky Date: Sun Apr 9 14:31:41 2017 New Revision: 316656 URL: https://svnweb.freebsd.org/changeset/base/316656 Log: Fix compilation of LinuxKPI for PowerPC. Found by: emaste @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h head/sys/compat/linuxkpi/common/include/linux/page.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Sun Apr 9 12:32:22 2017 (r316655) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Sun Apr 9 14:31:41 2017 (r316656) @@ -91,7 +91,7 @@ CTASSERT((VM_PROT_ALL & -(1 << 8)) == 0) #define FAULT_FLAG_REMOTE (1 << 7) #define FAULT_FLAG_INSTRUCTION (1 << 8) -typedef int (*pte_fn_t)(pte_t *, pgtable_t, unsigned long addr, void *data); +typedef int (*pte_fn_t)(linux_pte_t *, pgtable_t, unsigned long addr, void *data); struct vm_area_struct { vm_offset_t vm_start; Modified: head/sys/compat/linuxkpi/common/include/linux/page.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/page.h Sun Apr 9 12:32:22 2017 (r316655) +++ head/sys/compat/linuxkpi/common/include/linux/page.h Sun Apr 9 14:31:41 2017 (r316656) @@ -40,9 +40,9 @@ #include #include -typedef unsigned long pte_t; -typedef unsigned long pmd_t; -typedef unsigned long pgd_t; +typedef unsigned long linux_pte_t; +typedef unsigned long linux_pmd_t; +typedef unsigned long linux_pgd_t; typedef unsigned long pgprot_t; #define page vm_page Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Apr 9 12:32:22 2017 (r316655) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Apr 9 14:31:41 2017 (r316656) @@ -411,7 +411,7 @@ linux_cdev_pager_populate(vm_object_t vm MPASS(vmap->vm_private_data == vm_obj->handle); /* fill out VM fault structure */ - vmf.virtual_address = (void *)(pidx << PAGE_SHIFT); + vmf.virtual_address = (void *)((uintptr_t)pidx << PAGE_SHIFT); vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; vmf.pgoff = 0; vmf.page = NULL; From owner-svn-src-all@freebsd.org Sun Apr 9 15:17:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AD55D3547F; Sun, 9 Apr 2017 15:17:56 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A498B57; Sun, 9 Apr 2017 15:17:56 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39FHt0L098721; Sun, 9 Apr 2017 15:17:55 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39FHtkY098720; Sun, 9 Apr 2017 15:17:55 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201704091517.v39FHtkY098720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sun, 9 Apr 2017 15:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316657 - head/sbin/setkey X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 15:17:56 -0000 Author: bcr (doc committer) Date: Sun Apr 9 15:17:55 2017 New Revision: 316657 URL: https://svnweb.freebsd.org/changeset/base/316657 Log: Make setkey(8) more clear about anti-replay window size option semantics. PR: 172913 Submitted by: john@saltant.com Reviewed by: ae@ MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10304 Modified: head/sbin/setkey/setkey.8 Modified: head/sbin/setkey/setkey.8 ============================================================================== --- head/sbin/setkey/setkey.8 Sun Apr 9 14:31:41 2017 (r316656) +++ head/sbin/setkey/setkey.8 Sun Apr 9 15:17:55 2017 (r316657) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 5, 2017 +.Dd April 9, 2017 .Dt SETKEY 8 .Os .\" @@ -290,12 +290,13 @@ The default value is .Li any . .\" .It Fl r Ar size -Specify window size of bytes for replay prevention. +Specify the bitmap size in octets of the anti-replay window. .Ar size -must be decimal number in 32-bit word. +is a 32-bit unsigned integer, and its value is one eighth of the +anti-replay window size in packets. If .Ar size -is zero or not specified, replay check does not take place. +is zero or not specified, an anti-replay check does not take place. .\" .It Fl u Ar id Specify the identifier of the policy entry in SPD. From owner-svn-src-all@freebsd.org Sun Apr 9 15:27:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DAAED35840; Sun, 9 Apr 2017 15:27:06 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C66E01CB; Sun, 9 Apr 2017 15:27:05 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39FR4k7002724; Sun, 9 Apr 2017 15:27:04 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39FR4O2002722; Sun, 9 Apr 2017 15:27:04 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201704091527.v39FR4O2002722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Sun, 9 Apr 2017 15:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316658 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 15:27:06 -0000 Author: avatar Date: Sun Apr 9 15:27:04 2017 New Revision: 316658 URL: https://svnweb.freebsd.org/changeset/base/316658 Log: Adding SIOCGIFNAME support in Linuxulator. This should silence the console warning associated with linux-opera: linux: pid 23492 (opera): ioctl fd=5, cmd=0x8910 ('\M^I',16) is not implemented linux: pid 23492 (opera): ioctl fd=28, cmd=0x8910 ('\M^I',16) is not implemented ... Reviewed by: kib, marcel, dchagin Tested with: linux-opera-12.16_3 MFC after: 1 month Modified: head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ioctl.h Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sun Apr 9 15:17:55 2017 (r316657) +++ head/sys/compat/linux/linux_ioctl.c Sun Apr 9 15:27:04 2017 (r316658) @@ -2167,6 +2167,49 @@ ifname_linux_to_bsd(struct thread *td, c } /* + * Implement the SIOCGIFNAME ioctl + */ + +static int +linux_ioctl_ifname(struct thread *td, struct l_ifreq *uifr) +{ + struct l_ifreq ifr; + struct ifnet *ifp; + int error, ethno, index; + + error = copyin(uifr, &ifr, sizeof(ifr)); + if (error != 0) + return (error); + + CURVNET_SET(TD_TO_VNET(curthread)); + IFNET_RLOCK(); + index = 1; /* ifr.ifr_ifindex starts from 1 */ + ethno = 0; + error = ENODEV; + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { + if (ifr.ifr_ifindex == index) { + if (IFP_IS_ETH(ifp)) + snprintf(ifr.ifr_name, LINUX_IFNAMSIZ, + "eth%d", ethno); + else + strlcpy(ifr.ifr_name, ifp->if_xname, + LINUX_IFNAMSIZ); + error = 0; + break; + } + if (IFP_IS_ETH(ifp)) + ethno++; + index++; + } + IFNET_RUNLOCK(); + if (error == 0) + error = copyout(&ifr, uifr, sizeof(ifr)); + CURVNET_RESTORE(); + + return (error); +} + +/* * Implement the SIOCGIFCONF ioctl */ @@ -2393,6 +2436,7 @@ linux_ioctl_socket(struct thread *td, st case LINUX_SIOCADDMULTI: case LINUX_SIOCATMARK: case LINUX_SIOCDELMULTI: + case LINUX_SIOCGIFNAME: case LINUX_SIOCGIFCONF: case LINUX_SIOCGPGRP: case LINUX_SIOCSPGRP: @@ -2478,6 +2522,10 @@ linux_ioctl_socket(struct thread *td, st /* LINUX_SIOCGSTAMP */ + case LINUX_SIOCGIFNAME: + error = linux_ioctl_ifname(td, (struct l_ifreq *)args->arg); + break; + case LINUX_SIOCGIFCONF: error = linux_ifconf(td, (struct ifconf *)args->arg); break; Modified: head/sys/compat/linux/linux_ioctl.h ============================================================================== --- head/sys/compat/linux/linux_ioctl.h Sun Apr 9 15:17:55 2017 (r316657) +++ head/sys/compat/linux/linux_ioctl.h Sun Apr 9 15:27:04 2017 (r316658) @@ -226,6 +226,7 @@ #define LINUX_SIOCGPGRP 0x8904 #define LINUX_SIOCATMARK 0x8905 #define LINUX_SIOCGSTAMP 0x8906 +#define LINUX_SIOCGIFNAME 0x8910 #define LINUX_SIOCGIFCONF 0x8912 #define LINUX_SIOCGIFFLAGS 0x8913 #define LINUX_SIOCGIFADDR 0x8915 From owner-svn-src-all@freebsd.org Sun Apr 9 16:01:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2AB8D3680A; Sun, 9 Apr 2017 16:01:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C463B9D0; Sun, 9 Apr 2017 16:01:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id E09E57F65; Sun, 9 Apr 2017 16:00:59 +0000 (UTC) Date: Sun, 9 Apr 2017 16:00:59 +0000 From: Alexey Dokuchaev To: Cy Schubert Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313495 - head/sys/kern Message-ID: <20170409160059.GA75974@FreeBSD.org> References: <201702092335.v19NZvSQ026869@repo.freebsd.org> <201702100521.v1A5LgfJ003611@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702100521.v1A5LgfJ003611@slippy.cwsent.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 16:01:01 -0000 On Thu, Feb 09, 2017 at 09:21:42PM -0800, Cy Schubert wrote: > In message <201702092335.v19NZvSQ026869@repo.freebsd.org>, Konstantin > Belousov writes: > > New Revision: 313495 > > URL: https://svnweb.freebsd.org/changeset/base/313495 > > > > Log: > > ... > > Restructure the block in vn_open_vnode() which handles O_EXLOCK and > > O_SHLOCK open flags to make it easier to quit its execution earlier > > with an error. > > This broke dhclient. I've attached typescript output at the end of this > email. > > > @@ -376,20 +384,20 @@ vn_open_vnode(struct vnode *vp, int fmod > > * Ensure the vnode is still able to be opened for > > * writing after the lock has been obtained. > > */ > > - if (error == 0 && accmode & VWRITE) > > + if ((accmode & VWRITE) != 0) > > error = vn_writechk(vp); > > + break; > > + } Could it be related to this hunk? It unconditionally breaks out of the loop now (missing { } in that `if')? PVS-Studio trips at here: /usr/src/sys/kern/vfs_vnops.c:389:1: warning: V612 An unconditional 'break' within a loop. ./danfe From owner-svn-src-all@freebsd.org Sun Apr 9 18:31:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 072A4D36050; Sun, 9 Apr 2017 18:31:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD8941EA; Sun, 9 Apr 2017 18:31:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39IVXPE079244; Sun, 9 Apr 2017 18:31:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39IVX2D079243; Sun, 9 Apr 2017 18:31:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704091831.v39IVX2D079243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 9 Apr 2017 18:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316659 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 18:31:35 -0000 Author: ian Date: Sun Apr 9 18:31:33 2017 New Revision: 316659 URL: https://svnweb.freebsd.org/changeset/base/316659 Log: Remove some old interrupt handling workaround code from the pre-INTRNG days. At this point, INTRNG is not going away (the option may go away, but the code is not), so we no longer need code to support workarounds that handled the lack of INTRNG functionality. Modified: head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Sun Apr 9 15:27:04 2017 (r316658) +++ head/sys/arm/freescale/imx/imx6_machdep.c Sun Apr 9 18:31:33 2017 (r316659) @@ -54,49 +54,11 @@ __FBSDID("$FreeBSD$"); #include "platform_if.h" -static uint32_t gpio1_node; - static platform_attach_t imx6_attach; static platform_devmap_init_t imx6_devmap_init; static platform_late_init_t imx6_late_init; static platform_cpu_reset_t imx6_cpu_reset; -#ifndef INTRNG -/* - * Work around the linux workaround for imx6 erratum 006687, in which some - * ethernet interrupts don't go to the GPC and thus won't wake the system from - * Wait mode. We don't use Wait mode (which halts the GIC, leaving only GPC - * interrupts able to wake the system), so we don't experience the bug at all. - * The linux workaround is to reconfigure GPIO1_6 as the ENET interrupt by - * writing magic values to an undocumented IOMUX register, then letting the gpio - * interrupt driver notify the ethernet driver. We'll be able to do all that - * (even though we don't need to) once the INTRNG project is committed and the - * imx_gpio driver becomes an interrupt driver. Until then, this crazy little - * workaround watches for requests to map an interrupt 6 with the interrupt - * controller node referring to gpio1, and it substitutes the proper ffec - * interrupt number. - */ -static int -imx6_decode_fdt(uint32_t iparent, uint32_t *intr, int *interrupt, - int *trig, int *pol) -{ - - if (fdt32_to_cpu(intr[0]) == 6 && - OF_node_from_xref(iparent) == gpio1_node) { - *interrupt = 150; - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - return (0); - } - return (gic_decode_fdt(iparent, intr, interrupt, trig, pol)); -} - -fdt_pic_decode_t fdt_pic_table[] = { - &imx6_decode_fdt, - NULL -}; -#endif - /* * Fix FDT data related to interrupts. * @@ -184,10 +146,6 @@ imx6_late_init(platform_t plat) const uint32_t IMX6_WDOG_SR_PHYS = 0x020bc004; imx_wdog_init_last_reset(IMX6_WDOG_SR_PHYS); - - /* Cache the gpio1 node handle for imx6_decode_fdt() workaround code. */ - gpio1_node = OF_node_from_xref( - OF_finddevice("/soc/aips-bus@02000000/gpio@0209c000")); } /* From owner-svn-src-all@freebsd.org Sun Apr 9 19:30:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E149D36078; Sun, 9 Apr 2017 19:30:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF0A9EB9; Sun, 9 Apr 2017 19:30:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39JUoaN002770; Sun, 9 Apr 2017 19:30:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39JUosg002035; Sun, 9 Apr 2017 19:30:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704091930.v39JUosg002035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 9 Apr 2017 19:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316660 - in stable/11: share/man/man4 sys/conf sys/dev/usb/storage sys/modules/usb sys/modules/usb/cfumass X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 19:30:52 -0000 Author: trasz Date: Sun Apr 9 19:30:49 2017 New Revision: 316660 URL: https://svnweb.freebsd.org/changeset/base/316660 Log: MFC r313959: Add USB Mass Storage CTL frontend. This makes it possible for USB OTG-capable hardware to implement device side of USB Mass Storage, ie pretend it's a flash drive. It's configured in the same way as other CTL frontends, using ctladm(8) or ctld(8). Differently from usfs(4), all the configuration can be done without rebuilding the kernel. Testing and review is welcome. Right now I'm still moving, and I don't have access to my test environment, so I'm somewhat reluctant to making larger changes to this code; on the other hand I don't want to let it sit on Phab until my testing setup is back, because I want to get it into 11.1-RELEASE. Relnotes: yes Sponsored by: The FreeBSD Foundation Added: stable/11/share/man/man4/cfumass.4 - copied unchanged from r313959, head/share/man/man4/cfumass.4 stable/11/sys/dev/usb/storage/cfumass.c - copied unchanged from r313959, head/sys/dev/usb/storage/cfumass.c stable/11/sys/modules/usb/cfumass/ - copied from r313959, head/sys/modules/usb/cfumass/ Modified: stable/11/share/man/man4/Makefile stable/11/share/man/man4/ctl.4 stable/11/share/man/man4/umass.4 stable/11/share/man/man4/usb_template.4 stable/11/share/man/man4/usfs.4 stable/11/sys/conf/files stable/11/sys/modules/usb/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Sun Apr 9 18:31:33 2017 (r316659) +++ stable/11/share/man/man4/Makefile Sun Apr 9 19:30:49 2017 (r316660) @@ -102,6 +102,7 @@ MAN= aac.4 \ cd.4 \ cdce.4 \ cfi.4 \ + cfumass.4 \ ch.4 \ chromebook_platform.4 \ ciss.4 \ Copied: stable/11/share/man/man4/cfumass.4 (from r313959, head/share/man/man4/cfumass.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/cfumass.4 Sun Apr 9 19:30:49 2017 (r316660, copy of r313959, head/share/man/man4/cfumass.4) @@ -0,0 +1,137 @@ +.\" Copyright (c) 2017 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This software was developed by Edward Tomasz Napierala under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" 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 January 27, 2017 +.Dt CFUMASS 4 +.Os +.Sh NAME +.Nm cfumass +.Nd USB device side support for Mass Storage Class Transport +.Sh SYNOPSIS +This driver can be compiled into the kernel by placing these lines in +the kernel configuration file: +.Bd -ragged -offset indent +.Cd "device usb" +.Cd "device usb_template" +.Cd "device iscsi" +.Cd "device ctl" +.Cd "device cfumass" +.Ed +.Pp +The driver module can also be loaded at boot by adding this line to +.Xr loader.conf 5 : +.Bd -literal -offset indent +cfumass_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides device side support for emulating an USB mass storage +device compliant with the USB Mass Storage Class Bulk-Only (BBB) Transport +specification, implemented as a +.Xr ctl 4 +frontend driver. +.Pp +To use +.Nm : +.Bl -bullet +.It +.Xr cfumass 4 +must be loaded as a module or compiled into the kernel. +.It +The USB Mass Storage template must be chosen by setting the +.Va hw.usb.template +sysctl to 0. +.It +The USB OTG port must be working in USB device-side mode. +This happens automatically upon connection to a USB host. +.It +There must be a +.Xr ctl +LUN configured for the +.Pa cfumass +port. +.El +.Pp +Upon loading, the driver creates a +.Xr ctl 4 +port named +.Pa cfumass , +presenting the first LUN mapped for that port - usually LUN 0 - to +the USB host. +See +.Xr ctl.conf 5 +and +.Xr ctld 8 +for details on configuring the LUN. +.Sh SYSCTL VARIABLES +These variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va hw.usb.cfumass.debug +Verbosity level for log messages from the +.Nm +driver. +Set to 0 to disable logging or 1 to warn about potential problems. +Larger values enable debugging output. +Defaults to 1. +.It Va hw.usb.cfumass.ignore_stop +Ignore START STOP UNIT SCSI commands with START and LOEJ bits cleared. +Some initiators send that command to stop the target when the user +attempts to gracefully eject the drive, but fail to start it when the +drive is reconnected. +Set to 0 to handle the command in a standards-compliant way, +1 to ignore it and log a warning, or 2 to ignore it silently. +Defaults to 1. +.It Va hw.usb.cfumass.max_lun +Max LUN number to report to the initiator (USB host). +Must be between 0 and 15. +Some initiators incorrectly handle values larger than 0. +Defaults to 0. +.El +.Sh SEE ALSO +.Xr ctl 4 , +.Xr umass 4 , +.Xr usb 4 , +.Xr usb_template 4 , +.Xr ctl.conf 5 , +.Xr ctld 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.1 . +.Sh AUTHORS +The +.Nm +driver was developed by +.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org +under sponsorship from the FreeBSD Foundation. Modified: stable/11/share/man/man4/ctl.4 ============================================================================== --- stable/11/share/man/man4/ctl.4 Sun Apr 9 18:31:33 2017 (r316659) +++ stable/11/share/man/man4/ctl.4 Sun Apr 9 19:30:49 2017 (r316660) @@ -212,6 +212,7 @@ Set to 0 to disable sending NOP-In PDUs. Defaults to 5. .El .Sh SEE ALSO +.Xr cfumass 4 , .Xr ctladm 8 , .Xr ctld 8 , .Xr ctlstat 8 Modified: stable/11/share/man/man4/umass.4 ============================================================================== --- stable/11/share/man/man4/umass.4 Sun Apr 9 18:31:33 2017 (r316659) +++ stable/11/share/man/man4/umass.4 Sun Apr 9 19:30:49 2017 (r316660) @@ -239,6 +239,7 @@ type as when using .Xr mount 8 . .Sh SEE ALSO +.Xr cfumass 4 , .Xr ehci 4 , .Xr ohci 4 , .Xr uhci 4 , Modified: stable/11/share/man/man4/usb_template.4 ============================================================================== --- stable/11/share/man/man4/usb_template.4 Sun Apr 9 18:31:33 2017 (r316659) +++ stable/11/share/man/man4/usb_template.4 Sun Apr 9 19:30:49 2017 (r316660) @@ -84,6 +84,7 @@ Available templates are: .El . .Sh SEE ALSO +.Xr cfumass 4 , .Xr usb 4 , .Xr usfs 4 .Sh STANDARDS Modified: stable/11/share/man/man4/usfs.4 ============================================================================== --- stable/11/share/man/man4/usfs.4 Sun Apr 9 18:31:33 2017 (r316659) +++ stable/11/share/man/man4/usfs.4 Sun Apr 9 19:30:49 2017 (r316660) @@ -58,6 +58,7 @@ sysctl is set to 0). .Pp Upon attach the driver creates a RAM disk which can be read and written. .Sh SEE ALSO +.Xr cfumass 4 , .Xr umass 4 , .Xr usb 4 , .Xr usb_template 4 Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Sun Apr 9 18:31:33 2017 (r316659) +++ stable/11/sys/conf/files Sun Apr 9 19:30:49 2017 (r316660) @@ -2772,6 +2772,7 @@ dev/usb/controller/usb_controller.c opti # # USB storage drivers # +dev/usb/storage/cfumass.c optional cfumass ctl dev/usb/storage/umass.c optional umass dev/usb/storage/urio.c optional urio dev/usb/storage/ustorage_fs.c optional usfs Copied: stable/11/sys/dev/usb/storage/cfumass.c (from r313959, head/sys/dev/usb/storage/cfumass.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/usb/storage/cfumass.c Sun Apr 9 19:30:49 2017 (r316660, copy of r313959, head/sys/dev/usb/storage/cfumass.c) @@ -0,0 +1,1075 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Edward Tomasz Napierala under sponsorship + * from the FreeBSD Foundation. + * + * 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. + * + */ +/* + * USB Mass Storage Class Bulk-Only (BBB) Transport target. + * + * http://www.usb.org/developers/docs/devclass_docs/usbmassbulk_10.pdf + * + * This code implements the USB Mass Storage frontend driver for the CAM + * Target Layer (ctl(4)) subsystem. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "usbdevs.h" +#include "usb_if.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +SYSCTL_NODE(_hw_usb, OID_AUTO, cfumass, CTLFLAG_RW, 0, + "CAM Target Layer USB Mass Storage Frontend"); +static int debug = 1; +SYSCTL_INT(_hw_usb_cfumass, OID_AUTO, debug, CTLFLAG_RWTUN, + &debug, 1, "Enable debug messages"); +static int max_lun = 0; +SYSCTL_INT(_hw_usb_cfumass, OID_AUTO, max_lun, CTLFLAG_RWTUN, + &max_lun, 1, "Maximum advertised LUN number"); +static int ignore_stop = 1; +SYSCTL_INT(_hw_usb_cfumass, OID_AUTO, ignore_stop, CTLFLAG_RWTUN, + &ignore_stop, 1, "Ignore START STOP UNIT with START and LOEJ bits cleared"); + +/* + * The driver uses a single, global CTL port. It could create its ports + * in cfumass_attach() instead, but that would make it impossible to specify + * "port cfumass0" in ctl.conf(5), as the port generally wouldn't exist + * at the time ctld(8) gets run. + */ +struct ctl_port cfumass_port; +bool cfumass_port_online; +volatile u_int cfumass_refcount; + +#ifndef CFUMASS_BULK_SIZE +#define CFUMASS_BULK_SIZE (1U << 17) /* bytes */ +#endif + +/* + * USB transfer definitions. + */ +#define CFUMASS_T_COMMAND 0 +#define CFUMASS_T_DATA_OUT 1 +#define CFUMASS_T_DATA_IN 2 +#define CFUMASS_T_STATUS 3 +#define CFUMASS_T_MAX 4 + +/* + * USB interface specific control requests. + */ +#define UR_RESET 0xff /* Bulk-Only Mass Storage Reset */ +#define UR_GET_MAX_LUN 0xfe /* Get Max LUN */ + +/* + * Command Block Wrapper. + */ +struct cfumass_cbw_t { + uDWord dCBWSignature; +#define CBWSIGNATURE 0x43425355 /* "USBC" */ + uDWord dCBWTag; + uDWord dCBWDataTransferLength; + uByte bCBWFlags; +#define CBWFLAGS_OUT 0x00 +#define CBWFLAGS_IN 0x80 + uByte bCBWLUN; + uByte bCDBLength; +#define CBWCBLENGTH 16 + uByte CBWCB[CBWCBLENGTH]; +} __packed; + +#define CFUMASS_CBW_SIZE 31 +CTASSERT(sizeof(struct cfumass_cbw_t) == CFUMASS_CBW_SIZE); + +/* + * Command Status Wrapper. + */ +struct cfumass_csw_t { + uDWord dCSWSignature; +#define CSWSIGNATURE 0x53425355 /* "USBS" */ + uDWord dCSWTag; + uDWord dCSWDataResidue; + uByte bCSWStatus; +#define CSWSTATUS_GOOD 0x0 +#define CSWSTATUS_FAILED 0x1 +#define CSWSTATUS_PHASE 0x2 +} __packed; + +#define CFUMASS_CSW_SIZE 13 +CTASSERT(sizeof(struct cfumass_csw_t) == CFUMASS_CSW_SIZE); + +struct cfumass_softc { + device_t sc_dev; + struct usb_device *sc_udev; + struct usb_xfer *sc_xfer[CFUMASS_T_MAX]; + + struct cfumass_cbw_t *sc_cbw; + struct cfumass_csw_t *sc_csw; + + struct mtx sc_mtx; + int sc_online; + int sc_ctl_initid; + + /* + * This is used to communicate between CTL callbacks + * and USB callbacks; basically, it holds the state + * for the current command ("the" command, since there + * is no queueing in USB Mass Storage). + */ + bool sc_current_stalled; + + /* + * The following are set upon receiving a SCSI command. + */ + int sc_current_tag; + int sc_current_transfer_length; + int sc_current_flags; + + /* + * The following are set in ctl_datamove(). + */ + int sc_current_residue; + union ctl_io *sc_ctl_io; + + /* + * The following is set in cfumass_done(). + */ + int sc_current_status; + + /* + * Number of requests queued to CTL. + */ + volatile u_int sc_queued; +}; + +/* + * USB interface. + */ +static device_probe_t cfumass_probe; +static device_attach_t cfumass_attach; +static device_detach_t cfumass_detach; +static device_suspend_t cfumass_suspend; +static device_resume_t cfumass_resume; +static usb_handle_request_t cfumass_handle_request; + +static usb_callback_t cfumass_t_command_callback; +static usb_callback_t cfumass_t_data_out_callback; +static usb_callback_t cfumass_t_data_in_callback; +static usb_callback_t cfumass_t_status_callback; + +static device_method_t cfumass_methods[] = { + + /* USB interface. */ + DEVMETHOD(usb_handle_request, cfumass_handle_request), + + /* Device interface. */ + DEVMETHOD(device_probe, cfumass_probe), + DEVMETHOD(device_attach, cfumass_attach), + DEVMETHOD(device_detach, cfumass_detach), + DEVMETHOD(device_suspend, cfumass_suspend), + DEVMETHOD(device_resume, cfumass_resume), + + DEVMETHOD_END +}; + +static driver_t cfumass_driver = { + .name = "cfumass", + .methods = cfumass_methods, + .size = sizeof(struct cfumass_softc), +}; + +static devclass_t cfumass_devclass; + +DRIVER_MODULE(cfumass, uhub, cfumass_driver, cfumass_devclass, NULL, 0); +MODULE_VERSION(cfumass, 0); +MODULE_DEPEND(cfumass, usb, 1, 1, 1); +MODULE_DEPEND(cfumass, usb_template, 1, 1, 1); + +static struct usb_config cfumass_config[CFUMASS_T_MAX] = { + + [CFUMASS_T_COMMAND] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = sizeof(struct cfumass_cbw_t), + .callback = &cfumass_t_command_callback, + .usb_mode = USB_MODE_DEVICE, + }, + + [CFUMASS_T_DATA_OUT] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = CFUMASS_BULK_SIZE, + .flags = {.proxy_buffer = 1, .short_xfer_ok = 1, + .ext_buffer = 1}, + .callback = &cfumass_t_data_out_callback, + .usb_mode = USB_MODE_DEVICE, + }, + + [CFUMASS_T_DATA_IN] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = CFUMASS_BULK_SIZE, + .flags = {.proxy_buffer = 1, .short_xfer_ok = 1, + .ext_buffer = 1}, + .callback = &cfumass_t_data_in_callback, + .usb_mode = USB_MODE_DEVICE, + }, + + [CFUMASS_T_STATUS] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = sizeof(struct cfumass_csw_t), + .flags = {.short_xfer_ok = 1}, + .callback = &cfumass_t_status_callback, + .usb_mode = USB_MODE_DEVICE, + }, +}; + +/* + * CTL frontend interface. + */ +static int cfumass_init(void); +static int cfumass_shutdown(void); +static void cfumass_online(void *arg); +static void cfumass_offline(void *arg); +static void cfumass_datamove(union ctl_io *io); +static void cfumass_done(union ctl_io *io); + +static struct ctl_frontend cfumass_frontend = { + .name = "umass", + .init = cfumass_init, + .shutdown = cfumass_shutdown, +}; +CTL_FRONTEND_DECLARE(ctlcfumass, cfumass_frontend); + +#define CFUMASS_DEBUG(S, X, ...) \ + do { \ + if (debug > 1) { \ + device_printf(S->sc_dev, "%s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ + } while (0) + +#define CFUMASS_WARN(S, X, ...) \ + do { \ + if (debug > 0) { \ + device_printf(S->sc_dev, "WARNING: %s: " X "\n",\ + __func__, ## __VA_ARGS__); \ + } \ + } while (0) + +#define CFUMASS_LOCK(X) mtx_lock(&X->sc_mtx) +#define CFUMASS_UNLOCK(X) mtx_unlock(&X->sc_mtx) + +static void cfumass_transfer_start(struct cfumass_softc *sc, + uint8_t xfer_index); +static void cfumass_terminate(struct cfumass_softc *sc); + +static int +cfumass_probe(device_t dev) +{ + struct usb_attach_arg *uaa; + struct usb_interface_descriptor *id; + + uaa = device_get_ivars(dev); + + if (uaa->usb_mode != USB_MODE_DEVICE) + return (ENXIO); + + /* + * Check for a compliant device. + */ + id = usbd_get_interface_descriptor(uaa->iface); + if ((id == NULL) || + (id->bInterfaceClass != UICLASS_MASS) || + (id->bInterfaceSubClass != UISUBCLASS_SCSI) || + (id->bInterfaceProtocol != UIPROTO_MASS_BBB)) { + return (ENXIO); + } + + return (BUS_PROBE_GENERIC); +} + +static int +cfumass_attach(device_t dev) +{ + struct cfumass_softc *sc; + struct usb_attach_arg *uaa; + int error; + + sc = device_get_softc(dev); + uaa = device_get_ivars(dev); + + sc->sc_dev = dev; + sc->sc_udev = uaa->device; + + CFUMASS_DEBUG(sc, "go"); + + usbd_set_power_mode(uaa->device, USB_POWER_MODE_SAVE); + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, "cfumass", NULL, MTX_DEF); + refcount_acquire(&cfumass_refcount); + + error = usbd_transfer_setup(uaa->device, + &uaa->info.bIfaceIndex, sc->sc_xfer, cfumass_config, + CFUMASS_T_MAX, sc, &sc->sc_mtx); + if (error != 0) { + CFUMASS_WARN(sc, "usbd_transfer_setup() failed: %s", + usbd_errstr(error)); + refcount_release(&cfumass_refcount); + return (ENXIO); + } + + sc->sc_cbw = + usbd_xfer_get_frame_buffer(sc->sc_xfer[CFUMASS_T_COMMAND], 0); + sc->sc_csw = + usbd_xfer_get_frame_buffer(sc->sc_xfer[CFUMASS_T_STATUS], 0); + + sc->sc_ctl_initid = ctl_add_initiator(&cfumass_port, -1, 0, NULL); + if (sc->sc_ctl_initid < 0) { + CFUMASS_WARN(sc, "ctl_add_initiator() failed with error %d", + sc->sc_ctl_initid); + usbd_transfer_unsetup(sc->sc_xfer, CFUMASS_T_MAX); + refcount_release(&cfumass_refcount); + return (ENXIO); + } + + refcount_init(&sc->sc_queued, 0); + + CFUMASS_LOCK(sc); + cfumass_transfer_start(sc, CFUMASS_T_COMMAND); + CFUMASS_UNLOCK(sc); + + return (0); +} + +static int +cfumass_detach(device_t dev) +{ + struct cfumass_softc *sc; + int error; + + sc = device_get_softc(dev); + + CFUMASS_DEBUG(sc, "go"); + + CFUMASS_LOCK(sc); + cfumass_terminate(sc); + CFUMASS_UNLOCK(sc); + usbd_transfer_unsetup(sc->sc_xfer, CFUMASS_T_MAX); + + if (sc->sc_ctl_initid != -1) { + error = ctl_remove_initiator(&cfumass_port, sc->sc_ctl_initid); + if (error != 0) { + CFUMASS_WARN(sc, "ctl_remove_initiator() failed " + "with error %d", error); + } + sc->sc_ctl_initid = -1; + } + + mtx_destroy(&sc->sc_mtx); + refcount_release(&cfumass_refcount); + + return (0); +} + +static int +cfumass_suspend(device_t dev) +{ + struct cfumass_softc *sc; + + sc = device_get_softc(dev); + CFUMASS_DEBUG(sc, "go"); + + return (0); +} + +static int +cfumass_resume(device_t dev) +{ + struct cfumass_softc *sc; + + sc = device_get_softc(dev); + CFUMASS_DEBUG(sc, "go"); + + return (0); +} + +static void +cfumass_transfer_start(struct cfumass_softc *sc, uint8_t xfer_index) +{ + + usbd_transfer_start(sc->sc_xfer[xfer_index]); +} + +static void +cfumass_transfer_stop_and_drain(struct cfumass_softc *sc, uint8_t xfer_index) +{ + + usbd_transfer_stop(sc->sc_xfer[xfer_index]); + CFUMASS_UNLOCK(sc); + usbd_transfer_drain(sc->sc_xfer[xfer_index]); + CFUMASS_LOCK(sc); +} + +static void +cfumass_terminate(struct cfumass_softc *sc) +{ + int last; + + for (;;) { + cfumass_transfer_stop_and_drain(sc, CFUMASS_T_COMMAND); + cfumass_transfer_stop_and_drain(sc, CFUMASS_T_DATA_IN); + cfumass_transfer_stop_and_drain(sc, CFUMASS_T_DATA_OUT); + + if (sc->sc_ctl_io != NULL) { + CFUMASS_DEBUG(sc, "terminating CTL transfer"); + ctl_set_data_phase_error(&sc->sc_ctl_io->scsiio); + sc->sc_ctl_io->scsiio.be_move_done(sc->sc_ctl_io); + sc->sc_ctl_io = NULL; + } + + cfumass_transfer_stop_and_drain(sc, CFUMASS_T_STATUS); + + refcount_acquire(&sc->sc_queued); + last = refcount_release(&sc->sc_queued); + if (last != 0) + break; + + CFUMASS_DEBUG(sc, "%d CTL tasks pending", sc->sc_queued); + msleep(__DEVOLATILE(void *, &sc->sc_queued), &sc->sc_mtx, + 0, "cfumass_reset", hz / 100); + } +} + +static int +cfumass_handle_request(device_t dev, + const void *preq, void **pptr, uint16_t *plen, + uint16_t offset, uint8_t *pstate) +{ + static uint8_t max_lun_tmp; + struct cfumass_softc *sc; + const struct usb_device_request *req; + uint8_t is_complete; + + sc = device_get_softc(dev); + req = preq; + is_complete = *pstate; + + CFUMASS_DEBUG(sc, "go"); + + if (is_complete) + return (ENXIO); + + if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == UR_RESET)) { + CFUMASS_WARN(sc, "received Bulk-Only Mass Storage Reset"); + *plen = 0; + + CFUMASS_LOCK(sc); + cfumass_terminate(sc); + cfumass_transfer_start(sc, CFUMASS_T_COMMAND); + CFUMASS_UNLOCK(sc); + + CFUMASS_DEBUG(sc, "Bulk-Only Mass Storage Reset done"); + return (0); + } + + if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == UR_GET_MAX_LUN)) { + CFUMASS_DEBUG(sc, "received Get Max LUN"); + if (offset == 0) { + *plen = 1; + /* + * The protocol doesn't support LUN numbers higher + * than 15. Also, some initiators (namely Windows XP + * SP3 Version 2002) can't properly query the number + * of LUNs, resulting in inaccessible "fake" ones - thus + * the default limit of one LUN. + */ + if (max_lun < 0 || max_lun > 15) { + CFUMASS_WARN(sc, + "invalid hw.usb.cfumass.max_lun, must be " + "between 0 and 15; defaulting to 0"); + max_lun_tmp = 0; + } else { + max_lun_tmp = max_lun; + } + *pptr = &max_lun_tmp; + } else { + *plen = 0; + } + return (0); + } + + return (ENXIO); +} + +static int +cfumass_quirk(struct cfumass_softc *sc, unsigned char *cdb, int cdb_len) +{ + struct scsi_start_stop_unit *sssu; + + switch (cdb[0]) { + case START_STOP_UNIT: + /* + * Some initiators - eg OSX, Darwin Kernel Version 15.6.0, + * root:xnu-3248.60.11~2/RELEASE_X86_64 - attempt to stop + * the unit on eject, but fail to start it when it's plugged + * back. Just ignore the command. + */ + + if (cdb_len < sizeof(*sssu)) { + CFUMASS_DEBUG(sc, "received START STOP UNIT with " + "bCDBLength %d, should be %zd", + cdb_len, sizeof(*sssu)); + break; + } + + sssu = (struct scsi_start_stop_unit *)cdb; + if ((sssu->how & SSS_PC_MASK) != 0) + break; + + if ((sssu->how & SSS_START) != 0) + break; + + if ((sssu->how & SSS_LOEJ) != 0) + break; + + if (ignore_stop == 0) { + break; + } else if (ignore_stop == 1) { + CFUMASS_WARN(sc, "ignoring START STOP UNIT request"); + } else { + CFUMASS_DEBUG(sc, "ignoring START STOP UNIT request"); + } + + sc->sc_current_status = 0; + cfumass_transfer_start(sc, CFUMASS_T_STATUS); + + return (1); + default: + break; + } + + return (0); +} + +static void +cfumass_t_command_callback(struct usb_xfer *xfer, usb_error_t usb_error) +{ + struct cfumass_softc *sc; + uint32_t signature; + union ctl_io *io; + int error = 0; + + sc = usbd_xfer_softc(xfer); + + KASSERT(sc->sc_ctl_io == NULL, + ("sc_ctl_io is %p, should be NULL", sc->sc_ctl_io)); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + CFUMASS_DEBUG(sc, "USB_ST_TRANSFERRED"); + + signature = UGETDW(sc->sc_cbw->dCBWSignature); + if (signature != CBWSIGNATURE) { + CFUMASS_WARN(sc, "wrong dCBWSignature 0x%08x, " + "should be 0x%08x", signature, CBWSIGNATURE); + break; + } + + if (sc->sc_cbw->bCDBLength <= 0 || + sc->sc_cbw->bCDBLength > sizeof(sc->sc_cbw->CBWCB)) { + CFUMASS_WARN(sc, "invalid bCDBLength %d, should be <= %zd", + sc->sc_cbw->bCDBLength, sizeof(sc->sc_cbw->CBWCB)); + break; + } + + sc->sc_current_stalled = false; + sc->sc_current_status = 0; + sc->sc_current_tag = UGETDW(sc->sc_cbw->dCBWTag); + sc->sc_current_transfer_length = + UGETDW(sc->sc_cbw->dCBWDataTransferLength); + sc->sc_current_flags = sc->sc_cbw->bCBWFlags; + + /* + * Make sure to report proper residue if the datamove wasn't + * required, or wasn't called due to SCSI error. + */ + sc->sc_current_residue = sc->sc_current_transfer_length; + + if (cfumass_quirk(sc, + sc->sc_cbw->CBWCB, sc->sc_cbw->bCDBLength) != 0) + break; + + if (!cfumass_port_online) { + CFUMASS_DEBUG(sc, "cfumass port is offline; stalling"); + usbd_xfer_set_stall(xfer); + break; + } + + /* + * Those CTL functions cannot be called with mutex held. + */ + CFUMASS_UNLOCK(sc); + io = ctl_alloc_io(cfumass_port.ctl_pool_ref); + ctl_zero_io(io); + io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = sc; + io->io_hdr.io_type = CTL_IO_SCSI; + io->io_hdr.nexus.initid = sc->sc_ctl_initid; + io->io_hdr.nexus.targ_port = cfumass_port.targ_port; + io->io_hdr.nexus.targ_lun = ctl_decode_lun(sc->sc_cbw->bCBWLUN); + io->scsiio.tag_num = UGETDW(sc->sc_cbw->dCBWTag); + io->scsiio.tag_type = CTL_TAG_UNTAGGED; + io->scsiio.cdb_len = sc->sc_cbw->bCDBLength; + memcpy(io->scsiio.cdb, sc->sc_cbw->CBWCB, sc->sc_cbw->bCDBLength); + refcount_acquire(&sc->sc_queued); + error = ctl_queue(io); + if (error != CTL_RETVAL_COMPLETE) { + CFUMASS_WARN(sc, + "ctl_queue() failed; error %d; stalling", error); + ctl_free_io(io); + refcount_release(&sc->sc_queued); + CFUMASS_LOCK(sc); + usbd_xfer_set_stall(xfer); + break; + } + + CFUMASS_LOCK(sc); + break; + + case USB_ST_SETUP: +tr_setup: + CFUMASS_DEBUG(sc, "USB_ST_SETUP"); + + usbd_xfer_set_frame_len(xfer, 0, sizeof(*sc->sc_cbw)); + usbd_transfer_submit(xfer); + break; + + default: + if (usb_error == USB_ERR_CANCELLED) { + CFUMASS_DEBUG(sc, "USB_ERR_CANCELLED"); + break; + } + + CFUMASS_DEBUG(sc, "USB_ST_ERROR: %s", usbd_errstr(usb_error)); + + goto tr_setup; + } +} + +static void +cfumass_t_data_out_callback(struct usb_xfer *xfer, usb_error_t usb_error) +{ + struct cfumass_softc *sc; + union ctl_io *io; + struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; + int actlen, ctl_sg_count; + + sc = usbd_xfer_softc(xfer); + + CFUMASS_DEBUG(sc, "go"); + + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + io = sc->sc_ctl_io; + + if (io->scsiio.kern_sg_entries > 0) { + ctl_sglist = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; + ctl_sg_count = io->scsiio.kern_sg_entries; + } else { + ctl_sglist = &ctl_sg_entry; + ctl_sglist->addr = io->scsiio.kern_data_ptr; + ctl_sglist->len = io->scsiio.kern_data_len; + ctl_sg_count = 1; + } + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + CFUMASS_DEBUG(sc, "USB_ST_TRANSFERRED"); + + /* + * If the host sent less data than required, zero-out + * the remaining buffer space, to prevent a malicious host + * to writing uninitialized kernel memory to the disk. + */ + if (actlen != ctl_sglist[0].len) { + KASSERT(actlen <= ctl_sglist[0].len, + ("actlen %d > ctl_sglist.len %zd", + actlen, ctl_sglist[0].len)); + + CFUMASS_DEBUG(sc, "host transferred %d bytes" + "instead of expected %zd bytes", + actlen, ctl_sglist[0].len); + + memset((char *)(ctl_sglist[0].addr) + actlen, 0, + ctl_sglist[0].len - actlen); + } + + sc->sc_current_residue = 0; + io->scsiio.be_move_done(io); + sc->sc_ctl_io = NULL; + break; + + case USB_ST_SETUP: +tr_setup: + CFUMASS_DEBUG(sc, "USB_ST_SETUP"); + + CFUMASS_DEBUG(sc, "requested size %d, CTL segment size %zd", + sc->sc_current_transfer_length, ctl_sglist[0].len); + + usbd_xfer_set_frame_data(xfer, 0, ctl_sglist[0].addr, ctl_sglist[0].len); + usbd_transfer_submit(xfer); + break; + + default: + if (usb_error == USB_ERR_CANCELLED) { + CFUMASS_DEBUG(sc, "USB_ERR_CANCELLED"); + break; + } + + CFUMASS_DEBUG(sc, "USB_ST_ERROR: %s", + usbd_errstr(usb_error)); + + goto tr_setup; + } +} + +static void +cfumass_t_data_in_callback(struct usb_xfer *xfer, usb_error_t usb_error) +{ + struct cfumass_softc *sc; + union ctl_io *io; + uint32_t max_bulk; + struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 9 20:41:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F0F7D36A1F; Sun, 9 Apr 2017 20:41:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB8F6EDE; Sun, 9 Apr 2017 20:41:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39Kf1IV030324; Sun, 9 Apr 2017 20:41:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39Kf1U4030323; Sun, 9 Apr 2017 20:41:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704092041.v39Kf1U4030323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 9 Apr 2017 20:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316661 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 20:41:02 -0000 Author: ian Date: Sun Apr 9 20:41:00 2017 New Revision: 316661 URL: https://svnweb.freebsd.org/changeset/base/316661 Log: Update the code that compensates for the lack of a GPC interrupt controller driver for imx6. Some newer dts source puts the GIC node at the root instead of under /soc, so look in both places. Also, sometimes the GIC node doesn't list itself as its own interrupt-parent, allow that too. Modified: head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Sun Apr 9 19:30:49 2017 (r316660) +++ head/sys/arm/freescale/imx/imx6_machdep.c Sun Apr 9 20:41:00 2017 (r316661) @@ -78,7 +78,7 @@ static platform_cpu_reset_t imx6_cpu_res * We validate that we have data that looks like we expect before changing it: * - SOC node exists and has GPC as its interrupt parent. * - GPC node exists and has GIC as its interrupt parent. - * - GIC node exists and is its own interrupt parent. + * - GIC node exists and is its own interrupt parent or has no parent. * * This applies to all models of imx6. Luckily all of them have the devices * involved at the same addresses on the same buses, so we don't need any @@ -102,14 +102,20 @@ fix_fdt_interrupt_data(void) if (result <= 0) return; + /* GIC node may be child of soc node, or appear directly at root. */ gicnode = OF_finddevice("/soc/interrupt-controller@00a01000"); + if (gicnode == -1) { + gicnode = OF_finddevice("/interrupt-controller@00a01000"); if (gicnode == -1) return; + } + gicxref = OF_xref_from_node(gicnode); + + /* If gic node has no parent, pretend it is its own parent. */ result = OF_getencprop(gicnode, "interrupt-parent", &gicipar, sizeof(gicipar)); if (result <= 0) - return; - gicxref = OF_xref_from_node(gicnode); + gicipar = gicxref; gpcnode = OF_finddevice("/soc/aips-bus@02000000/gpc@020dc000"); if (gpcnode == -1) From owner-svn-src-all@freebsd.org Sun Apr 9 20:53:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AEC8D36D3C; Sun, 9 Apr 2017 20:53:04 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3EBA161E; Sun, 9 Apr 2017 20:53:03 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39Kr3FK036072; Sun, 9 Apr 2017 20:53:03 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39Kr2JO036070; Sun, 9 Apr 2017 20:53:02 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201704092053.v39Kr2JO036070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sun, 9 Apr 2017 20:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316662 - in vendor-sys/ck/dist: include src X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 20:53:04 -0000 Author: cognet Date: Sun Apr 9 20:53:02 2017 New Revision: 316662 URL: https://svnweb.freebsd.org/changeset/base/316662 Log: Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32 This brings us changes we needed in ck_epoch. Modified: vendor-sys/ck/dist/include/ck_epoch.h vendor-sys/ck/dist/src/ck_epoch.c Modified: vendor-sys/ck/dist/include/ck_epoch.h ============================================================================== --- vendor-sys/ck/dist/include/ck_epoch.h Sun Apr 9 20:41:00 2017 (r316661) +++ vendor-sys/ck/dist/include/ck_epoch.h Sun Apr 9 20:53:02 2017 (r316662) @@ -83,6 +83,7 @@ struct ck_epoch_ref { }; struct ck_epoch_record { + ck_stack_entry_t record_next; struct ck_epoch *global; unsigned int state; unsigned int epoch; @@ -92,17 +93,16 @@ struct ck_epoch_record { } local CK_CC_CACHELINE; unsigned int n_pending; unsigned int n_peak; - unsigned long n_dispatch; + unsigned int n_dispatch; + void *ct; ck_stack_t pending[CK_EPOCH_LENGTH]; - ck_stack_entry_t record_next; } CK_CC_CACHELINE; typedef struct ck_epoch_record ck_epoch_record_t; struct ck_epoch { unsigned int epoch; - char pad[CK_MD_CACHELINE - sizeof(unsigned int)]; - ck_stack_t records; unsigned int n_free; + ck_stack_t records; }; typedef struct ck_epoch ck_epoch_t; @@ -110,7 +110,14 @@ typedef struct ck_epoch ck_epoch_t; * Internal functions. */ void _ck_epoch_addref(ck_epoch_record_t *, ck_epoch_section_t *); -void _ck_epoch_delref(ck_epoch_record_t *, ck_epoch_section_t *); +bool _ck_epoch_delref(ck_epoch_record_t *, ck_epoch_section_t *); + +CK_CC_FORCE_INLINE static void * +ck_epoch_record_ct(const ck_epoch_record_t *record) +{ + + return ck_pr_load_ptr(&record->ct); +} /* * Marks the beginning of an epoch-protected section. @@ -160,9 +167,10 @@ ck_epoch_begin(ck_epoch_record_t *record } /* - * Marks the end of an epoch-protected section. + * Marks the end of an epoch-protected section. Returns true if no more + * sections exist for the caller. */ -CK_CC_FORCE_INLINE static void +CK_CC_FORCE_INLINE static bool ck_epoch_end(ck_epoch_record_t *record, ck_epoch_section_t *section) { @@ -170,15 +178,19 @@ ck_epoch_end(ck_epoch_record_t *record, ck_pr_store_uint(&record->active, record->active - 1); if (section != NULL) - _ck_epoch_delref(record, section); + return _ck_epoch_delref(record, section); - return; + return record->active == 0; } /* * Defers the execution of the function pointed to by the "cb" * argument until an epoch counter loop. This allows for a * non-blocking deferral. + * + * We can get away without a fence here due to the monotonic nature + * of the epoch counter. Worst case, this will result in some delays + * before object destruction. */ CK_CC_FORCE_INLINE static void ck_epoch_call(ck_epoch_record_t *record, @@ -195,13 +207,74 @@ ck_epoch_call(ck_epoch_record_t *record, return; } +/* + * Same as ck_epoch_call, but allows for records to be shared and is reentrant. + */ +CK_CC_FORCE_INLINE static void +ck_epoch_call_strict(ck_epoch_record_t *record, + ck_epoch_entry_t *entry, + ck_epoch_cb_t *function) +{ + struct ck_epoch *epoch = record->global; + unsigned int e = ck_pr_load_uint(&epoch->epoch); + unsigned int offset = e & (CK_EPOCH_LENGTH - 1); + + ck_pr_inc_uint(&record->n_pending); + entry->function = function; + + /* Store fence is implied by push operation. */ + ck_stack_push_upmc(&record->pending[offset], &entry->stack_entry); + return; +} + +/* + * This callback is used for synchronize_wait to allow for custom blocking + * behavior. + */ +typedef void ck_epoch_wait_cb_t(ck_epoch_t *, ck_epoch_record_t *, + void *); + +/* + * Return latest epoch value. This operation provides load ordering. + */ +CK_CC_FORCE_INLINE static unsigned int +ck_epoch_value(const ck_epoch_t *ep) +{ + + ck_pr_fence_load(); + return ck_pr_load_uint(&ep->epoch); +} + void ck_epoch_init(ck_epoch_t *); -ck_epoch_record_t *ck_epoch_recycle(ck_epoch_t *); -void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t *); + +/* + * Attempts to recycle an unused epoch record. If one is successfully + * allocated, the record context pointer is also updated. + */ +ck_epoch_record_t *ck_epoch_recycle(ck_epoch_t *, void *); + +/* + * Registers an epoch record. An optional context pointer may be passed that + * is retrievable with ck_epoch_record_ct. + */ +void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t *, void *); + +/* + * Marks a record as available for re-use by a subsequent recycle operation. + * Note that the record cannot be physically destroyed. + */ void ck_epoch_unregister(ck_epoch_record_t *); + bool ck_epoch_poll(ck_epoch_record_t *); void ck_epoch_synchronize(ck_epoch_record_t *); +void ck_epoch_synchronize_wait(ck_epoch_t *, ck_epoch_wait_cb_t *, void *); void ck_epoch_barrier(ck_epoch_record_t *); +void ck_epoch_barrier_wait(ck_epoch_record_t *, ck_epoch_wait_cb_t *, void *); + +/* + * Reclaim entries associated with a record. This is safe to call only on + * the caller's record or records that are using call_strict. + */ void ck_epoch_reclaim(ck_epoch_record_t *); #endif /* CK_EPOCH_H */ Modified: vendor-sys/ck/dist/src/ck_epoch.c ============================================================================== --- vendor-sys/ck/dist/src/ck_epoch.c Sun Apr 9 20:41:00 2017 (r316661) +++ vendor-sys/ck/dist/src/ck_epoch.c Sun Apr 9 20:53:02 2017 (r316662) @@ -139,7 +139,7 @@ CK_STACK_CONTAINER(struct ck_epoch_entry #define CK_EPOCH_SENSE_MASK (CK_EPOCH_SENSE - 1) -void +bool _ck_epoch_delref(struct ck_epoch_record *record, struct ck_epoch_section *section) { @@ -150,7 +150,7 @@ _ck_epoch_delref(struct ck_epoch_record current->count--; if (current->count > 0) - return; + return false; /* * If the current bucket no longer has any references, then @@ -161,8 +161,7 @@ _ck_epoch_delref(struct ck_epoch_record * If no other active bucket exists, then the record will go * inactive in order to allow for forward progress. */ - other = &record->local.bucket[(i + 1) & - CK_EPOCH_SENSE_MASK]; + other = &record->local.bucket[(i + 1) & CK_EPOCH_SENSE_MASK]; if (other->count > 0 && ((int)(current->epoch - other->epoch) < 0)) { /* @@ -172,7 +171,7 @@ _ck_epoch_delref(struct ck_epoch_record ck_pr_store_uint(&record->epoch, other->epoch); } - return; + return true; } void @@ -230,7 +229,7 @@ ck_epoch_init(struct ck_epoch *global) } struct ck_epoch_record * -ck_epoch_recycle(struct ck_epoch *global) +ck_epoch_recycle(struct ck_epoch *global, void *ct) { struct ck_epoch_record *record; ck_stack_entry_t *cursor; @@ -249,6 +248,12 @@ ck_epoch_recycle(struct ck_epoch *global CK_EPOCH_STATE_USED); if (state == CK_EPOCH_STATE_FREE) { ck_pr_dec_uint(&global->n_free); + ck_pr_store_ptr(&record->ct, ct); + + /* + * The context pointer is ordered by a + * subsequent protected section. + */ return record; } } @@ -258,7 +263,8 @@ ck_epoch_recycle(struct ck_epoch *global } void -ck_epoch_register(struct ck_epoch *global, struct ck_epoch_record *record) +ck_epoch_register(struct ck_epoch *global, struct ck_epoch_record *record, + void *ct) { size_t i; @@ -269,6 +275,7 @@ ck_epoch_register(struct ck_epoch *globa record->n_dispatch = 0; record->n_peak = 0; record->n_pending = 0; + record->ct = ct; memset(&record->local, 0, sizeof record->local); for (i = 0; i < CK_EPOCH_LENGTH; i++) @@ -295,6 +302,7 @@ ck_epoch_unregister(struct ck_epoch_reco for (i = 0; i < CK_EPOCH_LENGTH; i++) ck_stack_init(&record->pending[i]); + ck_pr_store_ptr(&record->ct, NULL); ck_pr_fence_store(); ck_pr_store_uint(&record->state, CK_EPOCH_STATE_FREE); ck_pr_inc_uint(&global->n_free); @@ -345,11 +353,10 @@ ck_epoch_dispatch(struct ck_epoch_record { unsigned int epoch = e & (CK_EPOCH_LENGTH - 1); ck_stack_entry_t *head, *next, *cursor; + unsigned int n_pending, n_peak; unsigned int i = 0; - head = CK_STACK_FIRST(&record->pending[epoch]); - ck_stack_init(&record->pending[epoch]); - + head = ck_stack_batch_pop_upmc(&record->pending[epoch]); for (cursor = head; cursor != NULL; cursor = next) { struct ck_epoch_entry *entry = ck_epoch_entry_container(cursor); @@ -359,11 +366,18 @@ ck_epoch_dispatch(struct ck_epoch_record i++; } - if (record->n_pending > record->n_peak) - record->n_peak = record->n_pending; + n_peak = ck_pr_load_uint(&record->n_peak); + n_pending = ck_pr_load_uint(&record->n_pending); + + /* We don't require accuracy around peak calculation. */ + if (n_pending > n_peak) + ck_pr_store_uint(&record->n_peak, n_peak); + + if (i > 0) { + ck_pr_add_uint(&record->n_dispatch, i); + ck_pr_sub_uint(&record->n_pending, i); + } - record->n_dispatch += i; - record->n_pending -= i; return; } @@ -381,13 +395,24 @@ ck_epoch_reclaim(struct ck_epoch_record return; } +CK_CC_FORCE_INLINE static void +epoch_block(struct ck_epoch *global, struct ck_epoch_record *cr, + ck_epoch_wait_cb_t *cb, void *ct) +{ + + if (cb != NULL) + cb(global, cr, ct); + + return; +} + /* * This function must not be called with-in read section. */ void -ck_epoch_synchronize(struct ck_epoch_record *record) +ck_epoch_synchronize_wait(struct ck_epoch *global, + ck_epoch_wait_cb_t *cb, void *ct) { - struct ck_epoch *global = record->global; struct ck_epoch_record *cr; unsigned int delta, epoch, goal, i; bool active; @@ -424,10 +449,27 @@ ck_epoch_synchronize(struct ck_epoch_rec * period. */ e_d = ck_pr_load_uint(&global->epoch); - if (e_d != delta) { - delta = e_d; - goto reload; + if (e_d == delta) { + epoch_block(global, cr, cb, ct); + continue; } + + /* + * If the epoch has been updated, we may have already + * met our goal. + */ + delta = e_d; + if ((goal > epoch) & (delta >= goal)) + goto leave; + + epoch_block(global, cr, cb, ct); + + /* + * If the epoch has been updated, then a grace period + * requires that all threads are observed idle at the + * same epoch. + */ + cr = NULL; } /* @@ -459,20 +501,6 @@ ck_epoch_synchronize(struct ck_epoch_rec * Otherwise, we have just acquired latest snapshot. */ delta = delta + r; - continue; - -reload: - if ((goal > epoch) & (delta >= goal)) { - /* - * Right now, epoch overflow is handled as an edge - * case. If we have already observed an epoch - * generation, then we can be sure no hazardous - * references exist to objects from this generation. We - * can actually avoid an addtional scan step at this - * point. - */ - break; - } } /* @@ -480,8 +508,16 @@ reload: * However, if non-temporal instructions are used, full barrier * semantics are necessary. */ +leave: ck_pr_fence_memory(); - record->epoch = delta; + return; +} + +void +ck_epoch_synchronize(struct ck_epoch_record *record) +{ + + ck_epoch_synchronize_wait(record->global, NULL, NULL); return; } @@ -494,6 +530,16 @@ ck_epoch_barrier(struct ck_epoch_record return; } +void +ck_epoch_barrier_wait(struct ck_epoch_record *record, ck_epoch_wait_cb_t *cb, + void *ct) +{ + + ck_epoch_synchronize_wait(record->global, cb, ct); + ck_epoch_reclaim(record); + return; +} + /* * It may be worth it to actually apply these deferral semantics to an epoch * that was observed at ck_epoch_call time. The problem is that the latter @@ -509,7 +555,6 @@ ck_epoch_poll(struct ck_epoch_record *re { bool active; unsigned int epoch; - unsigned int snapshot; struct ck_epoch_record *cr = NULL; struct ck_epoch *global = record->global; @@ -533,12 +578,7 @@ ck_epoch_poll(struct ck_epoch_record *re } /* If an active thread exists, rely on epoch observation. */ - if (ck_pr_cas_uint_value(&global->epoch, epoch, epoch + 1, - &snapshot) == false) { - record->epoch = snapshot; - } else { - record->epoch = epoch + 1; - } + (void)ck_pr_cas_uint(&global->epoch, epoch, epoch + 1); ck_epoch_dispatch(record, epoch + 1); return true; From owner-svn-src-all@freebsd.org Sun Apr 9 20:54:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA3BAD36DB1; Sun, 9 Apr 2017 20:54:34 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93BD31759; Sun, 9 Apr 2017 20:54:34 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39KsXRn036161; Sun, 9 Apr 2017 20:54:33 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39KsXUH036160; Sun, 9 Apr 2017 20:54:33 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201704092054.v39KsXUH036160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sun, 9 Apr 2017 20:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316663 - vendor-sys/ck/20170407 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 20:54:35 -0000 Author: cognet Date: Sun Apr 9 20:54:33 2017 New Revision: 316663 URL: https://svnweb.freebsd.org/changeset/base/316663 Log: Tag new CK import. Added: vendor-sys/ck/20170407/ - copied from r316662, vendor-sys/ck/dist/ From owner-svn-src-all@freebsd.org Sun Apr 9 20:59:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACD96D36E73; Sun, 9 Apr 2017 20:59:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C4A718EC; Sun, 9 Apr 2017 20:59:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39KxCpl036389; Sun, 9 Apr 2017 20:59:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39KxCsX036387; Sun, 9 Apr 2017 20:59:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704092059.v39KxCsX036387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 9 Apr 2017 20:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316664 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 20:59:13 -0000 Author: ian Date: Sun Apr 9 20:59:12 2017 New Revision: 316664 URL: https://svnweb.freebsd.org/changeset/base/316664 Log: Add code/constants for detecting imx6ul (ultralite) chips, a species of imx6 based on a single cortex-a7 core. Other changes to imx6 drivers and support code are needed to fully support the imx6ul. Also fix an indentation glitch committed in the prior change. Modified: head/sys/arm/freescale/imx/imx6_machdep.c head/sys/arm/freescale/imx/imx_machdep.h Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Sun Apr 9 20:54:33 2017 (r316663) +++ head/sys/arm/freescale/imx/imx6_machdep.c Sun Apr 9 20:59:12 2017 (r316664) @@ -106,8 +106,8 @@ fix_fdt_interrupt_data(void) gicnode = OF_finddevice("/soc/interrupt-controller@00a01000"); if (gicnode == -1) { gicnode = OF_finddevice("/interrupt-controller@00a01000"); - if (gicnode == -1) - return; + if (gicnode == -1) + return; } gicxref = OF_xref_from_node(gicnode); @@ -234,6 +234,7 @@ imx_soc_type(void) #define HWSOC_MX6DL 0x61 #define HWSOC_MX6SOLO 0x62 #define HWSOC_MX6Q 0x63 +#define HWSOC_MX6UL 0x64 if (soctype != 0) return (soctype); @@ -272,6 +273,9 @@ imx_soc_type(void) case HWSOC_MX6Q : soctype = IMXSOC_6Q; break; + case HWSOC_MX6UL: + soctype = IMXSOC_6UL; + break; default: printf("imx_soc_type: Don't understand hwsoc 0x%02x, " "digprog 0x%08x; assuming IMXSOC_6Q\n", hwsoc, digprog); @@ -323,3 +327,4 @@ static platform_method_t imx6_methods[] FDT_PLATFORM_DEF2(imx6, imx6s, "i.MX6 Solo", 0, "fsl,imx6s", 0); FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6dl", 0); FDT_PLATFORM_DEF2(imx6, imx6q, "i.MX6 Quad", 0, "fsl,imx6q", 0); +FDT_PLATFORM_DEF2(imx6, imx6ul, "i.MX6 UltraLite", 0, "fsl,imx6ul", 0); Modified: head/sys/arm/freescale/imx/imx_machdep.h ============================================================================== --- head/sys/arm/freescale/imx/imx_machdep.h Sun Apr 9 20:54:33 2017 (r316663) +++ head/sys/arm/freescale/imx/imx_machdep.h Sun Apr 9 20:59:12 2017 (r316664) @@ -55,6 +55,7 @@ void imx_wdog_init_last_reset(vm_offset_ #define IMXSOC_6DL 0x61000000 #define IMXSOC_6S 0x62000000 #define IMXSOC_6Q 0x63000000 +#define IMXSOC_6UL 0x64000000 #define IMXSOC_FAMSHIFT 28 u_int imx_soc_type(void); From owner-svn-src-all@freebsd.org Sun Apr 9 21:02:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 071FBD3661E; Sun, 9 Apr 2017 21:02:07 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6611401; Sun, 9 Apr 2017 21:02:06 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39L25o3040069; Sun, 9 Apr 2017 21:02:05 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39L25oh040066; Sun, 9 Apr 2017 21:02:05 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201704092102.v39L25oh040066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Sun, 9 Apr 2017 21:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316665 - in head/sys: compat/linuxkpi/common/src contrib/ck/include contrib/ck/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 21:02:07 -0000 Author: cognet Date: Sun Apr 9 21:02:05 2017 New Revision: 316665 URL: https://svnweb.freebsd.org/changeset/base/316665 Log: Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32 This brings us changes we needed in ck_epoch. Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c head/sys/contrib/ck/include/ck_epoch.h head/sys/contrib/ck/src/ck_epoch.c Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_rcu.c Sun Apr 9 20:59:12 2017 (r316664) +++ head/sys/compat/linuxkpi/common/src/linux_rcu.c Sun Apr 9 21:02:05 2017 (r316665) @@ -105,7 +105,7 @@ linux_rcu_runtime_init(void *arg __unuse ck_epoch_record_t *record; record = malloc(sizeof(*record), M_LRCU, M_WAITOK | M_ZERO); - ck_epoch_register(&linux_epoch, record); + ck_epoch_register(&linux_epoch, record, NULL); DPCPU_ID_SET(i, linux_reader_epoch_record, record); } @@ -116,7 +116,7 @@ linux_rcu_runtime_init(void *arg __unuse record = malloc(sizeof(*record), M_LRCU, M_WAITOK | M_ZERO); - ck_epoch_register(&linux_epoch, &record->epoch_record); + ck_epoch_register(&linux_epoch, &record->epoch_record, NULL); mtx_init(&record->head_lock, "LRCU-HEAD", NULL, MTX_DEF); mtx_init(&record->sync_lock, "LRCU-SYNC", NULL, MTX_DEF); TASK_INIT(&record->task, 0, linux_rcu_cleaner_func, record); @@ -170,14 +170,14 @@ linux_srcu_get_record(void) * NOTE: The only records that are unregistered and can be * recycled are srcu_epoch_records. */ - record = (struct srcu_epoch_record *)ck_epoch_recycle(&linux_epoch); + record = (struct srcu_epoch_record *)ck_epoch_recycle(&linux_epoch, NULL); if (__predict_true(record != NULL)) return (record); record = malloc(sizeof(*record), M_LRCU, M_WAITOK | M_ZERO); mtx_init(&record->read_lock, "SRCU-READ", NULL, MTX_DEF | MTX_NOWITNESS); mtx_init(&record->sync_lock, "SRCU-SYNC", NULL, MTX_DEF | MTX_NOWITNESS); - ck_epoch_register(&linux_epoch, &record->epoch_record); + ck_epoch_register(&linux_epoch, &record->epoch_record, NULL); return (record); } Modified: head/sys/contrib/ck/include/ck_epoch.h ============================================================================== --- head/sys/contrib/ck/include/ck_epoch.h Sun Apr 9 20:59:12 2017 (r316664) +++ head/sys/contrib/ck/include/ck_epoch.h Sun Apr 9 21:02:05 2017 (r316665) @@ -83,6 +83,7 @@ struct ck_epoch_ref { }; struct ck_epoch_record { + ck_stack_entry_t record_next; struct ck_epoch *global; unsigned int state; unsigned int epoch; @@ -92,17 +93,16 @@ struct ck_epoch_record { } local CK_CC_CACHELINE; unsigned int n_pending; unsigned int n_peak; - unsigned long n_dispatch; + unsigned int n_dispatch; + void *ct; ck_stack_t pending[CK_EPOCH_LENGTH]; - ck_stack_entry_t record_next; } CK_CC_CACHELINE; typedef struct ck_epoch_record ck_epoch_record_t; struct ck_epoch { unsigned int epoch; - char pad[CK_MD_CACHELINE - sizeof(unsigned int)]; - ck_stack_t records; unsigned int n_free; + ck_stack_t records; }; typedef struct ck_epoch ck_epoch_t; @@ -110,7 +110,14 @@ typedef struct ck_epoch ck_epoch_t; * Internal functions. */ void _ck_epoch_addref(ck_epoch_record_t *, ck_epoch_section_t *); -void _ck_epoch_delref(ck_epoch_record_t *, ck_epoch_section_t *); +bool _ck_epoch_delref(ck_epoch_record_t *, ck_epoch_section_t *); + +CK_CC_FORCE_INLINE static void * +ck_epoch_record_ct(const ck_epoch_record_t *record) +{ + + return ck_pr_load_ptr(&record->ct); +} /* * Marks the beginning of an epoch-protected section. @@ -160,9 +167,10 @@ ck_epoch_begin(ck_epoch_record_t *record } /* - * Marks the end of an epoch-protected section. + * Marks the end of an epoch-protected section. Returns true if no more + * sections exist for the caller. */ -CK_CC_FORCE_INLINE static void +CK_CC_FORCE_INLINE static bool ck_epoch_end(ck_epoch_record_t *record, ck_epoch_section_t *section) { @@ -170,15 +178,19 @@ ck_epoch_end(ck_epoch_record_t *record, ck_pr_store_uint(&record->active, record->active - 1); if (section != NULL) - _ck_epoch_delref(record, section); + return _ck_epoch_delref(record, section); - return; + return record->active == 0; } /* * Defers the execution of the function pointed to by the "cb" * argument until an epoch counter loop. This allows for a * non-blocking deferral. + * + * We can get away without a fence here due to the monotonic nature + * of the epoch counter. Worst case, this will result in some delays + * before object destruction. */ CK_CC_FORCE_INLINE static void ck_epoch_call(ck_epoch_record_t *record, @@ -195,13 +207,74 @@ ck_epoch_call(ck_epoch_record_t *record, return; } +/* + * Same as ck_epoch_call, but allows for records to be shared and is reentrant. + */ +CK_CC_FORCE_INLINE static void +ck_epoch_call_strict(ck_epoch_record_t *record, + ck_epoch_entry_t *entry, + ck_epoch_cb_t *function) +{ + struct ck_epoch *epoch = record->global; + unsigned int e = ck_pr_load_uint(&epoch->epoch); + unsigned int offset = e & (CK_EPOCH_LENGTH - 1); + + ck_pr_inc_uint(&record->n_pending); + entry->function = function; + + /* Store fence is implied by push operation. */ + ck_stack_push_upmc(&record->pending[offset], &entry->stack_entry); + return; +} + +/* + * This callback is used for synchronize_wait to allow for custom blocking + * behavior. + */ +typedef void ck_epoch_wait_cb_t(ck_epoch_t *, ck_epoch_record_t *, + void *); + +/* + * Return latest epoch value. This operation provides load ordering. + */ +CK_CC_FORCE_INLINE static unsigned int +ck_epoch_value(const ck_epoch_t *ep) +{ + + ck_pr_fence_load(); + return ck_pr_load_uint(&ep->epoch); +} + void ck_epoch_init(ck_epoch_t *); -ck_epoch_record_t *ck_epoch_recycle(ck_epoch_t *); -void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t *); + +/* + * Attempts to recycle an unused epoch record. If one is successfully + * allocated, the record context pointer is also updated. + */ +ck_epoch_record_t *ck_epoch_recycle(ck_epoch_t *, void *); + +/* + * Registers an epoch record. An optional context pointer may be passed that + * is retrievable with ck_epoch_record_ct. + */ +void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t *, void *); + +/* + * Marks a record as available for re-use by a subsequent recycle operation. + * Note that the record cannot be physically destroyed. + */ void ck_epoch_unregister(ck_epoch_record_t *); + bool ck_epoch_poll(ck_epoch_record_t *); void ck_epoch_synchronize(ck_epoch_record_t *); +void ck_epoch_synchronize_wait(ck_epoch_t *, ck_epoch_wait_cb_t *, void *); void ck_epoch_barrier(ck_epoch_record_t *); +void ck_epoch_barrier_wait(ck_epoch_record_t *, ck_epoch_wait_cb_t *, void *); + +/* + * Reclaim entries associated with a record. This is safe to call only on + * the caller's record or records that are using call_strict. + */ void ck_epoch_reclaim(ck_epoch_record_t *); #endif /* CK_EPOCH_H */ Modified: head/sys/contrib/ck/src/ck_epoch.c ============================================================================== --- head/sys/contrib/ck/src/ck_epoch.c Sun Apr 9 20:59:12 2017 (r316664) +++ head/sys/contrib/ck/src/ck_epoch.c Sun Apr 9 21:02:05 2017 (r316665) @@ -139,7 +139,7 @@ CK_STACK_CONTAINER(struct ck_epoch_entry #define CK_EPOCH_SENSE_MASK (CK_EPOCH_SENSE - 1) -void +bool _ck_epoch_delref(struct ck_epoch_record *record, struct ck_epoch_section *section) { @@ -150,7 +150,7 @@ _ck_epoch_delref(struct ck_epoch_record current->count--; if (current->count > 0) - return; + return false; /* * If the current bucket no longer has any references, then @@ -161,8 +161,7 @@ _ck_epoch_delref(struct ck_epoch_record * If no other active bucket exists, then the record will go * inactive in order to allow for forward progress. */ - other = &record->local.bucket[(i + 1) & - CK_EPOCH_SENSE_MASK]; + other = &record->local.bucket[(i + 1) & CK_EPOCH_SENSE_MASK]; if (other->count > 0 && ((int)(current->epoch - other->epoch) < 0)) { /* @@ -172,7 +171,7 @@ _ck_epoch_delref(struct ck_epoch_record ck_pr_store_uint(&record->epoch, other->epoch); } - return; + return true; } void @@ -230,7 +229,7 @@ ck_epoch_init(struct ck_epoch *global) } struct ck_epoch_record * -ck_epoch_recycle(struct ck_epoch *global) +ck_epoch_recycle(struct ck_epoch *global, void *ct) { struct ck_epoch_record *record; ck_stack_entry_t *cursor; @@ -249,6 +248,12 @@ ck_epoch_recycle(struct ck_epoch *global CK_EPOCH_STATE_USED); if (state == CK_EPOCH_STATE_FREE) { ck_pr_dec_uint(&global->n_free); + ck_pr_store_ptr(&record->ct, ct); + + /* + * The context pointer is ordered by a + * subsequent protected section. + */ return record; } } @@ -258,7 +263,8 @@ ck_epoch_recycle(struct ck_epoch *global } void -ck_epoch_register(struct ck_epoch *global, struct ck_epoch_record *record) +ck_epoch_register(struct ck_epoch *global, struct ck_epoch_record *record, + void *ct) { size_t i; @@ -269,6 +275,7 @@ ck_epoch_register(struct ck_epoch *globa record->n_dispatch = 0; record->n_peak = 0; record->n_pending = 0; + record->ct = ct; memset(&record->local, 0, sizeof record->local); for (i = 0; i < CK_EPOCH_LENGTH; i++) @@ -295,6 +302,7 @@ ck_epoch_unregister(struct ck_epoch_reco for (i = 0; i < CK_EPOCH_LENGTH; i++) ck_stack_init(&record->pending[i]); + ck_pr_store_ptr(&record->ct, NULL); ck_pr_fence_store(); ck_pr_store_uint(&record->state, CK_EPOCH_STATE_FREE); ck_pr_inc_uint(&global->n_free); @@ -345,11 +353,10 @@ ck_epoch_dispatch(struct ck_epoch_record { unsigned int epoch = e & (CK_EPOCH_LENGTH - 1); ck_stack_entry_t *head, *next, *cursor; + unsigned int n_pending, n_peak; unsigned int i = 0; - head = CK_STACK_FIRST(&record->pending[epoch]); - ck_stack_init(&record->pending[epoch]); - + head = ck_stack_batch_pop_upmc(&record->pending[epoch]); for (cursor = head; cursor != NULL; cursor = next) { struct ck_epoch_entry *entry = ck_epoch_entry_container(cursor); @@ -359,11 +366,18 @@ ck_epoch_dispatch(struct ck_epoch_record i++; } - if (record->n_pending > record->n_peak) - record->n_peak = record->n_pending; + n_peak = ck_pr_load_uint(&record->n_peak); + n_pending = ck_pr_load_uint(&record->n_pending); + + /* We don't require accuracy around peak calculation. */ + if (n_pending > n_peak) + ck_pr_store_uint(&record->n_peak, n_peak); + + if (i > 0) { + ck_pr_add_uint(&record->n_dispatch, i); + ck_pr_sub_uint(&record->n_pending, i); + } - record->n_dispatch += i; - record->n_pending -= i; return; } @@ -381,13 +395,24 @@ ck_epoch_reclaim(struct ck_epoch_record return; } +CK_CC_FORCE_INLINE static void +epoch_block(struct ck_epoch *global, struct ck_epoch_record *cr, + ck_epoch_wait_cb_t *cb, void *ct) +{ + + if (cb != NULL) + cb(global, cr, ct); + + return; +} + /* * This function must not be called with-in read section. */ void -ck_epoch_synchronize(struct ck_epoch_record *record) +ck_epoch_synchronize_wait(struct ck_epoch *global, + ck_epoch_wait_cb_t *cb, void *ct) { - struct ck_epoch *global = record->global; struct ck_epoch_record *cr; unsigned int delta, epoch, goal, i; bool active; @@ -424,10 +449,27 @@ ck_epoch_synchronize(struct ck_epoch_rec * period. */ e_d = ck_pr_load_uint(&global->epoch); - if (e_d != delta) { - delta = e_d; - goto reload; + if (e_d == delta) { + epoch_block(global, cr, cb, ct); + continue; } + + /* + * If the epoch has been updated, we may have already + * met our goal. + */ + delta = e_d; + if ((goal > epoch) & (delta >= goal)) + goto leave; + + epoch_block(global, cr, cb, ct); + + /* + * If the epoch has been updated, then a grace period + * requires that all threads are observed idle at the + * same epoch. + */ + cr = NULL; } /* @@ -459,20 +501,6 @@ ck_epoch_synchronize(struct ck_epoch_rec * Otherwise, we have just acquired latest snapshot. */ delta = delta + r; - continue; - -reload: - if ((goal > epoch) & (delta >= goal)) { - /* - * Right now, epoch overflow is handled as an edge - * case. If we have already observed an epoch - * generation, then we can be sure no hazardous - * references exist to objects from this generation. We - * can actually avoid an addtional scan step at this - * point. - */ - break; - } } /* @@ -480,8 +508,16 @@ reload: * However, if non-temporal instructions are used, full barrier * semantics are necessary. */ +leave: ck_pr_fence_memory(); - record->epoch = delta; + return; +} + +void +ck_epoch_synchronize(struct ck_epoch_record *record) +{ + + ck_epoch_synchronize_wait(record->global, NULL, NULL); return; } @@ -494,6 +530,16 @@ ck_epoch_barrier(struct ck_epoch_record return; } +void +ck_epoch_barrier_wait(struct ck_epoch_record *record, ck_epoch_wait_cb_t *cb, + void *ct) +{ + + ck_epoch_synchronize_wait(record->global, cb, ct); + ck_epoch_reclaim(record); + return; +} + /* * It may be worth it to actually apply these deferral semantics to an epoch * that was observed at ck_epoch_call time. The problem is that the latter @@ -509,7 +555,6 @@ ck_epoch_poll(struct ck_epoch_record *re { bool active; unsigned int epoch; - unsigned int snapshot; struct ck_epoch_record *cr = NULL; struct ck_epoch *global = record->global; @@ -533,12 +578,7 @@ ck_epoch_poll(struct ck_epoch_record *re } /* If an active thread exists, rely on epoch observation. */ - if (ck_pr_cas_uint_value(&global->epoch, epoch, epoch + 1, - &snapshot) == false) { - record->epoch = snapshot; - } else { - record->epoch = epoch + 1; - } + (void)ck_pr_cas_uint(&global->epoch, epoch, epoch + 1); ck_epoch_dispatch(record, epoch + 1); return true; From owner-svn-src-all@freebsd.org Sun Apr 9 21:06:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA181D36901; Sun, 9 Apr 2017 21:06:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A5819BB; Sun, 9 Apr 2017 21:06:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39L6L3F040241; Sun, 9 Apr 2017 21:06:21 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39L6L6g040240; Sun, 9 Apr 2017 21:06:21 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704092106.v39L6L6g040240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 9 Apr 2017 21:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316666 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 21:06:22 -0000 Author: rmacklem Date: Sun Apr 9 21:06:21 2017 New Revision: 316666 URL: https://svnweb.freebsd.org/changeset/base/316666 Log: Fix the NFSv4.1 client for NFSERR_BADSESSION recovery via ReclaimComplete. For the ReclaimComplete operation, the RPC layer should not loop on NFSERR_BADSESSION. If it does, the recovery thread (nfscl) can get stuck looping and will not do a recovery. This patch fixes it so it does not loop. This bug only affects NFSv4.1 and only when a server reboots. Tested by: cperciva PR: 215886 MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sun Apr 9 21:02:05 2017 (r316665) +++ head/sys/fs/nfs/nfs_commonsubs.c Sun Apr 9 21:06:21 2017 (r316666) @@ -148,7 +148,7 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Test StateID */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Want Delegation */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Destroy ClientID */ - { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Reclaim Complete */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Reclaim Complete */ }; #endif /* !APPLEKEXT */ From owner-svn-src-all@freebsd.org Sun Apr 9 21:50:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2BABD362DA; Sun, 9 Apr 2017 21:50:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 949BEECF; Sun, 9 Apr 2017 21:50:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39LoLMd056729; Sun, 9 Apr 2017 21:50:21 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39LoLw3056728; Sun, 9 Apr 2017 21:50:21 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704092150.v39LoLw3056728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 9 Apr 2017 21:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316667 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 21:50:22 -0000 Author: rmacklem Date: Sun Apr 9 21:50:21 2017 New Revision: 316667 URL: https://svnweb.freebsd.org/changeset/base/316667 Log: Fix the NFSv4 client hndling of a stale write verifier in the Commit operation. When the NFSv4 client Commit operation encountered a stale write verifier, it erroneously mapped that to EIO. This could have caused recently written data to be lost when a server crashes/reboots between an UNSTABLE write and the subsequent commit. This patch fixes this. The bug was only for the NFSv4 client and did not affect NFSv3. Tested by: cperciva PR: 215887 MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sun Apr 9 21:06:21 2017 (r316666) +++ head/sys/fs/nfsclient/nfs_clport.c Sun Apr 9 21:50:21 2017 (r316667) @@ -1196,7 +1196,7 @@ nfscl_maperr(struct thread *td, int erro { struct proc *p; - if (error < 10000) + if (error < 10000 || error >= NFSERR_STALEWRITEVERF) return (error); if (td != NULL) p = td->td_proc; From owner-svn-src-all@freebsd.org Sun Apr 9 22:57:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3E76D36723; Sun, 9 Apr 2017 22:57:54 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 380AF877; Sun, 9 Apr 2017 22:57:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f47.google.com with SMTP id u2so25021981wmu.0; Sun, 09 Apr 2017 15:57:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=yYKoNSmFexX0HaiB2Lgbo6BaghpvWD/OU8AK+xKzRMM=; b=ANtUMmva4lK3texLdGyNpvjlMmO+BWupSNTWn4dK24Pr7YzavbVmg2X2n485PGPSkL D/c1fHHo23a/XnVPbvnuQGYU0wS2ERvwMqC6mWPiMQHR1BW3rk/0xNJS3cDf8vk0c+32 lU7hL7g89QNJuzZ7UswXKfm0WQHFrAApCA8StCaJKA1d6RYzcRnWGXTylTAr3dD2q/SW jgrX+ldeprOwS1fDRx1Kzj8yG8d6+Ygx1BEs8Ru06aV2r6YNOKsKjkd6mtkxd4eVDvEx Y52sz+ucb/O/9WMQRW8CCt3//TtOk2XlLuWgCV902SWcGYW0qFaIKSc11qgGQWx3xXAX ad3Q== X-Gm-Message-State: AN3rC/6l+cGPZXImoqZ8ExsAsfKbqqctU467lsHoEphUvGwcaaeGIu1e dOIMv8d6mfeQ/A== X-Received: by 10.28.132.144 with SMTP id g138mr7788748wmd.51.1491778199300; Sun, 09 Apr 2017 15:49:59 -0700 (PDT) Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com. [209.85.128.179]) by smtp.gmail.com with ESMTPSA id p38sm15026705wrb.31.2017.04.09.15.49.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 15:49:58 -0700 (PDT) Received: by mail-wr0-f179.google.com with SMTP id o21so109482300wrb.2; Sun, 09 Apr 2017 15:49:58 -0700 (PDT) X-Received: by 10.223.160.239 with SMTP id n44mr46177036wrn.198.1491778198378; Sun, 09 Apr 2017 15:49:58 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Sun, 9 Apr 2017 15:49:57 -0700 (PDT) In-Reply-To: <201704092102.v39L25oh040066@repo.freebsd.org> References: <201704092102.v39L25oh040066@repo.freebsd.org> From: Conrad Meyer Date: Sun, 9 Apr 2017 15:49:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316665 - in head/sys: compat/linuxkpi/common/src contrib/ck/include contrib/ck/src To: Olivier Houchard Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 22:57:54 -0000 On Sun, Apr 9, 2017 at 2:02 PM, Olivier Houchard wrote= : > Author: cognet > Date: Sun Apr 9 21:02:05 2017 > New Revision: 316665 > URL: https://svnweb.freebsd.org/changeset/base/316665 > > Log: > Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32 > This brings us changes we needed in ck_epoch. Out of curiosity =E2=80=94 what changes did we need, and why? Thanks, Conrad From owner-svn-src-all@freebsd.org Sun Apr 9 23:08:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B518D36A3E; Sun, 9 Apr 2017 23:08:49 +0000 (UTC) (envelope-from cognet@ci0.org) Received: from kanar.ci0.org (kanar.ci0.org [IPv6:2001:bc8:35e6::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "sd-123398", Issuer "sd-123398" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D3D3D7B; Sun, 9 Apr 2017 23:08:48 +0000 (UTC) (envelope-from cognet@ci0.org) Received: from kanar.ci0.org (pluxor@localhost [127.0.0.1]) by kanar.ci0.org (8.15.2/8.15.2) with ESMTPS id v39N8eZp090370 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 10 Apr 2017 01:08:40 +0200 (CEST) (envelope-from cognet@ci0.org) Received: (from doginou@localhost) by kanar.ci0.org (8.15.2/8.15.2/Submit) id v39N8efJ090369; Mon, 10 Apr 2017 01:08:40 +0200 (CEST) (envelope-from cognet@ci0.org) X-Authentication-Warning: kanar.ci0.org: doginou set sender to cognet@ci0.org using -f Date: Mon, 10 Apr 2017 01:08:40 +0200 From: Olivier Houchard To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316665 - in head/sys: compat/linuxkpi/common/src contrib/ck/include contrib/ck/src Message-ID: <20170409230840.GA90254@ci0.org> References: <201704092102.v39L25oh040066@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 23:08:49 -0000 On Sun, Apr 09, 2017 at 03:49:57PM -0700, Conrad Meyer wrote: > On Sun, Apr 9, 2017 at 2:02 PM, Olivier Houchard wrote: > > Author: cognet > > Date: Sun Apr 9 21:02:05 2017 > > New Revision: 316665 > > URL: https://svnweb.freebsd.org/changeset/base/316665 > > > > Log: > > Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32 > > This brings us changes we needed in ck_epoch. > > Out of curiosity ??? what changes did we need, and why? > Hi Conrad, What ck_epoch lacked was any way to do priority propagation, which led to some nice deadlocks to the linuxkpi folks. Regards, Olivier From owner-svn-src-all@freebsd.org Mon Apr 10 01:26:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C26FD3559E; Mon, 10 Apr 2017 01:26:14 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B551F92; Mon, 10 Apr 2017 01:26:14 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3A1QDSJ045551; Mon, 10 Apr 2017 01:26:13 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3A1QCVu045548; Mon, 10 Apr 2017 01:26:12 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201704100126.v3A1QCVu045548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Mon, 10 Apr 2017 01:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316668 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 01:26:14 -0000 Author: karels Date: Mon Apr 10 01:26:12 2017 New Revision: 316668 URL: https://svnweb.freebsd.org/changeset/base/316668 Log: Fix reference count leak with L2 caching. MFC r315956 ip_forward, TCP/IPv6, and probably SCTP leaked references to L2 cache entry because they used their own routes on the stack, not in_pcb routes. The original model for route caching was callers that provided a route structure to ip{,6}input() would keep the route, and this model was used for L2 caching as well. Instead, change L2 caching to be done by default only when using a route structure in the in_pcb; the pcb deallocation code frees L2 as well as L3 cacches. A separate change will add route caching to TCP/IPv6. Another suggestion was to have the transport protocols indicate willingness to use L2 caching, but this approach keeps the changes in the network level Reviewed by: ae gnn MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10059 Modified: stable/11/sys/netinet/in_pcb.c stable/11/sys/netinet/ip_output.c stable/11/sys/netinet6/ip6_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/in_pcb.c ============================================================================== --- stable/11/sys/netinet/in_pcb.c Sun Apr 9 21:50:21 2017 (r316667) +++ stable/11/sys/netinet/in_pcb.c Mon Apr 10 01:26:12 2017 (r316668) @@ -326,6 +326,12 @@ in_pcballoc(struct socket *so, struct in #endif inp->inp_gencnt = ++pcbinfo->ipi_gencnt; refcount_init(&inp->inp_refcount, 1); /* Reference from inpcbinfo */ + + /* + * Routes in inpcb's can cache L2 as well; they are guaranteed + * to be cleaned up. + */ + inp->inp_route.ro_flags = RT_LLE_CACHE; INP_LIST_WUNLOCK(pcbinfo); #if defined(IPSEC) || defined(IPSEC_SUPPORT) || defined(MAC) out: Modified: stable/11/sys/netinet/ip_output.c ============================================================================== --- stable/11/sys/netinet/ip_output.c Sun Apr 9 21:50:21 2017 (r316667) +++ stable/11/sys/netinet/ip_output.c Mon Apr 10 01:26:12 2017 (r316668) @@ -241,8 +241,7 @@ ip_output(struct mbuf *m, struct mbuf *o if (ro == NULL) { ro = &iproute; bzero(ro, sizeof (*ro)); - } else - ro->ro_flags |= RT_LLE_CACHE; + } #ifdef FLOWTABLE if (ro->ro_rt == NULL) Modified: stable/11/sys/netinet6/ip6_output.c ============================================================================== --- stable/11/sys/netinet6/ip6_output.c Sun Apr 9 21:50:21 2017 (r316667) +++ stable/11/sys/netinet6/ip6_output.c Mon Apr 10 01:26:12 2017 (r316668) @@ -493,8 +493,7 @@ ip6_output(struct mbuf *m0, struct ip6_p if (ro == NULL) { ro = &ip6route; bzero((caddr_t)ro, sizeof(*ro)); - } else - ro->ro_flags |= RT_LLE_CACHE; + } ro_pmtu = ro; if (opt && opt->ip6po_rthdr) ro = &opt->ip6po_route; From owner-svn-src-all@freebsd.org Mon Apr 10 01:28:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B878CD35671; Mon, 10 Apr 2017 01:28:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A55A14A; Mon, 10 Apr 2017 01:28:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3A1S1wI045658; Mon, 10 Apr 2017 01:28:01 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3A1S1b2045657; Mon, 10 Apr 2017 01:28:01 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704100128.v3A1S1b2045657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 10 Apr 2017 01:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316669 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 01:28:02 -0000 Author: rmacklem Date: Mon Apr 10 01:28:01 2017 New Revision: 316669 URL: https://svnweb.freebsd.org/changeset/base/316669 Log: Avoid starvation of the server crash recovery thread for the NFSv4 client. This patch gives a requestor of the exclusive lock on the client state in the NFSv4 client priority over shared lock requestors. This avoids the server crash recovery thread being starved out by other threads doing RPCs. Tested by: cperciva PR: 216087 MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Mon Apr 10 01:26:12 2017 (r316668) +++ head/sys/fs/nfsclient/nfs_clstate.c Mon Apr 10 01:28:01 2017 (r316669) @@ -797,8 +797,18 @@ nfscl_getcl(struct mount *mp, struct ucr (mp->mnt_kern_flag & MNTK_UNMOUNTF) == 0) igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL, NFSCLSTATEMUTEXPTR, mp); - if (!igotlock) + if (igotlock == 0) { + /* + * Call nfsv4_lock() with "iwantlock == 0" so that it will + * wait for a pending exclusive lock request. This gives the + * exclusive lock request priority over this shared lock + * request. + * An exclusive lock on nfsc_lock is used mainly for server + * crash recoveries. + */ + nfsv4_lock(&clp->nfsc_lock, 0, NULL, NFSCLSTATEMUTEXPTR, mp); nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, mp); + } if (igotlock == 0 && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { /* * Both nfsv4_lock() and nfsv4_getref() know to check From owner-svn-src-all@freebsd.org Mon Apr 10 02:46:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86E09D32E2A; Mon, 10 Apr 2017 02:46:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58E61B8D; Mon, 10 Apr 2017 02:46:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3A2kdt2077668; Mon, 10 Apr 2017 02:46:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3A2kdUH077667; Mon, 10 Apr 2017 02:46:39 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704100246.v3A2kdUH077667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 10 Apr 2017 02:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316670 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 02:46:40 -0000 Author: ian Date: Mon Apr 10 02:46:39 2017 New Revision: 316670 URL: https://svnweb.freebsd.org/changeset/base/316670 Log: Add support for imx6ul soc. Modified: head/sys/arm/freescale/imx/imx_iomux.c Modified: head/sys/arm/freescale/imx/imx_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx_iomux.c Mon Apr 10 01:28:01 2017 (r316669) +++ head/sys/arm/freescale/imx/imx_iomux.c Mon Apr 10 02:46:39 2017 (r316670) @@ -79,6 +79,7 @@ static struct ofw_compat_data compat_dat {"fsl,imx6dl-iomuxc", true}, {"fsl,imx6q-iomuxc", true}, {"fsl,imx6sl-iomuxc", true}, + {"fsl,imx6ul-iomuxc", true}, {"fsl,imx6sx-iomuxc", true}, {"fsl,imx53-iomuxc", true}, {"fsl,imx51-iomuxc", true}, @@ -223,6 +224,9 @@ iomux_attach(device_t dev) case IMXSOC_6Q: sc->last_gpreg = 13; break; + case IMXSOC_6UL: + sc->last_gpreg = 14; + break; default: device_printf(dev, "Unknown SoC type\n"); return (ENXIO); From owner-svn-src-all@freebsd.org Mon Apr 10 03:09:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 218B9D353DF; Mon, 10 Apr 2017 03:09:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0E469B8; Mon, 10 Apr 2017 03:09:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3A39DKG086700; Mon, 10 Apr 2017 03:09:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3A39Cxs086698; Mon, 10 Apr 2017 03:09:12 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201704100309.v3A39Cxs086698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 10 Apr 2017 03:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316671 - stable/10/sys/dev/hyperv/storvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 03:09:14 -0000 Author: sephe Date: Mon Apr 10 03:09:12 2017 New Revision: 316671 URL: https://svnweb.freebsd.org/changeset/base/316671 Log: MFC 316519 hyperv/storvsc: Fixup SRB status. This unbreaks GEN2 Hyper-V cd support. Submitted by: Hongjiang Zhang Reviewed by: dexuan@ Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D10212 Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Apr 10 02:46:39 2017 (r316670) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Apr 10 03:09:12 2017 (r316671) @@ -2148,19 +2148,20 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status &= ~CAM_SIM_QUEUED; ccb->ccb_h.status &= ~CAM_STATUS_MASK; + int srb_status = SRB_STATUS(vm_srb->srb_status); if (vm_srb->scsi_status == SCSI_STATUS_OK) { const struct scsi_generic *cmd; cmd = (const struct scsi_generic *) ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); - if (vm_srb->srb_status != SRB_STATUS_SUCCESS) { + if (srb_status != SRB_STATUS_SUCCESS) { /* * If there are errors, for example, invalid LUN, * host will inform VM through SRB status. */ if (bootverbose) { - if (vm_srb->srb_status == SRB_STATUS_INVALID_LUN) { + if (srb_status == SRB_STATUS_INVALID_LUN) { xpt_print(ccb->ccb_h.path, "invalid LUN %d for op: %s\n", vm_srb->lun, @@ -2168,7 +2169,7 @@ storvsc_io_done(struct hv_storvsc_reques } else { xpt_print(ccb->ccb_h.path, "Unknown SRB flag: %d for op: %s\n", - vm_srb->srb_status, + srb_status, scsi_op_desc(cmd->opcode, NULL)); } } @@ -2191,7 +2192,7 @@ storvsc_io_done(struct hv_storvsc_reques } if (cmd->opcode == INQUIRY && - vm_srb->srb_status == SRB_STATUS_SUCCESS) { + srb_status == SRB_STATUS_SUCCESS) { int resp_xfer_len, resp_buf_len, data_len; uint8_t *resp_buf = (uint8_t *)csio->data_ptr; struct scsi_inquiry_data *inq_data = Modified: stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h Mon Apr 10 02:46:39 2017 (r316670) +++ stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h Mon Apr 10 03:09:12 2017 (r316671) @@ -242,17 +242,16 @@ struct vstor_packet { #define SRB_STATUS_PENDING 0x00 #define SRB_STATUS_SUCCESS 0x01 #define SRB_STATUS_ABORTED 0x02 -#define SRB_STATUS_ABORT_FAILED 0x03 #define SRB_STATUS_ERROR 0x04 -#define SRB_STATUS_BUSY 0x05 - +#define SRB_STATUS_INVALID_LUN 0x20 /** * SRB Status Masks (can be combined with above status codes) */ #define SRB_STATUS_QUEUE_FROZEN 0x40 #define SRB_STATUS_AUTOSENSE_VALID 0x80 -#define SRB_STATUS_INVALID_LUN 0X20 +#define SRB_STATUS(status) \ + ((status) & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN)) /* * SRB Flag Bits */ From owner-svn-src-all@freebsd.org Mon Apr 10 03:23:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9CD5D358CA; Mon, 10 Apr 2017 03:23:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AAA71CC; Mon, 10 Apr 2017 03:23:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3A3NvLo094476; Mon, 10 Apr 2017 03:23:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3A3NvtC094471; Mon, 10 Apr 2017 03:23:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201704100323.v3A3NvtC094471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 10 Apr 2017 03:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316672 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 03:23:58 -0000 Author: sephe Date: Mon Apr 10 03:23:57 2017 New Revision: 316672 URL: https://svnweb.freebsd.org/changeset/base/316672 Log: MFC 316520 hyperv/hn: Fixat RNDIS rxfilter after the successful RNDIS init. Under certain conditions on certain versions of Hyper-V, the RNDIS rxfilter is _not_ zero on the hypervisor side after the successful RNDIS initialization, which breaks the assumption of any following code (well, it breaks the RNDIS API contract actually). Clear the RNDIS rxfilter explicitly, drain packets sneaking through, and drain the interrupt taskqueues scheduled due to the stealth packets. Reported by: dexuan@ Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D10230 Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c stable/10/sys/dev/hyperv/netvsc/hn_rndis.h stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Mon Apr 10 03:09:12 2017 (r316671) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.c Mon Apr 10 03:23:57 2017 (r316672) @@ -980,16 +980,19 @@ hn_rndis_query_hwcaps(struct hn_softc *s } int -hn_rndis_attach(struct hn_softc *sc, int mtu) +hn_rndis_attach(struct hn_softc *sc, int mtu, int *init_done) { int error; + *init_done = 0; + /* * Initialize RNDIS. */ error = hn_rndis_init(sc); if (error) return (error); + *init_done = 1; /* * Configure NDIS offload settings. Modified: stable/10/sys/dev/hyperv/netvsc/hn_rndis.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_rndis.h Mon Apr 10 03:09:12 2017 (r316671) +++ stable/10/sys/dev/hyperv/netvsc/hn_rndis.h Mon Apr 10 03:23:57 2017 (r316672) @@ -33,7 +33,7 @@ struct hn_softc; -int hn_rndis_attach(struct hn_softc *sc, int mtu); +int hn_rndis_attach(struct hn_softc *sc, int mtu, int *init_done); void hn_rndis_detach(struct hn_softc *sc); int hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags); int hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_cnt); Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Apr 10 03:09:12 2017 (r316671) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Apr 10 03:23:57 2017 (r316672) @@ -256,6 +256,7 @@ static void hn_rndis_rx_data(struct hn const void *, int); static void hn_rndis_rx_status(struct hn_softc *, const void *, int); +static void hn_rndis_init_fixat(struct hn_softc *, int); static void hn_nvs_handle_notify(struct hn_softc *, const struct vmbus_chanpkt_hdr *); @@ -321,6 +322,8 @@ static void hn_resume_mgmt(struct hn_s static void hn_suspend_mgmt_taskfunc(void *, int); static void hn_chan_drain(struct hn_softc *, struct vmbus_channel *); +static void hn_disable_rx(struct hn_softc *); +static void hn_drain_rxtx(struct hn_softc *, int); static void hn_polling(struct hn_softc *, u_int); static void hn_chan_polling(struct vmbus_channel *, u_int); @@ -2256,6 +2259,18 @@ hn_rxpkt(struct hn_rx_ring *rxr, const v /* If the VF is active, inject the packet through the VF */ ifp = rxr->hn_vf ? rxr->hn_vf : rxr->hn_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + /* + * NOTE: + * See the NOTE of hn_rndis_init_fixat(). This + * function can be reached, immediately after the + * RNDIS is initialized but before the ifnet is + * setup on the hn_attach() path; drop the unexpected + * packets. + */ + return (0); + } + if (dlen <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); if (m_new == NULL) { @@ -4685,6 +4700,27 @@ hn_synth_attachable(const struct hn_soft return (true); } +/* + * Make sure that the RX filter is zero after the successful + * RNDIS initialization. + * + * NOTE: + * Under certain conditions on certain versions of Hyper-V, + * the RNDIS rxfilter is _not_ zero on the hypervisor side + * after the successful RNDIS initialization, which breaks + * the assumption of any following code (well, it breaks the + * RNDIS API contract actually). Clear the RNDIS rxfilter + * explicitly, drain packets sneaking through, and drain the + * interrupt taskqueues scheduled due to the stealth packets. + */ +static void +hn_rndis_init_fixat(struct hn_softc *sc, int nchan) +{ + + hn_disable_rx(sc); + hn_drain_rxtx(sc, nchan); +} + static int hn_synth_attach(struct hn_softc *sc, int mtu) { @@ -4692,7 +4728,7 @@ hn_synth_attach(struct hn_softc *sc, int #define ATTACHED_RNDIS 0x0004 struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; - int error, nsubch, nchan, i; + int error, nsubch, nchan = 1, i, rndis_inited; uint32_t old_caps, attached = 0; KASSERT((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0, @@ -4727,10 +4763,11 @@ hn_synth_attach(struct hn_softc *sc, int /* * Attach RNDIS _after_ NVS is attached. */ - error = hn_rndis_attach(sc, mtu); + error = hn_rndis_attach(sc, mtu, &rndis_inited); + if (rndis_inited) + attached |= ATTACHED_RNDIS; if (error) goto failed; - attached |= ATTACHED_RNDIS; /* * Make sure capabilities are not changed. @@ -4821,14 +4858,18 @@ back: * Fixup transmission aggregation setup. */ hn_set_txagg(sc); + hn_rndis_init_fixat(sc, nchan); return (0); failed: if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { + hn_rndis_init_fixat(sc, nchan); hn_synth_detach(sc); } else { - if (attached & ATTACHED_RNDIS) + if (attached & ATTACHED_RNDIS) { + hn_rndis_init_fixat(sc, nchan); hn_rndis_detach(sc); + } if (attached & ATTACHED_NVS) hn_nvs_detach(sc); hn_chan_detach(sc, sc->hn_prichan); @@ -4900,11 +4941,56 @@ hn_chan_drain(struct hn_softc *sc, struc } static void -hn_suspend_data(struct hn_softc *sc) +hn_disable_rx(struct hn_softc *sc) +{ + + /* + * Disable RX by clearing RX filter forcefully. + */ + sc->hn_rx_filter = NDIS_PACKET_TYPE_NONE; + hn_rndis_set_rxfilter(sc, sc->hn_rx_filter); /* ignore error */ + + /* + * Give RNDIS enough time to flush all pending data packets. + */ + pause("waitrx", (200 * hz) / 1000); +} + +/* + * NOTE: + * RX/TX _must_ have been suspended/disabled, before this function + * is called. + */ +static void +hn_drain_rxtx(struct hn_softc *sc, int nchan) { struct vmbus_channel **subch = NULL; + int nsubch; + + /* + * Drain RX/TX bufrings and interrupts. + */ + nsubch = nchan - 1; + if (nsubch > 0) + subch = vmbus_subchan_get(sc->hn_prichan, nsubch); + + if (subch != NULL) { + int i; + + for (i = 0; i < nsubch; ++i) + hn_chan_drain(sc, subch[i]); + } + hn_chan_drain(sc, sc->hn_prichan); + + if (subch != NULL) + vmbus_subchan_rel(subch, nsubch); +} + +static void +hn_suspend_data(struct hn_softc *sc) +{ struct hn_tx_ring *txr; - int i, nsubch; + int i; HN_LOCK_ASSERT(sc); @@ -4932,38 +5018,21 @@ hn_suspend_data(struct hn_softc *sc) } /* - * Disable RX by clearing RX filter. + * Disable RX. */ - hn_set_rxfilter(sc, NDIS_PACKET_TYPE_NONE); + hn_disable_rx(sc); /* - * Give RNDIS enough time to flush all pending data packets. + * Drain RX/TX. */ - pause("waitrx", (200 * hz) / 1000); - - /* - * Drain RX/TX bufrings and interrupts. - */ - nsubch = sc->hn_rx_ring_inuse - 1; - if (nsubch > 0) - subch = vmbus_subchan_get(sc->hn_prichan, nsubch); - - if (subch != NULL) { - for (i = 0; i < nsubch; ++i) - hn_chan_drain(sc, subch[i]); - } - hn_chan_drain(sc, sc->hn_prichan); - - if (subch != NULL) - vmbus_subchan_rel(subch, nsubch); + hn_drain_rxtx(sc, sc->hn_rx_ring_inuse); /* * Drain any pending TX tasks. * * NOTE: - * The above hn_chan_drain() can dispatch TX tasks, so the TX - * tasks will have to be drained _after_ the above hn_chan_drain() - * calls. + * The above hn_drain_rxtx() can dispatch TX tasks, so the TX + * tasks will have to be drained _after_ the above hn_drain_rxtx(). */ for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { txr = &sc->hn_tx_ring[i]; From owner-svn-src-all@freebsd.org Mon Apr 10 04:59:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63BC5D283C4; Mon, 10 Apr 2017 04:59:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B2A01C8B; Mon, 10 Apr 2017 04:59:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3A4xig9031377; Mon, 10 Apr 2017 04:59:44 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3A4xi1w031375; Mon, 10 Apr 2017 04:59:44 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201704100459.v3A4xi1w031375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 10 Apr 2017 04:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316673 - stable/11/sys/dev/hyperv/storvsc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 04:59:45 -0000 Author: sephe Date: Mon Apr 10 04:59:44 2017 New Revision: 316673 URL: https://svnweb.freebsd.org/changeset/base/316673 Log: MFC 316519 hyperv/storvsc: Fixup SRB status. This unbreaks GEN2 Hyper-V cd support. Submitted by: Hongjiang Zhang Reviewed by: dexuan@ Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D10212 Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/11/sys/dev/hyperv/storvsc/hv_vstorage.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Apr 10 03:23:57 2017 (r316672) +++ stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Apr 10 04:59:44 2017 (r316673) @@ -2148,19 +2148,20 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status &= ~CAM_SIM_QUEUED; ccb->ccb_h.status &= ~CAM_STATUS_MASK; + int srb_status = SRB_STATUS(vm_srb->srb_status); if (vm_srb->scsi_status == SCSI_STATUS_OK) { const struct scsi_generic *cmd; cmd = (const struct scsi_generic *) ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); - if (vm_srb->srb_status != SRB_STATUS_SUCCESS) { + if (srb_status != SRB_STATUS_SUCCESS) { /* * If there are errors, for example, invalid LUN, * host will inform VM through SRB status. */ if (bootverbose) { - if (vm_srb->srb_status == SRB_STATUS_INVALID_LUN) { + if (srb_status == SRB_STATUS_INVALID_LUN) { xpt_print(ccb->ccb_h.path, "invalid LUN %d for op: %s\n", vm_srb->lun, @@ -2168,7 +2169,7 @@ storvsc_io_done(struct hv_storvsc_reques } else { xpt_print(ccb->ccb_h.path, "Unknown SRB flag: %d for op: %s\n", - vm_srb->srb_status, + srb_status, scsi_op_desc(cmd->opcode, NULL)); } } @@ -2191,7 +2192,7 @@ storvsc_io_done(struct hv_storvsc_reques } if (cmd->opcode == INQUIRY && - vm_srb->srb_status == SRB_STATUS_SUCCESS) { + srb_status == SRB_STATUS_SUCCESS) { int resp_xfer_len, resp_buf_len, data_len; uint8_t *resp_buf = (uint8_t *)csio->data_ptr; struct scsi_inquiry_data *inq_data = Modified: stable/11/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- stable/11/sys/dev/hyperv/storvsc/hv_vstorage.h Mon Apr 10 03:23:57 2017 (r316672) +++ stable/11/sys/dev/hyperv/storvsc/hv_vstorage.h Mon Apr 10 04:59:44 2017 (r316673) @@ -242,17 +242,16 @@ struct vstor_packet { #define SRB_STATUS_PENDING 0x00 #define SRB_STATUS_SUCCESS 0x01 #define SRB_STATUS_ABORTED 0x02 -#define SRB_STATUS_ABORT_FAILED 0x03 #define SRB_STATUS_ERROR 0x04 -#define SRB_STATUS_BUSY 0x05 - +#define SRB_STATUS_INVALID_LUN 0x20 /** * SRB Status Masks (can be combined with above status codes) */ #define SRB_STATUS_QUEUE_FROZEN 0x40 #define SRB_STATUS_AUTOSENSE_VALID 0x80 -#define SRB_STATUS_INVALID_LUN 0X20 +#define SRB_STATUS(status) \ + ((status) & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN)) /* * SRB Flag Bits */ From owner-svn-src-all@freebsd.org Mon Apr 10 05:17:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76996D28964; Mon, 10 Apr 2017 05:17:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3474E7EF; Mon, 10 Apr 2017 05:17:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3A5HJNT039705; Mon, 10 Apr 2017 05:17:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3A5HJT6039702; Mon, 10 Apr 2017 05:17:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201704100517.v3A5HJT6039702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 10 Apr 2017 05:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316674 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 05:17:20 -0000 Author: sephe Date: Mon Apr 10 05:17:18 2017 New Revision: 316674 URL: https://svnweb.freebsd.org/changeset/base/316674 Log: MFC 316520 hyperv/hn: Fixat RNDIS rxfilter after the successful RNDIS init. Under certain conditions on certain versions of Hyper-V, the RNDIS rxfilter is _not_ zero on the hypervisor side after the successful RNDIS initialization, which breaks the assumption of any following code (well, it breaks the RNDIS API contract actually). Clear the RNDIS rxfilter explicitly, drain packets sneaking through, and drain the interrupt taskqueues scheduled due to the stealth packets. Reported by: dexuan@ Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D10230 Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.c stable/11/sys/dev/hyperv/netvsc/hn_rndis.h stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Mon Apr 10 04:59:44 2017 (r316673) +++ stable/11/sys/dev/hyperv/netvsc/hn_rndis.c Mon Apr 10 05:17:18 2017 (r316674) @@ -979,16 +979,19 @@ hn_rndis_query_hwcaps(struct hn_softc *s } int -hn_rndis_attach(struct hn_softc *sc, int mtu) +hn_rndis_attach(struct hn_softc *sc, int mtu, int *init_done) { int error; + *init_done = 0; + /* * Initialize RNDIS. */ error = hn_rndis_init(sc); if (error) return (error); + *init_done = 1; /* * Configure NDIS offload settings. Modified: stable/11/sys/dev/hyperv/netvsc/hn_rndis.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/hn_rndis.h Mon Apr 10 04:59:44 2017 (r316673) +++ stable/11/sys/dev/hyperv/netvsc/hn_rndis.h Mon Apr 10 05:17:18 2017 (r316674) @@ -33,7 +33,7 @@ struct hn_softc; -int hn_rndis_attach(struct hn_softc *sc, int mtu); +int hn_rndis_attach(struct hn_softc *sc, int mtu, int *init_done); void hn_rndis_detach(struct hn_softc *sc); int hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags); int hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_cnt); Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Apr 10 04:59:44 2017 (r316673) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Apr 10 05:17:18 2017 (r316674) @@ -261,6 +261,7 @@ static void hn_rndis_rx_data(struct hn const void *, int); static void hn_rndis_rx_status(struct hn_softc *, const void *, int); +static void hn_rndis_init_fixat(struct hn_softc *, int); static void hn_nvs_handle_notify(struct hn_softc *, const struct vmbus_chanpkt_hdr *); @@ -328,6 +329,8 @@ static void hn_resume_mgmt(struct hn_s static void hn_suspend_mgmt_taskfunc(void *, int); static void hn_chan_drain(struct hn_softc *, struct vmbus_channel *); +static void hn_disable_rx(struct hn_softc *); +static void hn_drain_rxtx(struct hn_softc *, int); static void hn_polling(struct hn_softc *, u_int); static void hn_chan_polling(struct vmbus_channel *, u_int); @@ -2267,6 +2270,18 @@ hn_rxpkt(struct hn_rx_ring *rxr, const v /* If the VF is active, inject the packet through the VF */ ifp = rxr->hn_vf ? rxr->hn_vf : rxr->hn_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + /* + * NOTE: + * See the NOTE of hn_rndis_init_fixat(). This + * function can be reached, immediately after the + * RNDIS is initialized but before the ifnet is + * setup on the hn_attach() path; drop the unexpected + * packets. + */ + return (0); + } + if (dlen <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); if (m_new == NULL) { @@ -4711,6 +4726,27 @@ hn_synth_attachable(const struct hn_soft return (true); } +/* + * Make sure that the RX filter is zero after the successful + * RNDIS initialization. + * + * NOTE: + * Under certain conditions on certain versions of Hyper-V, + * the RNDIS rxfilter is _not_ zero on the hypervisor side + * after the successful RNDIS initialization, which breaks + * the assumption of any following code (well, it breaks the + * RNDIS API contract actually). Clear the RNDIS rxfilter + * explicitly, drain packets sneaking through, and drain the + * interrupt taskqueues scheduled due to the stealth packets. + */ +static void +hn_rndis_init_fixat(struct hn_softc *sc, int nchan) +{ + + hn_disable_rx(sc); + hn_drain_rxtx(sc, nchan); +} + static int hn_synth_attach(struct hn_softc *sc, int mtu) { @@ -4718,7 +4754,7 @@ hn_synth_attach(struct hn_softc *sc, int #define ATTACHED_RNDIS 0x0004 struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; - int error, nsubch, nchan, i; + int error, nsubch, nchan = 1, i, rndis_inited; uint32_t old_caps, attached = 0; KASSERT((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0, @@ -4753,10 +4789,11 @@ hn_synth_attach(struct hn_softc *sc, int /* * Attach RNDIS _after_ NVS is attached. */ - error = hn_rndis_attach(sc, mtu); + error = hn_rndis_attach(sc, mtu, &rndis_inited); + if (rndis_inited) + attached |= ATTACHED_RNDIS; if (error) goto failed; - attached |= ATTACHED_RNDIS; /* * Make sure capabilities are not changed. @@ -4859,14 +4896,18 @@ back: * Fixup transmission aggregation setup. */ hn_set_txagg(sc); + hn_rndis_init_fixat(sc, nchan); return (0); failed: if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { + hn_rndis_init_fixat(sc, nchan); hn_synth_detach(sc); } else { - if (attached & ATTACHED_RNDIS) + if (attached & ATTACHED_RNDIS) { + hn_rndis_init_fixat(sc, nchan); hn_rndis_detach(sc); + } if (attached & ATTACHED_NVS) hn_nvs_detach(sc); hn_chan_detach(sc, sc->hn_prichan); @@ -4946,11 +4987,56 @@ hn_chan_drain(struct hn_softc *sc, struc } static void -hn_suspend_data(struct hn_softc *sc) +hn_disable_rx(struct hn_softc *sc) +{ + + /* + * Disable RX by clearing RX filter forcefully. + */ + sc->hn_rx_filter = NDIS_PACKET_TYPE_NONE; + hn_rndis_set_rxfilter(sc, sc->hn_rx_filter); /* ignore error */ + + /* + * Give RNDIS enough time to flush all pending data packets. + */ + pause("waitrx", (200 * hz) / 1000); +} + +/* + * NOTE: + * RX/TX _must_ have been suspended/disabled, before this function + * is called. + */ +static void +hn_drain_rxtx(struct hn_softc *sc, int nchan) { struct vmbus_channel **subch = NULL; + int nsubch; + + /* + * Drain RX/TX bufrings and interrupts. + */ + nsubch = nchan - 1; + if (nsubch > 0) + subch = vmbus_subchan_get(sc->hn_prichan, nsubch); + + if (subch != NULL) { + int i; + + for (i = 0; i < nsubch; ++i) + hn_chan_drain(sc, subch[i]); + } + hn_chan_drain(sc, sc->hn_prichan); + + if (subch != NULL) + vmbus_subchan_rel(subch, nsubch); +} + +static void +hn_suspend_data(struct hn_softc *sc) +{ struct hn_tx_ring *txr; - int i, nsubch; + int i; HN_LOCK_ASSERT(sc); @@ -4978,38 +5064,21 @@ hn_suspend_data(struct hn_softc *sc) } /* - * Disable RX by clearing RX filter. + * Disable RX. */ - hn_set_rxfilter(sc, NDIS_PACKET_TYPE_NONE); + hn_disable_rx(sc); /* - * Give RNDIS enough time to flush all pending data packets. + * Drain RX/TX. */ - pause("waitrx", (200 * hz) / 1000); - - /* - * Drain RX/TX bufrings and interrupts. - */ - nsubch = sc->hn_rx_ring_inuse - 1; - if (nsubch > 0) - subch = vmbus_subchan_get(sc->hn_prichan, nsubch); - - if (subch != NULL) { - for (i = 0; i < nsubch; ++i) - hn_chan_drain(sc, subch[i]); - } - hn_chan_drain(sc, sc->hn_prichan); - - if (subch != NULL) - vmbus_subchan_rel(subch, nsubch); + hn_drain_rxtx(sc, sc->hn_rx_ring_inuse); /* * Drain any pending TX tasks. * * NOTE: - * The above hn_chan_drain() can dispatch TX tasks, so the TX - * tasks will have to be drained _after_ the above hn_chan_drain() - * calls. + * The above hn_drain_rxtx() can dispatch TX tasks, so the TX + * tasks will have to be drained _after_ the above hn_drain_rxtx(). */ for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { txr = &sc->hn_tx_ring[i]; From owner-svn-src-all@freebsd.org Mon Apr 10 06:19:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 389ECD3663F; Mon, 10 Apr 2017 06:19:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13E9EEA5; Mon, 10 Apr 2017 06:19:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3A6JAFE064552; Mon, 10 Apr 2017 06:19:10 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3A6JAIu064550; Mon, 10 Apr 2017 06:19:10 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704100619.v3A6JAIu064550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 10 Apr 2017 06:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316675 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 06:19:11 -0000 Author: bde Date: Mon Apr 10 06:19:09 2017 New Revision: 316675 URL: https://svnweb.freebsd.org/changeset/base/316675 Log: Special rendering methods for removing mouse cursors cannot be removed like I hoped, since they are needed for removing parts over the border. Continue fixing bugs in them. In the vga planar mode renderer, remove removal of the part of the image over the text window. This was hard-coded for nearly 8x16 fonts and in practice didn't remove enough for 8x8 fonts. This used the wrong attribute over cutmarked regions. The caller refreshes with the correct attribute later, so the attribute bug only caused flicker. The caller uses the same hard-coding, so the refreshes fix up all the spots with the wrong attribute, but keep missing the missed spots. This still gives trails of bits of cursors for cursor motions in the affected configurations (mainly depth 4 modes with 8x8) fonts. 8x14 fonts barely escape the problem since although the cursor is drawn as 16x16, its active part is only 9x13 and the active part fits in the hard-coded 2x2 character cell window for 8x14 fonts. 8x8 fonts need a 2x3 window. In the fb non-sparc64 renderer, the buggy image removal was buggier and was already avoided by returning before it. Remove it completely and fix nearby style bugs. It was essentially the same as for the vga planar mode renderer (obfuscated by swapping x and y). This was buggier since fb should handle more types of hardware so the hard-coding is wronger. The remaining fb image removal is also buggier. It never supported software cursors drawn into the border, and the hardware cursor is probably broken by other bugs to be fixed soon. Modified: head/sys/dev/syscons/scgfbrndr.c head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scgfbrndr.c ============================================================================== --- head/sys/dev/syscons/scgfbrndr.c Mon Apr 10 05:17:18 2017 (r316674) +++ head/sys/dev/syscons/scgfbrndr.c Mon Apr 10 06:19:09 2017 (r316675) @@ -335,28 +335,14 @@ static void gfb_mouse(scr_stat *scp, int x, int y, int on) { #ifdef __sparc64__ - vidd_putm(scp->sc->adp, x, y, mouse_pointer, - on ? 0xffffffff : 0x0, 22, 12); + vidd_putm(scp->sc->adp, x, y, mouse_pointer, + on ? 0xffffffff : 0x0, 22, 12); #else - int i, pos; - if (on) { - - /* Display the mouse pointer image... */ vidd_putm(scp->sc->adp, x, y, mouse_pointer, 0xffffffff, 16, 8); } else { - - /* - Erase the mouse cursor image by redrawing the text - underneath it... - */ - return; - pos = x*scp->xsize + y; - i = (y < scp->xsize - 1) ? 2 : 1; - (*scp->rndr->draw)(scp, pos, i, FALSE); - if (x < scp->ysize - 1) - (*scp->rndr->draw)(scp, pos + scp->xsize, i, FALSE); + /* XXX: removal is incomplete for h/w cursors and borders. */ } #endif } Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Mon Apr 10 05:17:18 2017 (r316674) +++ head/sys/dev/syscons/scvgarndr.c Mon Apr 10 06:19:09 2017 (r316675) @@ -1101,21 +1101,16 @@ remove_pxlmouse_planar(scr_stat *scp, in { vm_offset_t p; int col, row; - int pos; int line_width; int ymax; int i; - /* erase the mouse cursor image */ + /* + * The caller will remove parts of the mouse image over the text + * window better than we can do. Remove only parts over the border. + */ col = x/8 - scp->xoff; row = y/scp->font_size - scp->yoff; - pos = row*scp->xsize + col; - i = (col < scp->xsize - 1) ? 2 : 1; - (*scp->rndr->draw)(scp, pos, i, FALSE); - if (row < scp->ysize - 1) - (*scp->rndr->draw)(scp, pos + scp->xsize, i, FALSE); - - /* paint border if necessary */ line_width = scp->sc->adp->va_line_width; outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0003); /* data rotate/function select */ From owner-svn-src-all@freebsd.org Mon Apr 10 08:19:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F215D36581; Mon, 10 Apr 2017 08:19:37 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BFCD1A6; Mon, 10 Apr 2017 08:19:37 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3A8Jaxa014537; Mon, 10 Apr 2017 08:19:36 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3A8JZCh014531; Mon, 10 Apr 2017 08:19:35 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201704100819.v3A8JZCh014531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 10 Apr 2017 08:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316676 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 08:19:37 -0000 Author: smh Date: Mon Apr 10 08:19:35 2017 New Revision: 316676 URL: https://svnweb.freebsd.org/changeset/base/316676 Log: Use estimated RTT for receive buffer auto resizing instead of timestamps Switched from using timestamps to RTT estimates when performing TCP receive buffer auto resizing, as not all hosts support / enable TCP timestamps. Disabled reset of receive buffer auto scaling when not in bulk receive mode, which gives an extra 20% performance increase. Also extracted auto resizing to a common method shared between standard and fastpath modules. With this AWS S3 downloads at ~17ms latency on a 1Gbps connection jump from ~3MB/s to ~100MB/s using the default settings. Reviewed by: lstewart, gnn MFC after: 2 weeks Relnotes: Yes Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D9668 Modified: head/sys/netinet/in_kdtrace.c head/sys/netinet/in_kdtrace.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/in_kdtrace.c ============================================================================== --- head/sys/netinet/in_kdtrace.c Mon Apr 10 06:19:09 2017 (r316675) +++ head/sys/netinet/in_kdtrace.c Mon Apr 10 08:19:35 2017 (r316676) @@ -132,6 +132,14 @@ SDT_PROBE_DEFINE6_XLATE(tcp, , , state__ "void *", "void *", "int", "tcplsinfo_t *"); +SDT_PROBE_DEFINE6_XLATE(tcp, , , receive__autoresize, + "void *", "void *", + "struct tcpcb *", "csinfo_t *", + "struct mbuf *", "ipinfo_t *", + "struct tcpcb *", "tcpsinfo_t *" , + "struct tcphdr *", "tcpinfoh_t *", + "int", "int"); + SDT_PROBE_DEFINE5_XLATE(udp, , , receive, "void *", "pktinfo_t *", "struct inpcb *", "csinfo_t *", Modified: head/sys/netinet/in_kdtrace.h ============================================================================== --- head/sys/netinet/in_kdtrace.h Mon Apr 10 06:19:09 2017 (r316675) +++ head/sys/netinet/in_kdtrace.h Mon Apr 10 08:19:35 2017 (r316676) @@ -65,6 +65,7 @@ SDT_PROBE_DECLARE(tcp, , , debug__input) SDT_PROBE_DECLARE(tcp, , , debug__output); SDT_PROBE_DECLARE(tcp, , , debug__user); SDT_PROBE_DECLARE(tcp, , , debug__drop); +SDT_PROBE_DECLARE(tcp, , , receive__autoresize); SDT_PROBE_DECLARE(udp, , , receive); SDT_PROBE_DECLARE(udp, , , send); Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Apr 10 06:19:09 2017 (r316675) +++ head/sys/netinet/tcp_input.c Mon Apr 10 08:19:35 2017 (r316676) @@ -1486,6 +1486,68 @@ drop: return (IPPROTO_DONE); } +/* + * Automatic sizing of receive socket buffer. Often the send + * buffer size is not optimally adjusted to the actual network + * conditions at hand (delay bandwidth product). Setting the + * buffer size too small limits throughput on links with high + * bandwidth and high delay (eg. trans-continental/oceanic links). + * + * On the receive side the socket buffer memory is only rarely + * used to any significant extent. This allows us to be much + * more aggressive in scaling the receive socket buffer. For + * the case that the buffer space is actually used to a large + * extent and we run out of kernel memory we can simply drop + * the new segments; TCP on the sender will just retransmit it + * later. Setting the buffer size too big may only consume too + * much kernel memory if the application doesn't read() from + * the socket or packet loss or reordering makes use of the + * reassembly queue. + * + * The criteria to step up the receive buffer one notch are: + * 1. Application has not set receive buffer size with + * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. + * 2. the number of bytes received during the time it takes + * one timestamp to be reflected back to us (the RTT); + * 3. received bytes per RTT is within seven eighth of the + * current socket buffer size; + * 4. receive buffer size has not hit maximal automatic size; + * + * This algorithm does one step per RTT at most and only if + * we receive a bulk stream w/o packet losses or reorderings. + * Shrinking the buffer during idle times is not necessary as + * it doesn't consume any memory when idle. + * + * TODO: Only step up if the application is actually serving + * the buffer to better manage the socket buffer resources. + */ +int +tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, struct socket *so, + struct tcpcb *tp, int tlen) +{ + int newsize = 0; + + if (V_tcp_do_autorcvbuf && (so->so_rcv.sb_flags & SB_AUTOSIZE) && + tp->t_srtt != 0 && tp->rfbuf_ts != 0 && + TCP_TS_TO_TICKS(tcp_ts_getticks() - tp->rfbuf_ts) > + (tp->t_srtt >> TCP_RTT_SHIFT)) { + if (tp->rfbuf_cnt > (so->so_rcv.sb_hiwat / 8 * 7) && + so->so_rcv.sb_hiwat < V_tcp_autorcvbuf_max) { + newsize = min(so->so_rcv.sb_hiwat + + V_tcp_autorcvbuf_inc, V_tcp_autorcvbuf_max); + } + TCP_PROBE6(receive__autoresize, NULL, tp, m, tp, th, newsize); + + /* Start over with next RTT. */ + tp->rfbuf_ts = 0; + tp->rfbuf_cnt = 0; + } else { + tp->rfbuf_cnt += tlen; /* add up */ + } + + return (newsize); +} + void tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos, @@ -1849,62 +1911,7 @@ tcp_do_segment(struct mbuf *m, struct tc #endif TCP_PROBE3(debug__input, tp, th, m); - /* - * Automatic sizing of receive socket buffer. Often the send - * buffer size is not optimally adjusted to the actual network - * conditions at hand (delay bandwidth product). Setting the - * buffer size too small limits throughput on links with high - * bandwidth and high delay (eg. trans-continental/oceanic links). - * - * On the receive side the socket buffer memory is only rarely - * used to any significant extent. This allows us to be much - * more aggressive in scaling the receive socket buffer. For - * the case that the buffer space is actually used to a large - * extent and we run out of kernel memory we can simply drop - * the new segments; TCP on the sender will just retransmit it - * later. Setting the buffer size too big may only consume too - * much kernel memory if the application doesn't read() from - * the socket or packet loss or reordering makes use of the - * reassembly queue. - * - * The criteria to step up the receive buffer one notch are: - * 1. Application has not set receive buffer size with - * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. - * 2. the number of bytes received during the time it takes - * one timestamp to be reflected back to us (the RTT); - * 3. received bytes per RTT is within seven eighth of the - * current socket buffer size; - * 4. receive buffer size has not hit maximal automatic size; - * - * This algorithm does one step per RTT at most and only if - * we receive a bulk stream w/o packet losses or reorderings. - * Shrinking the buffer during idle times is not necessary as - * it doesn't consume any memory when idle. - * - * TODO: Only step up if the application is actually serving - * the buffer to better manage the socket buffer resources. - */ - if (V_tcp_do_autorcvbuf && - (to.to_flags & TOF_TS) && - to.to_tsecr && - (so->so_rcv.sb_flags & SB_AUTOSIZE)) { - if (TSTMP_GT(to.to_tsecr, tp->rfbuf_ts) && - to.to_tsecr - tp->rfbuf_ts < hz) { - if (tp->rfbuf_cnt > - (so->so_rcv.sb_hiwat / 8 * 7) && - so->so_rcv.sb_hiwat < - V_tcp_autorcvbuf_max) { - newsize = - min(so->so_rcv.sb_hiwat + - V_tcp_autorcvbuf_inc, - V_tcp_autorcvbuf_max); - } - /* Start over with next RTT. */ - tp->rfbuf_ts = 0; - tp->rfbuf_cnt = 0; - } else - tp->rfbuf_cnt += tlen; /* add up */ - } + newsize = tcp_autorcvbuf(m, th, so, tp, tlen); /* Add data to socket buffer. */ SOCKBUF_LOCK(&so->so_rcv); @@ -1945,10 +1952,6 @@ tcp_do_segment(struct mbuf *m, struct tc win = 0; tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); - /* Reset receive buffer auto scaling when not in bulk receive mode. */ - tp->rfbuf_ts = 0; - tp->rfbuf_cnt = 0; - switch (tp->t_state) { /* Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Apr 10 06:19:09 2017 (r316675) +++ head/sys/netinet/tcp_output.c Mon Apr 10 08:19:35 2017 (r316676) @@ -831,11 +831,13 @@ send: to.to_tsval = tcp_ts_getticks() + tp->ts_offset; to.to_tsecr = tp->ts_recent; to.to_flags |= TOF_TS; - /* Set receive buffer autosizing timestamp. */ - if (tp->rfbuf_ts == 0 && - (so->so_rcv.sb_flags & SB_AUTOSIZE)) - tp->rfbuf_ts = tcp_ts_getticks(); } + + /* Set receive buffer autosizing timestamp. */ + if (tp->rfbuf_ts == 0 && + (so->so_rcv.sb_flags & SB_AUTOSIZE)) + tp->rfbuf_ts = tcp_ts_getticks(); + /* Selective ACK's. */ if (tp->t_flags & TF_SACK_PERMIT) { if (flags & TH_SYN) Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Mon Apr 10 06:19:09 2017 (r316675) +++ head/sys/netinet/tcp_stacks/fastpath.c Mon Apr 10 08:19:35 2017 (r316676) @@ -399,62 +399,8 @@ tcp_do_fastnewdata(struct mbuf *m, struc (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif TCP_PROBE3(debug__input, tp, th, m); - /* - * Automatic sizing of receive socket buffer. Often the send - * buffer size is not optimally adjusted to the actual network - * conditions at hand (delay bandwidth product). Setting the - * buffer size too small limits throughput on links with high - * bandwidth and high delay (eg. trans-continental/oceanic links). - * - * On the receive side the socket buffer memory is only rarely - * used to any significant extent. This allows us to be much - * more aggressive in scaling the receive socket buffer. For - * the case that the buffer space is actually used to a large - * extent and we run out of kernel memory we can simply drop - * the new segments; TCP on the sender will just retransmit it - * later. Setting the buffer size too big may only consume too - * much kernel memory if the application doesn't read() from - * the socket or packet loss or reordering makes use of the - * reassembly queue. - * - * The criteria to step up the receive buffer one notch are: - * 1. Application has not set receive buffer size with - * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. - * 2. the number of bytes received during the time it takes - * one timestamp to be reflected back to us (the RTT); - * 3. received bytes per RTT is within seven eighth of the - * current socket buffer size; - * 4. receive buffer size has not hit maximal automatic size; - * - * This algorithm does one step per RTT at most and only if - * we receive a bulk stream w/o packet losses or reorderings. - * Shrinking the buffer during idle times is not necessary as - * it doesn't consume any memory when idle. - * - * TODO: Only step up if the application is actually serving - * the buffer to better manage the socket buffer resources. - */ - if (V_tcp_do_autorcvbuf && - (to->to_flags & TOF_TS) && - to->to_tsecr && - (so->so_rcv.sb_flags & SB_AUTOSIZE)) { - if (TSTMP_GT(to->to_tsecr, tp->rfbuf_ts) && - to->to_tsecr - tp->rfbuf_ts < hz) { - if (tp->rfbuf_cnt > - (so->so_rcv.sb_hiwat / 8 * 7) && - so->so_rcv.sb_hiwat < - V_tcp_autorcvbuf_max) { - newsize = - min(so->so_rcv.sb_hiwat + - V_tcp_autorcvbuf_inc, - V_tcp_autorcvbuf_max); - } - /* Start over with next RTT. */ - tp->rfbuf_ts = 0; - tp->rfbuf_cnt = 0; - } else - tp->rfbuf_cnt += tlen; /* add up */ - } + + newsize = tcp_autorcvbuf(m, th, so, tp, tlen); /* Add data to socket buffer. */ SOCKBUF_LOCK(&so->so_rcv); @@ -532,10 +478,6 @@ tcp_do_slowpath(struct mbuf *m, struct t win = 0; tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); - /* Reset receive buffer auto scaling when not in bulk receive mode. */ - tp->rfbuf_ts = 0; - tp->rfbuf_cnt = 0; - switch (tp->t_state) { /* Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Apr 10 06:19:09 2017 (r316675) +++ head/sys/netinet/tcp_var.h Mon Apr 10 08:19:35 2017 (r316676) @@ -778,6 +778,8 @@ void hhook_run_tcp_est_in(struct tcpcb * #endif int tcp_input(struct mbuf **, int *, int); +int tcp_autorcvbuf(struct mbuf *, struct tcphdr *, struct socket *, + struct tcpcb *, int); void tcp_do_segment(struct mbuf *, struct tcphdr *, struct socket *, struct tcpcb *, int, int, uint8_t, int); From owner-svn-src-all@freebsd.org Mon Apr 10 10:38:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06937D35168; Mon, 10 Apr 2017 10:38:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDA40A15; Mon, 10 Apr 2017 10:38:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AAcCBm073303; Mon, 10 Apr 2017 10:38:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AAcCYc073301; Mon, 10 Apr 2017 10:38:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704101038.v3AAcCYc073301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 10 Apr 2017 10:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316677 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 10:38:14 -0000 Author: mav Date: Mon Apr 10 10:38:12 2017 New Revision: 316677 URL: https://svnweb.freebsd.org/changeset/base/316677 Log: Do not register in CTL portal groups without portals. From config synthax point of view such portal groups are not incorrect, but they are useless since can not receive any connection. And since CTL port resource is very limited, it is good to save it. MFC after: 2 weeks Modified: head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Mon Apr 10 08:19:35 2017 (r316676) +++ head/usr.sbin/ctld/ctld.c Mon Apr 10 10:38:12 2017 (r316677) @@ -1237,7 +1237,6 @@ port_new(struct conf *conf, struct targe port->p_target = target; TAILQ_INSERT_TAIL(&pg->pg_ports, port, p_pgs); port->p_portal_group = pg; - port->p_foreign = pg->pg_foreign; return (port); } @@ -1310,6 +1309,19 @@ port_delete(struct port *port) free(port); } +int +port_is_dummy(struct port *port) +{ + + if (port->p_portal_group) { + if (port->p_portal_group->pg_foreign) + return (1); + if (TAILQ_EMPTY(&port->p_portal_group->pg_portals)) + return (1); + } + return (0); +} + struct target * target_new(struct conf *conf, const char *name) { @@ -1887,10 +1899,10 @@ conf_apply(struct conf *oldconf, struct * and missing in the new one. */ TAILQ_FOREACH_SAFE(oldport, &oldconf->conf_ports, p_next, tmpport) { - if (oldport->p_foreign) + if (port_is_dummy(oldport)) continue; newport = port_find(newconf, oldport->p_name); - if (newport != NULL && !newport->p_foreign) + if (newport != NULL && !port_is_dummy(newport)) continue; log_debugx("removing port \"%s\"", oldport->p_name); error = kernel_port_remove(oldport); @@ -2010,11 +2022,11 @@ conf_apply(struct conf *oldconf, struct * Now add new ports or modify existing ones. */ TAILQ_FOREACH(newport, &newconf->conf_ports, p_next) { - if (newport->p_foreign) + if (port_is_dummy(newport)) continue; oldport = port_find(oldconf, newport->p_name); - if (oldport == NULL || oldport->p_foreign) { + if (oldport == NULL || port_is_dummy(oldport)) { log_debugx("adding port \"%s\"", newport->p_name); error = kernel_port_add(newport); } else { Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Mon Apr 10 08:19:35 2017 (r316676) +++ head/usr.sbin/ctld/ctld.h Mon Apr 10 10:38:12 2017 (r316677) @@ -149,7 +149,6 @@ struct port { struct portal_group *p_portal_group; struct pport *p_pport; struct target *p_target; - int p_foreign; uint32_t p_ctl_port; }; @@ -373,6 +372,7 @@ struct port *port_find(const struct con struct port *port_find_in_pg(const struct portal_group *pg, const char *target); void port_delete(struct port *port); +int port_is_dummy(struct port *port); struct target *target_new(struct conf *conf, const char *name); void target_delete(struct target *target); From owner-svn-src-all@freebsd.org Mon Apr 10 12:36:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33889D36446; Mon, 10 Apr 2017 12:36:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9E0F188; Mon, 10 Apr 2017 12:35:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3ACZx4G025365; Mon, 10 Apr 2017 12:35:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3ACZwU2025362; Mon, 10 Apr 2017 12:35:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704101235.v3ACZwU2025362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 10 Apr 2017 12:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316678 - in head/sys/arm: conf freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 12:36:00 -0000 Author: andrew Date: Mon Apr 10 12:35:58 2017 New Revision: 316678 URL: https://svnweb.freebsd.org/changeset/base/316678 Log: Port the IMX6 kernel configuration to use MULTIDELAY. This will help adding the i.MX series of SoCs to the armv6 GENERIC kernel. This uses updated times from ian@. Reviewed by: ian Sponsored by: ABT Systems Ltd Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/imx6_machdep.c head/sys/arm/freescale/imx/imx_gpt.c Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Mon Apr 10 10:38:12 2017 (r316677) +++ head/sys/arm/conf/IMX6 Mon Apr 10 12:35:58 2017 (r316678) @@ -32,6 +32,7 @@ options INCLUDE_CONFIG_FILE # Include t options PLATFORM options PLATFORM_SMP options SMP # Enable multiple cores +options MULTIDELAY # NFS root from boopt/dhcp #options BOOTP Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Mon Apr 10 10:38:12 2017 (r316677) +++ head/sys/arm/freescale/imx/imx6_machdep.c Mon Apr 10 12:35:58 2017 (r316678) @@ -324,7 +324,7 @@ static platform_method_t imx6_methods[] PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF2(imx6, imx6s, "i.MX6 Solo", 0, "fsl,imx6s", 0); -FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6dl", 0); -FDT_PLATFORM_DEF2(imx6, imx6q, "i.MX6 Quad", 0, "fsl,imx6q", 0); -FDT_PLATFORM_DEF2(imx6, imx6ul, "i.MX6 UltraLite", 0, "fsl,imx6ul", 0); +FDT_PLATFORM_DEF2(imx6, imx6s, "i.MX6 Solo", 0, "fsl,imx6s", 80); +FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6dl", 80); +FDT_PLATFORM_DEF2(imx6, imx6q, "i.MX6 Quad", 0, "fsl,imx6q", 80); +FDT_PLATFORM_DEF2(imx6, imx6ul, "i.MX6 UltraLite", 0, "fsl,imx6ul", 67); Modified: head/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpt.c Mon Apr 10 10:38:12 2017 (r316677) +++ head/sys/arm/freescale/imx/imx_gpt.c Mon Apr 10 12:35:58 2017 (r316678) @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef MULTIDELAY +#include /* For arm_set_delay */ +#endif #include #include @@ -62,6 +65,8 @@ static int imx_gpt_timer_start(struct ev sbintime_t); static int imx_gpt_timer_stop(struct eventtimer *); +static void imx_gpt_do_delay(int, void *); + static int imx_gpt_intr(void *); static int imx_gpt_probe(device_t); static int imx_gpt_attach(device_t); @@ -87,6 +92,7 @@ struct imx_gpt_softc { struct eventtimer et; }; +#ifndef MULTIDELAY /* Global softc pointer for use in DELAY(). */ static struct imx_gpt_softc *imx_gpt_sc; @@ -98,6 +104,7 @@ static struct imx_gpt_softc *imx_gpt_sc; * we're attached the delay loop switches to using the timer hardware. */ static const int imx_gpt_delay_count = 78; +#endif /* Try to divide down an available fast clock to this frequency. */ #define TARGET_FREQUENCY 1000000000 @@ -275,8 +282,13 @@ imx_gpt_attach(device_t dev) tc_init(&imx_gpt_timecounter); /* If this is the first unit, store the softc for use in DELAY. */ - if (device_get_unit(dev) == 0) - imx_gpt_sc = sc; + if (device_get_unit(dev) == 0) { +#ifdef MULTIDELAY + arm_set_delay(imx_gpt_do_delay, sc); +#else + imx_gpt_sc = sc; +#endif + } return (0); } @@ -396,19 +408,12 @@ static devclass_t imx_gpt_devclass; EARLY_DRIVER_MODULE(imx_gpt, simplebus, imx_gpt_driver, imx_gpt_devclass, 0, 0, BUS_PASS_TIMER); -void -DELAY(int usec) +static void +imx_gpt_do_delay(int usec, void *arg) { + struct imx_gpt_softc *sc = arg; uint64_t curcnt, endcnt, startcnt, ticks; - /* If the timer hardware is not accessible, just use a loop. */ - if (imx_gpt_sc == NULL) { - while (usec-- > 0) - for (ticks = 0; ticks < imx_gpt_delay_count; ++ticks) - cpufunc_nullop(); - return; - } - /* * Calculate the tick count with 64-bit values so that it works for any * clock frequency. Loop until the hardware count reaches start+ticks. @@ -417,12 +422,30 @@ DELAY(int usec) * that doing this on each loop iteration is inefficient -- we're trying * to waste time here. */ - ticks = 1 + ((uint64_t)usec * imx_gpt_sc->clkfreq) / 1000000; - curcnt = startcnt = READ4(imx_gpt_sc, IMX_GPT_CNT); + ticks = 1 + ((uint64_t)usec * sc->clkfreq) / 1000000; + curcnt = startcnt = READ4(sc, IMX_GPT_CNT); endcnt = startcnt + ticks; while (curcnt < endcnt) { - curcnt = READ4(imx_gpt_sc, IMX_GPT_CNT); + curcnt = READ4(sc, IMX_GPT_CNT); if (curcnt < startcnt) curcnt += 1ULL << 32; } } + +#ifndef MULTIDELAY +void +DELAY(int usec) +{ + uint64_t ticks; + + /* If the timer hardware is not accessible, just use a loop. */ + if (imx_gpt_sc == NULL) { + while (usec-- > 0) + for (ticks = 0; ticks < imx_gpt_delay_count; ++ticks) + cpufunc_nullop(); + return; + } else + imx_gpt_do_delay(usec, imx_gpt_sc); + +} +#endif From owner-svn-src-all@freebsd.org Mon Apr 10 13:20:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4162DD379A2; Mon, 10 Apr 2017 13:20:33 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09DF313AA; Mon, 10 Apr 2017 13:20:32 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0DE241FE021; Mon, 10 Apr 2017 15:18:56 +0200 (CEST) Subject: Re: svn commit: r316665 - in head/sys: compat/linuxkpi/common/src contrib/ck/include contrib/ck/src To: Olivier Houchard , Conrad Meyer References: <201704092102.v39L25oh040066@repo.freebsd.org> <20170409230840.GA90254@ci0.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <6e177da0-2367-c5b1-cb0e-bd8535cdf53e@selasky.org> Date: Mon, 10 Apr 2017 15:18:37 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170409230840.GA90254@ci0.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 13:20:33 -0000 On 04/10/17 01:08, Olivier Houchard wrote: > On Sun, Apr 09, 2017 at 03:49:57PM -0700, Conrad Meyer wrote: >> On Sun, Apr 9, 2017 at 2:02 PM, Olivier Houchard wrote: >>> Author: cognet >>> Date: Sun Apr 9 21:02:05 2017 >>> New Revision: 316665 >>> URL: https://svnweb.freebsd.org/changeset/base/316665 >>> >>> Log: >>> Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32 >>> This brings us changes we needed in ck_epoch. >> >> Out of curiosity ??? what changes did we need, and why? >> > > Hi Conrad, > > What ck_epoch lacked was any way to do priority propagation, which led > to some nice deadlocks to the linuxkpi folks. > > Regards, > > Olivier > > Hi, There will be some updates to the RCU implementation soon, using the new APIs provided by the CK. Thank you! --HPS From owner-svn-src-all@freebsd.org Mon Apr 10 14:43:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E91AD376B3 for ; Mon, 10 Apr 2017 14:43:21 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0314BEDB for ; Mon, 10 Apr 2017 14:43:21 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io0-x22a.google.com with SMTP id r16so43473395ioi.2 for ; Mon, 10 Apr 2017 07:43:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to:cc; bh=n0TSvGB58HLpA+Df/BNlBbeuE0Bc1MwzXZJGKpJjxVI=; b=kyLgazzqVn3q1AaQturl7hNwV1rnSGuud6BDDRxS5US+lRJMUhn2947ZHIDGrOigEF o6C6RTZ9rt7LmKlko5jmqfQEaO65ne3AuOkkSbQDejmWB1ENY0dLtvWh3krDjJnNnkH8 oc9WwvwWmNydjCXkowIxNPNAO6TBxR1UCav+KLcDcjDGrfqok/7LbGaC+ABsxeTfn6D9 36sROrmJ0XDP20iiSrZgL/94l8rORpSeQlXa56S3df4WmkRVmyKSiOfikEu6LIlASdXr OuLf3SOKM8Bg2hX9a/IgFnZP4WUr8bxVoXoMCqm5UR1vp2s8YBfWiCab3yY7+VeS89o8 Usiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:cc; bh=n0TSvGB58HLpA+Df/BNlBbeuE0Bc1MwzXZJGKpJjxVI=; b=Jf0AzvcRmcgzGoP/+Wjw6BLw/p8z2cXD/x16zgS+ikYBMGYu303dkzZWTedVkkemsO Aulhz4JFrZ2j+I/0OSpmQbHnGd07UmqhzL/OMrRM2Ehnm9BUIjCf0iUv3ajosrxoWXNd 1o6nfUgeFHPYKGxFEaDKEKBncUeZmMdxTlmP+6zjpl1AwLWlwR7+Pf2XQwi9DI95NBkQ zOd4WF3jEpFXImLxZYb3jxxrASimoTChib6JNS4P4AHlmvp8wbAK7F2YcNujqdk2f3sl aS0YnH84wct2e31QRN+Y454/73byxyGT2Rbf0jd6Uutf8aZX81IgoNBzfus8vZfrythW XZdg== X-Gm-Message-State: AN3rC/462xRVdSN6NVUfhbXcdcW53b37XubBBBTgfMjRmihMh0u/OzDKKN2Puh4sjgjPv7HlktyEIVcL5Yr+b286 X-Received: by 10.36.47.78 with SMTP id j75mr12342902itj.72.1491835398795; Mon, 10 Apr 2017 07:43:18 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.112.210 with HTTP; Mon, 10 Apr 2017 07:43:18 -0700 (PDT) From: Maxim Sobolev Date: Mon, 10 Apr 2017 07:43:18 -0700 X-Google-Sender-Auth: g-9ZBlkpvRCQMJ6HOriztZACAMM Message-ID: Subject: On shutting down UDP socket [Re: svn commit: r285910 - in head: lib/libc/sys sys/kern sys/sys] To: Ed Schouten Cc: Alexander Kabaev , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, mjg@freebsd.org, gnn@freebsd.org, network@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 14:43:21 -0000 Hi Guys, I am sorry to bring this old thread up, but I think Ed's comparison with other OSes here and in the relevant differential was not entirely correct. What linux does (tested with 4.4.0) when UDP socket is shut down is actually shutting down receiving end, so any threads that are blocked in recv() on that socket return. Still shutdown() system call itself returns ENOTCONN. FreeBSD on the other hand does not do anything for the socket, so that the threads just hang. I am pretty sure there are at least some software out there that relies on that behavior, at least in our case we do. Bumped into this after upgrading to the 11.0. Therefore, I am curious about possibility to make our behavior match that of Linux's, so we are not the odd one with regards to this, that is return an error but still shutdown the socket? Small test case is attached. Both FreeBSD 10.3 and Linux 4.4.0 pass (albeit Linux's shutdown() returns with an error), FreeBSD 11.0 fails. -Max On Sun, Aug 9, 2015 at 6:08 AM, Ed Schouten wrote: > Hi Alexander, > > 2015-08-09 14:55 GMT+02:00 Alexander Kabaev : > > On Sun, 9 Aug 2015 09:37:13 +0200 > > It most definitely does work, this is what I have done to get my > > network scripts work again. I wonder if there are other means of > > restricting raw sockets that can be used to achieve the result > > authors of rtsold had hoped or? > > Yes, there sure are. We could for example call cap_rights_limit() on > the socket and whitelist the exacty set of actions that the program > needs. > > That said, it wouldn't make a difference in the end. It looks like > rtsol/rtsold don't seem to drop any privileges or switch credentials > after startup, assuming I haven't overlooked anything. Even if we were > to restrict the raw socket, the process could always open a new one > later on. > > I think it would make sense for now to just commit the patch that I > proposed. Will push it into the tree tomorrow. > > Thanks, > -- > Ed Schouten > Nuxi, 's-Hertogenbosch, the Netherlands > KvK/VAT number: 62051717 > > From owner-svn-src-all@freebsd.org Mon Apr 10 14:51:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B74AED37921; Mon, 10 Apr 2017 14:51:42 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8947F7F6; Mon, 10 Apr 2017 14:51:42 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (106-68-100-234.dyn.iinet.net.au [106.68.100.234]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v3AEpZcb050412 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 10 Apr 2017 07:51:39 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r316676 - in head/sys/netinet: . tcp_stacks To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704100819.v3A8JZCh014531@repo.freebsd.org> From: Julian Elischer Message-ID: <5dc195ac-d78d-1c7c-10dd-a1e21f503330@freebsd.org> Date: Mon, 10 Apr 2017 22:51:29 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201704100819.v3A8JZCh014531@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 14:51:42 -0000 If possible MFC to 10 too would be nice.. thanks On 10/4/17 4:19 pm, Steven Hartland wrote: > Author: smh > Date: Mon Apr 10 08:19:35 2017 > New Revision: 316676 > URL: https://svnweb.freebsd.org/changeset/base/316676 > > Log: > Use estimated RTT for receive buffer auto resizing instead of timestamps > > Switched from using timestamps to RTT estimates when performing TCP receive > buffer auto resizing, as not all hosts support / enable TCP timestamps. > > Disabled reset of receive buffer auto scaling when not in bulk receive mode, > which gives an extra 20% performance increase. > > Also extracted auto resizing to a common method shared between standard and > fastpath modules. > > With this AWS S3 downloads at ~17ms latency on a 1Gbps connection jump from > ~3MB/s to ~100MB/s using the default settings. > > Reviewed by: lstewart, gnn > MFC after: 2 weeks > Relnotes: Yes > Sponsored by: Multiplay > Differential Revision: https://reviews.freebsd.org/D9668 > > Modified: > head/sys/netinet/in_kdtrace.c > head/sys/netinet/in_kdtrace.h > head/sys/netinet/tcp_input.c > head/sys/netinet/tcp_output.c > head/sys/netinet/tcp_stacks/fastpath.c > head/sys/netinet/tcp_var.h > > Modified: head/sys/netinet/in_kdtrace.c > ============================================================================== > --- head/sys/netinet/in_kdtrace.c Mon Apr 10 06:19:09 2017 (r316675) > +++ head/sys/netinet/in_kdtrace.c Mon Apr 10 08:19:35 2017 (r316676) > @@ -132,6 +132,14 @@ SDT_PROBE_DEFINE6_XLATE(tcp, , , state__ > "void *", "void *", > "int", "tcplsinfo_t *"); > > +SDT_PROBE_DEFINE6_XLATE(tcp, , , receive__autoresize, > + "void *", "void *", > + "struct tcpcb *", "csinfo_t *", > + "struct mbuf *", "ipinfo_t *", > + "struct tcpcb *", "tcpsinfo_t *" , > + "struct tcphdr *", "tcpinfoh_t *", > + "int", "int"); > + > SDT_PROBE_DEFINE5_XLATE(udp, , , receive, > "void *", "pktinfo_t *", > "struct inpcb *", "csinfo_t *", > > Modified: head/sys/netinet/in_kdtrace.h > ============================================================================== > --- head/sys/netinet/in_kdtrace.h Mon Apr 10 06:19:09 2017 (r316675) > +++ head/sys/netinet/in_kdtrace.h Mon Apr 10 08:19:35 2017 (r316676) > @@ -65,6 +65,7 @@ SDT_PROBE_DECLARE(tcp, , , debug__input) > SDT_PROBE_DECLARE(tcp, , , debug__output); > SDT_PROBE_DECLARE(tcp, , , debug__user); > SDT_PROBE_DECLARE(tcp, , , debug__drop); > +SDT_PROBE_DECLARE(tcp, , , receive__autoresize); > > SDT_PROBE_DECLARE(udp, , , receive); > SDT_PROBE_DECLARE(udp, , , send); > > Modified: head/sys/netinet/tcp_input.c > ============================================================================== > --- head/sys/netinet/tcp_input.c Mon Apr 10 06:19:09 2017 (r316675) > +++ head/sys/netinet/tcp_input.c Mon Apr 10 08:19:35 2017 (r316676) > @@ -1486,6 +1486,68 @@ drop: > return (IPPROTO_DONE); > } > > +/* > + * Automatic sizing of receive socket buffer. Often the send > + * buffer size is not optimally adjusted to the actual network > + * conditions at hand (delay bandwidth product). Setting the > + * buffer size too small limits throughput on links with high > + * bandwidth and high delay (eg. trans-continental/oceanic links). > + * > + * On the receive side the socket buffer memory is only rarely > + * used to any significant extent. This allows us to be much > + * more aggressive in scaling the receive socket buffer. For > + * the case that the buffer space is actually used to a large > + * extent and we run out of kernel memory we can simply drop > + * the new segments; TCP on the sender will just retransmit it > + * later. Setting the buffer size too big may only consume too > + * much kernel memory if the application doesn't read() from > + * the socket or packet loss or reordering makes use of the > + * reassembly queue. > + * > + * The criteria to step up the receive buffer one notch are: > + * 1. Application has not set receive buffer size with > + * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. > + * 2. the number of bytes received during the time it takes > + * one timestamp to be reflected back to us (the RTT); > + * 3. received bytes per RTT is within seven eighth of the > + * current socket buffer size; > + * 4. receive buffer size has not hit maximal automatic size; > + * > + * This algorithm does one step per RTT at most and only if > + * we receive a bulk stream w/o packet losses or reorderings. > + * Shrinking the buffer during idle times is not necessary as > + * it doesn't consume any memory when idle. > + * > + * TODO: Only step up if the application is actually serving > + * the buffer to better manage the socket buffer resources. > + */ > +int > +tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, struct socket *so, > + struct tcpcb *tp, int tlen) > +{ > + int newsize = 0; > + > + if (V_tcp_do_autorcvbuf && (so->so_rcv.sb_flags & SB_AUTOSIZE) && > + tp->t_srtt != 0 && tp->rfbuf_ts != 0 && > + TCP_TS_TO_TICKS(tcp_ts_getticks() - tp->rfbuf_ts) > > + (tp->t_srtt >> TCP_RTT_SHIFT)) { > + if (tp->rfbuf_cnt > (so->so_rcv.sb_hiwat / 8 * 7) && > + so->so_rcv.sb_hiwat < V_tcp_autorcvbuf_max) { > + newsize = min(so->so_rcv.sb_hiwat + > + V_tcp_autorcvbuf_inc, V_tcp_autorcvbuf_max); > + } > + TCP_PROBE6(receive__autoresize, NULL, tp, m, tp, th, newsize); > + > + /* Start over with next RTT. */ > + tp->rfbuf_ts = 0; > + tp->rfbuf_cnt = 0; > + } else { > + tp->rfbuf_cnt += tlen; /* add up */ > + } > + > + return (newsize); > +} > + > void > tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, > struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos, > @@ -1849,62 +1911,7 @@ tcp_do_segment(struct mbuf *m, struct tc > #endif > TCP_PROBE3(debug__input, tp, th, m); > > - /* > - * Automatic sizing of receive socket buffer. Often the send > - * buffer size is not optimally adjusted to the actual network > - * conditions at hand (delay bandwidth product). Setting the > - * buffer size too small limits throughput on links with high > - * bandwidth and high delay (eg. trans-continental/oceanic links). > - * > - * On the receive side the socket buffer memory is only rarely > - * used to any significant extent. This allows us to be much > - * more aggressive in scaling the receive socket buffer. For > - * the case that the buffer space is actually used to a large > - * extent and we run out of kernel memory we can simply drop > - * the new segments; TCP on the sender will just retransmit it > - * later. Setting the buffer size too big may only consume too > - * much kernel memory if the application doesn't read() from > - * the socket or packet loss or reordering makes use of the > - * reassembly queue. > - * > - * The criteria to step up the receive buffer one notch are: > - * 1. Application has not set receive buffer size with > - * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. > - * 2. the number of bytes received during the time it takes > - * one timestamp to be reflected back to us (the RTT); > - * 3. received bytes per RTT is within seven eighth of the > - * current socket buffer size; > - * 4. receive buffer size has not hit maximal automatic size; > - * > - * This algorithm does one step per RTT at most and only if > - * we receive a bulk stream w/o packet losses or reorderings. > - * Shrinking the buffer during idle times is not necessary as > - * it doesn't consume any memory when idle. > - * > - * TODO: Only step up if the application is actually serving > - * the buffer to better manage the socket buffer resources. > - */ > - if (V_tcp_do_autorcvbuf && > - (to.to_flags & TOF_TS) && > - to.to_tsecr && > - (so->so_rcv.sb_flags & SB_AUTOSIZE)) { > - if (TSTMP_GT(to.to_tsecr, tp->rfbuf_ts) && > - to.to_tsecr - tp->rfbuf_ts < hz) { > - if (tp->rfbuf_cnt > > - (so->so_rcv.sb_hiwat / 8 * 7) && > - so->so_rcv.sb_hiwat < > - V_tcp_autorcvbuf_max) { > - newsize = > - min(so->so_rcv.sb_hiwat + > - V_tcp_autorcvbuf_inc, > - V_tcp_autorcvbuf_max); > - } > - /* Start over with next RTT. */ > - tp->rfbuf_ts = 0; > - tp->rfbuf_cnt = 0; > - } else > - tp->rfbuf_cnt += tlen; /* add up */ > - } > + newsize = tcp_autorcvbuf(m, th, so, tp, tlen); > > /* Add data to socket buffer. */ > SOCKBUF_LOCK(&so->so_rcv); > @@ -1945,10 +1952,6 @@ tcp_do_segment(struct mbuf *m, struct tc > win = 0; > tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); > > - /* Reset receive buffer auto scaling when not in bulk receive mode. */ > - tp->rfbuf_ts = 0; > - tp->rfbuf_cnt = 0; > - > switch (tp->t_state) { > > /* > > Modified: head/sys/netinet/tcp_output.c > ============================================================================== > --- head/sys/netinet/tcp_output.c Mon Apr 10 06:19:09 2017 (r316675) > +++ head/sys/netinet/tcp_output.c Mon Apr 10 08:19:35 2017 (r316676) > @@ -831,11 +831,13 @@ send: > to.to_tsval = tcp_ts_getticks() + tp->ts_offset; > to.to_tsecr = tp->ts_recent; > to.to_flags |= TOF_TS; > - /* Set receive buffer autosizing timestamp. */ > - if (tp->rfbuf_ts == 0 && > - (so->so_rcv.sb_flags & SB_AUTOSIZE)) > - tp->rfbuf_ts = tcp_ts_getticks(); > } > + > + /* Set receive buffer autosizing timestamp. */ > + if (tp->rfbuf_ts == 0 && > + (so->so_rcv.sb_flags & SB_AUTOSIZE)) > + tp->rfbuf_ts = tcp_ts_getticks(); > + > /* Selective ACK's. */ > if (tp->t_flags & TF_SACK_PERMIT) { > if (flags & TH_SYN) > > Modified: head/sys/netinet/tcp_stacks/fastpath.c > ============================================================================== > --- head/sys/netinet/tcp_stacks/fastpath.c Mon Apr 10 06:19:09 2017 (r316675) > +++ head/sys/netinet/tcp_stacks/fastpath.c Mon Apr 10 08:19:35 2017 (r316676) > @@ -399,62 +399,8 @@ tcp_do_fastnewdata(struct mbuf *m, struc > (void *)tcp_saveipgen, &tcp_savetcp, 0); > #endif > TCP_PROBE3(debug__input, tp, th, m); > - /* > - * Automatic sizing of receive socket buffer. Often the send > - * buffer size is not optimally adjusted to the actual network > - * conditions at hand (delay bandwidth product). Setting the > - * buffer size too small limits throughput on links with high > - * bandwidth and high delay (eg. trans-continental/oceanic links). > - * > - * On the receive side the socket buffer memory is only rarely > - * used to any significant extent. This allows us to be much > - * more aggressive in scaling the receive socket buffer. For > - * the case that the buffer space is actually used to a large > - * extent and we run out of kernel memory we can simply drop > - * the new segments; TCP on the sender will just retransmit it > - * later. Setting the buffer size too big may only consume too > - * much kernel memory if the application doesn't read() from > - * the socket or packet loss or reordering makes use of the > - * reassembly queue. > - * > - * The criteria to step up the receive buffer one notch are: > - * 1. Application has not set receive buffer size with > - * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. > - * 2. the number of bytes received during the time it takes > - * one timestamp to be reflected back to us (the RTT); > - * 3. received bytes per RTT is within seven eighth of the > - * current socket buffer size; > - * 4. receive buffer size has not hit maximal automatic size; > - * > - * This algorithm does one step per RTT at most and only if > - * we receive a bulk stream w/o packet losses or reorderings. > - * Shrinking the buffer during idle times is not necessary as > - * it doesn't consume any memory when idle. > - * > - * TODO: Only step up if the application is actually serving > - * the buffer to better manage the socket buffer resources. > - */ > - if (V_tcp_do_autorcvbuf && > - (to->to_flags & TOF_TS) && > - to->to_tsecr && > - (so->so_rcv.sb_flags & SB_AUTOSIZE)) { > - if (TSTMP_GT(to->to_tsecr, tp->rfbuf_ts) && > - to->to_tsecr - tp->rfbuf_ts < hz) { > - if (tp->rfbuf_cnt > > - (so->so_rcv.sb_hiwat / 8 * 7) && > - so->so_rcv.sb_hiwat < > - V_tcp_autorcvbuf_max) { > - newsize = > - min(so->so_rcv.sb_hiwat + > - V_tcp_autorcvbuf_inc, > - V_tcp_autorcvbuf_max); > - } > - /* Start over with next RTT. */ > - tp->rfbuf_ts = 0; > - tp->rfbuf_cnt = 0; > - } else > - tp->rfbuf_cnt += tlen; /* add up */ > - } > + > + newsize = tcp_autorcvbuf(m, th, so, tp, tlen); > > /* Add data to socket buffer. */ > SOCKBUF_LOCK(&so->so_rcv); > @@ -532,10 +478,6 @@ tcp_do_slowpath(struct mbuf *m, struct t > win = 0; > tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); > > - /* Reset receive buffer auto scaling when not in bulk receive mode. */ > - tp->rfbuf_ts = 0; > - tp->rfbuf_cnt = 0; > - > switch (tp->t_state) { > > /* > > Modified: head/sys/netinet/tcp_var.h > ============================================================================== > --- head/sys/netinet/tcp_var.h Mon Apr 10 06:19:09 2017 (r316675) > +++ head/sys/netinet/tcp_var.h Mon Apr 10 08:19:35 2017 (r316676) > @@ -778,6 +778,8 @@ void hhook_run_tcp_est_in(struct tcpcb * > #endif > > int tcp_input(struct mbuf **, int *, int); > +int tcp_autorcvbuf(struct mbuf *, struct tcphdr *, struct socket *, > + struct tcpcb *, int); > void tcp_do_segment(struct mbuf *, struct tcphdr *, > struct socket *, struct tcpcb *, int, int, uint8_t, > int); > > From owner-svn-src-all@freebsd.org Mon Apr 10 15:18:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BF38D375FC for ; Mon, 10 Apr 2017 15:18:02 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E007FB7 for ; Mon, 10 Apr 2017 15:18:01 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x232.google.com with SMTP id t189so40299934wmt.1 for ; Mon, 10 Apr 2017 08:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to; bh=DRSUZLWBMillVV/f1IYZl3lYWB9nNiONsNMrnQziDWI=; b=uuvUKoyxL0ac50KpIJuLPfYJKlirDHlv0W90OpLD1JlDcWOQQooVE/hsuUyHQRGUtI Gp3i6s4TaYknJXrk9/vCTwgWPSEf2lnKHaEkxKABCWbppwvGjG4aCHQsK2YWiNpfz9l8 8JChsjMUiuBIkYL8p0+QsBcnuZwFNUEEgHHQaDYfzDkwXWY7ROF2JiysjfEixhTVpWOm KAj7cUIAeB8hDy7kpafqMVudRdhClo86NjDgRlWtrv1qKb2jWfsEZlhQ0ysMEpmGkag+ E3YnakvZAlO8cqbaIuQdLo+/S/niN/6e+uULA8SABLL0w3RMkETJ6Rk71IBmAYB2wqe2 qYvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to; bh=DRSUZLWBMillVV/f1IYZl3lYWB9nNiONsNMrnQziDWI=; b=dUYZW1xMBao/aJ1kMhgZLfSSXkoz8KVeuZzqXyKIHQGF6Prq89KkPcBgO5KS9co0hw 2YwhxrWE98WA6wdS3Mmk4zMC4oC/oMzyHbryvjmlQ9nS5Fats4DS4362O4WjXS4BEeOs Ps6DCBZDSielICcSPDqmMwfUb5PcCOEhBdUnywa9Oc6joVLAJxlYreVeT1nQbyAKmh1x /ODzqQ3Yg0sGmhxUgJzhZXiF6mZcMelfoVrwneH/D4yNZSIs2oesmc/VBeCllqeSXr9L hiOuQDvq0gdu/DXAzDlH1upxDh5oriG5BQMUxLoSEeohbgUVmsTNvJeSu0TruP9V5tXm 0R6g== X-Gm-Message-State: AN3rC/5/47xkE8XSEczdtiVVcSb+NFxqr8LpkXEd9yOdmMBzmIJkj4dCdzlk3xCFTeh8Fijb X-Received: by 10.28.91.82 with SMTP id p79mr9916525wmb.130.1491837479234; Mon, 10 Apr 2017 08:17:59 -0700 (PDT) Received: from [10.10.1.58] ([185.97.61.26]) by smtp.gmail.com with ESMTPSA id 201sm10697188wmr.5.2017.04.10.08.17.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 08:17:58 -0700 (PDT) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r316676 - in head/sys/netinet: . tcp_stacks To: Julian Elischer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704100819.v3A8JZCh014531@repo.freebsd.org> <5dc195ac-d78d-1c7c-10dd-a1e21f503330@freebsd.org> Message-ID: <6f86b644-1ae3-101e-629b-4e9437e8bb85@freebsd.org> Date: Mon, 10 Apr 2017 16:17:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <5dc195ac-d78d-1c7c-10dd-a1e21f503330@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 15:18:02 -0000 I don't tend to MFC 10.x now, but do agree given the impact that for this one it should be done. The fix is a little different, due to code restructuring in 11 / head, but I do have a 10.x version already. Regards Steve On 10/04/2017 15:51, Julian Elischer wrote: > If possible MFC to 10 too would be nice.. > thanks > > > On 10/4/17 4:19 pm, Steven Hartland wrote: >> Author: smh >> Date: Mon Apr 10 08:19:35 2017 >> New Revision: 316676 >> URL: https://svnweb.freebsd.org/changeset/base/316676 >> >> Log: >> Use estimated RTT for receive buffer auto resizing instead of >> timestamps >> Switched from using timestamps to RTT estimates when performing >> TCP receive >> buffer auto resizing, as not all hosts support / enable TCP >> timestamps. >> Disabled reset of receive buffer auto scaling when not in bulk >> receive mode, >> which gives an extra 20% performance increase. >> Also extracted auto resizing to a common method shared between >> standard and >> fastpath modules. >> With this AWS S3 downloads at ~17ms latency on a 1Gbps >> connection jump from >> ~3MB/s to ~100MB/s using the default settings. >> Reviewed by: lstewart, gnn >> MFC after: 2 weeks >> Relnotes: Yes >> Sponsored by: Multiplay >> Differential Revision: https://reviews.freebsd.org/D9668 >> >> Modified: >> head/sys/netinet/in_kdtrace.c >> head/sys/netinet/in_kdtrace.h >> head/sys/netinet/tcp_input.c >> head/sys/netinet/tcp_output.c >> head/sys/netinet/tcp_stacks/fastpath.c >> head/sys/netinet/tcp_var.h >> >> Modified: head/sys/netinet/in_kdtrace.c >> ============================================================================== >> >> --- head/sys/netinet/in_kdtrace.c Mon Apr 10 06:19:09 2017 (r316675) >> +++ head/sys/netinet/in_kdtrace.c Mon Apr 10 08:19:35 2017 (r316676) >> @@ -132,6 +132,14 @@ SDT_PROBE_DEFINE6_XLATE(tcp, , , state__ >> "void *", "void *", >> "int", "tcplsinfo_t *"); >> +SDT_PROBE_DEFINE6_XLATE(tcp, , , receive__autoresize, >> + "void *", "void *", >> + "struct tcpcb *", "csinfo_t *", >> + "struct mbuf *", "ipinfo_t *", >> + "struct tcpcb *", "tcpsinfo_t *" , >> + "struct tcphdr *", "tcpinfoh_t *", >> + "int", "int"); >> + >> SDT_PROBE_DEFINE5_XLATE(udp, , , receive, >> "void *", "pktinfo_t *", >> "struct inpcb *", "csinfo_t *", >> >> Modified: head/sys/netinet/in_kdtrace.h >> ============================================================================== >> >> --- head/sys/netinet/in_kdtrace.h Mon Apr 10 06:19:09 2017 (r316675) >> +++ head/sys/netinet/in_kdtrace.h Mon Apr 10 08:19:35 2017 (r316676) >> @@ -65,6 +65,7 @@ SDT_PROBE_DECLARE(tcp, , , debug__input) >> SDT_PROBE_DECLARE(tcp, , , debug__output); >> SDT_PROBE_DECLARE(tcp, , , debug__user); >> SDT_PROBE_DECLARE(tcp, , , debug__drop); >> +SDT_PROBE_DECLARE(tcp, , , receive__autoresize); >> SDT_PROBE_DECLARE(udp, , , receive); >> SDT_PROBE_DECLARE(udp, , , send); >> >> Modified: head/sys/netinet/tcp_input.c >> ============================================================================== >> >> --- head/sys/netinet/tcp_input.c Mon Apr 10 06:19:09 2017 (r316675) >> +++ head/sys/netinet/tcp_input.c Mon Apr 10 08:19:35 2017 (r316676) >> @@ -1486,6 +1486,68 @@ drop: >> return (IPPROTO_DONE); >> } >> +/* >> + * Automatic sizing of receive socket buffer. Often the send >> + * buffer size is not optimally adjusted to the actual network >> + * conditions at hand (delay bandwidth product). Setting the >> + * buffer size too small limits throughput on links with high >> + * bandwidth and high delay (eg. trans-continental/oceanic links). >> + * >> + * On the receive side the socket buffer memory is only rarely >> + * used to any significant extent. This allows us to be much >> + * more aggressive in scaling the receive socket buffer. For >> + * the case that the buffer space is actually used to a large >> + * extent and we run out of kernel memory we can simply drop >> + * the new segments; TCP on the sender will just retransmit it >> + * later. Setting the buffer size too big may only consume too >> + * much kernel memory if the application doesn't read() from >> + * the socket or packet loss or reordering makes use of the >> + * reassembly queue. >> + * >> + * The criteria to step up the receive buffer one notch are: >> + * 1. Application has not set receive buffer size with >> + * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. >> + * 2. the number of bytes received during the time it takes >> + * one timestamp to be reflected back to us (the RTT); >> + * 3. received bytes per RTT is within seven eighth of the >> + * current socket buffer size; >> + * 4. receive buffer size has not hit maximal automatic size; >> + * >> + * This algorithm does one step per RTT at most and only if >> + * we receive a bulk stream w/o packet losses or reorderings. >> + * Shrinking the buffer during idle times is not necessary as >> + * it doesn't consume any memory when idle. >> + * >> + * TODO: Only step up if the application is actually serving >> + * the buffer to better manage the socket buffer resources. >> + */ >> +int >> +tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, struct socket *so, >> + struct tcpcb *tp, int tlen) >> +{ >> + int newsize = 0; >> + >> + if (V_tcp_do_autorcvbuf && (so->so_rcv.sb_flags & SB_AUTOSIZE) && >> + tp->t_srtt != 0 && tp->rfbuf_ts != 0 && >> + TCP_TS_TO_TICKS(tcp_ts_getticks() - tp->rfbuf_ts) > >> + (tp->t_srtt >> TCP_RTT_SHIFT)) { >> + if (tp->rfbuf_cnt > (so->so_rcv.sb_hiwat / 8 * 7) && >> + so->so_rcv.sb_hiwat < V_tcp_autorcvbuf_max) { >> + newsize = min(so->so_rcv.sb_hiwat + >> + V_tcp_autorcvbuf_inc, V_tcp_autorcvbuf_max); >> + } >> + TCP_PROBE6(receive__autoresize, NULL, tp, m, tp, th, newsize); >> + >> + /* Start over with next RTT. */ >> + tp->rfbuf_ts = 0; >> + tp->rfbuf_cnt = 0; >> + } else { >> + tp->rfbuf_cnt += tlen; /* add up */ >> + } >> + >> + return (newsize); >> +} >> + >> void >> tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, >> struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos, >> @@ -1849,62 +1911,7 @@ tcp_do_segment(struct mbuf *m, struct tc >> #endif >> TCP_PROBE3(debug__input, tp, th, m); >> - /* >> - * Automatic sizing of receive socket buffer. Often the send >> - * buffer size is not optimally adjusted to the actual network >> - * conditions at hand (delay bandwidth product). Setting the >> - * buffer size too small limits throughput on links with high >> - * bandwidth and high delay (eg. trans-continental/oceanic >> links). >> - * >> - * On the receive side the socket buffer memory is only rarely >> - * used to any significant extent. This allows us to be much >> - * more aggressive in scaling the receive socket buffer. For >> - * the case that the buffer space is actually used to a large >> - * extent and we run out of kernel memory we can simply drop >> - * the new segments; TCP on the sender will just retransmit it >> - * later. Setting the buffer size too big may only consume too >> - * much kernel memory if the application doesn't read() from >> - * the socket or packet loss or reordering makes use of the >> - * reassembly queue. >> - * >> - * The criteria to step up the receive buffer one notch are: >> - * 1. Application has not set receive buffer size with >> - * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. >> - * 2. the number of bytes received during the time it takes >> - * one timestamp to be reflected back to us (the RTT); >> - * 3. received bytes per RTT is within seven eighth of the >> - * current socket buffer size; >> - * 4. receive buffer size has not hit maximal automatic size; >> - * >> - * This algorithm does one step per RTT at most and only if >> - * we receive a bulk stream w/o packet losses or reorderings. >> - * Shrinking the buffer during idle times is not necessary as >> - * it doesn't consume any memory when idle. >> - * >> - * TODO: Only step up if the application is actually serving >> - * the buffer to better manage the socket buffer resources. >> - */ >> - if (V_tcp_do_autorcvbuf && >> - (to.to_flags & TOF_TS) && >> - to.to_tsecr && >> - (so->so_rcv.sb_flags & SB_AUTOSIZE)) { >> - if (TSTMP_GT(to.to_tsecr, tp->rfbuf_ts) && >> - to.to_tsecr - tp->rfbuf_ts < hz) { >> - if (tp->rfbuf_cnt > >> - (so->so_rcv.sb_hiwat / 8 * 7) && >> - so->so_rcv.sb_hiwat < >> - V_tcp_autorcvbuf_max) { >> - newsize = >> - min(so->so_rcv.sb_hiwat + >> - V_tcp_autorcvbuf_inc, >> - V_tcp_autorcvbuf_max); >> - } >> - /* Start over with next RTT. */ >> - tp->rfbuf_ts = 0; >> - tp->rfbuf_cnt = 0; >> - } else >> - tp->rfbuf_cnt += tlen; /* add up */ >> - } >> + newsize = tcp_autorcvbuf(m, th, so, tp, tlen); >> /* Add data to socket buffer. */ >> SOCKBUF_LOCK(&so->so_rcv); >> @@ -1945,10 +1952,6 @@ tcp_do_segment(struct mbuf *m, struct tc >> win = 0; >> tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); >> - /* Reset receive buffer auto scaling when not in bulk receive >> mode. */ >> - tp->rfbuf_ts = 0; >> - tp->rfbuf_cnt = 0; >> - >> switch (tp->t_state) { >> /* >> >> Modified: head/sys/netinet/tcp_output.c >> ============================================================================== >> >> --- head/sys/netinet/tcp_output.c Mon Apr 10 06:19:09 2017 (r316675) >> +++ head/sys/netinet/tcp_output.c Mon Apr 10 08:19:35 2017 (r316676) >> @@ -831,11 +831,13 @@ send: >> to.to_tsval = tcp_ts_getticks() + tp->ts_offset; >> to.to_tsecr = tp->ts_recent; >> to.to_flags |= TOF_TS; >> - /* Set receive buffer autosizing timestamp. */ >> - if (tp->rfbuf_ts == 0 && >> - (so->so_rcv.sb_flags & SB_AUTOSIZE)) >> - tp->rfbuf_ts = tcp_ts_getticks(); >> } >> + >> + /* Set receive buffer autosizing timestamp. */ >> + if (tp->rfbuf_ts == 0 && >> + (so->so_rcv.sb_flags & SB_AUTOSIZE)) >> + tp->rfbuf_ts = tcp_ts_getticks(); >> + >> /* Selective ACK's. */ >> if (tp->t_flags & TF_SACK_PERMIT) { >> if (flags & TH_SYN) >> >> Modified: head/sys/netinet/tcp_stacks/fastpath.c >> ============================================================================== >> >> --- head/sys/netinet/tcp_stacks/fastpath.c Mon Apr 10 06:19:09 >> 2017 (r316675) >> +++ head/sys/netinet/tcp_stacks/fastpath.c Mon Apr 10 08:19:35 >> 2017 (r316676) >> @@ -399,62 +399,8 @@ tcp_do_fastnewdata(struct mbuf *m, struc >> (void *)tcp_saveipgen, &tcp_savetcp, 0); >> #endif >> TCP_PROBE3(debug__input, tp, th, m); >> - /* >> - * Automatic sizing of receive socket buffer. Often the send >> - * buffer size is not optimally adjusted to the actual network >> - * conditions at hand (delay bandwidth product). Setting the >> - * buffer size too small limits throughput on links with high >> - * bandwidth and high delay (eg. trans-continental/oceanic links). >> - * >> - * On the receive side the socket buffer memory is only rarely >> - * used to any significant extent. This allows us to be much >> - * more aggressive in scaling the receive socket buffer. For >> - * the case that the buffer space is actually used to a large >> - * extent and we run out of kernel memory we can simply drop >> - * the new segments; TCP on the sender will just retransmit it >> - * later. Setting the buffer size too big may only consume too >> - * much kernel memory if the application doesn't read() from >> - * the socket or packet loss or reordering makes use of the >> - * reassembly queue. >> - * >> - * The criteria to step up the receive buffer one notch are: >> - * 1. Application has not set receive buffer size with >> - * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. >> - * 2. the number of bytes received during the time it takes >> - * one timestamp to be reflected back to us (the RTT); >> - * 3. received bytes per RTT is within seven eighth of the >> - * current socket buffer size; >> - * 4. receive buffer size has not hit maximal automatic size; >> - * >> - * This algorithm does one step per RTT at most and only if >> - * we receive a bulk stream w/o packet losses or reorderings. >> - * Shrinking the buffer during idle times is not necessary as >> - * it doesn't consume any memory when idle. >> - * >> - * TODO: Only step up if the application is actually serving >> - * the buffer to better manage the socket buffer resources. >> - */ >> - if (V_tcp_do_autorcvbuf && >> - (to->to_flags & TOF_TS) && >> - to->to_tsecr && >> - (so->so_rcv.sb_flags & SB_AUTOSIZE)) { >> - if (TSTMP_GT(to->to_tsecr, tp->rfbuf_ts) && >> - to->to_tsecr - tp->rfbuf_ts < hz) { >> - if (tp->rfbuf_cnt > >> - (so->so_rcv.sb_hiwat / 8 * 7) && >> - so->so_rcv.sb_hiwat < >> - V_tcp_autorcvbuf_max) { >> - newsize = >> - min(so->so_rcv.sb_hiwat + >> - V_tcp_autorcvbuf_inc, >> - V_tcp_autorcvbuf_max); >> - } >> - /* Start over with next RTT. */ >> - tp->rfbuf_ts = 0; >> - tp->rfbuf_cnt = 0; >> - } else >> - tp->rfbuf_cnt += tlen; /* add up */ >> - } >> + >> + newsize = tcp_autorcvbuf(m, th, so, tp, tlen); >> /* Add data to socket buffer. */ >> SOCKBUF_LOCK(&so->so_rcv); >> @@ -532,10 +478,6 @@ tcp_do_slowpath(struct mbuf *m, struct t >> win = 0; >> tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); >> - /* Reset receive buffer auto scaling when not in bulk receive >> mode. */ >> - tp->rfbuf_ts = 0; >> - tp->rfbuf_cnt = 0; >> - >> switch (tp->t_state) { >> /* >> >> Modified: head/sys/netinet/tcp_var.h >> ============================================================================== >> >> --- head/sys/netinet/tcp_var.h Mon Apr 10 06:19:09 2017 (r316675) >> +++ head/sys/netinet/tcp_var.h Mon Apr 10 08:19:35 2017 (r316676) >> @@ -778,6 +778,8 @@ void hhook_run_tcp_est_in(struct tcpcb * >> #endif >> int tcp_input(struct mbuf **, int *, int); >> +int tcp_autorcvbuf(struct mbuf *, struct tcphdr *, struct socket *, >> + struct tcpcb *, int); >> void tcp_do_segment(struct mbuf *, struct tcphdr *, >> struct socket *, struct tcpcb *, int, int, uint8_t, >> int); >> >> > From owner-svn-src-all@freebsd.org Mon Apr 10 15:32:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58D58D37D53; Mon, 10 Apr 2017 15:32:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29577E8C; Mon, 10 Apr 2017 15:32:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AFWQhd004168; Mon, 10 Apr 2017 15:32:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AFWQvO004167; Mon, 10 Apr 2017 15:32:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704101532.v3AFWQvO004167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 10 Apr 2017 15:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316679 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 15:32:27 -0000 Author: kib Date: Mon Apr 10 15:32:26 2017 New Revision: 316679 URL: https://svnweb.freebsd.org/changeset/base/316679 Log: Do not lose dirty bits for removing PROT_WRITE on arm64. Arm64 pmap interprets accessed writable ptes as modified, since ARMv8.0 does not track Dirty Bit Modifier in hardware. If writable bit is removed, page must be marked as dirty for MI VM. This change is most important for COW, where fork caused losing content of the dirty pages which were not yet scanned by pagedaemon. Reviewed by: alc, andrew Reported and tested by: Mark Millard PR: 217138, 217239 Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Apr 10 12:35:58 2017 (r316678) +++ head/sys/arm64/arm64/pmap.c Mon Apr 10 15:32:26 2017 (r316679) @@ -2481,6 +2481,11 @@ pmap_protect(pmap_t pmap, vm_offset_t sv sva += L3_SIZE) { l3 = pmap_load(l3p); if (pmap_l3_valid(l3)) { + if ((l3 & ATTR_SW_MANAGED) && + pmap_page_dirty(l3)) { + vm_page_dirty(PHYS_TO_VM_PAGE(l3 & + ~ATTR_MASK)); + } pmap_set(l3p, ATTR_AP(ATTR_AP_RO)); PTE_SYNC(l3p); /* XXX: Use pmap_invalidate_range */ From owner-svn-src-all@freebsd.org Mon Apr 10 16:09:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3686D37C80; Mon, 10 Apr 2017 16:09:20 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8783A1D4; Mon, 10 Apr 2017 16:09:20 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AG9Jpo017690; Mon, 10 Apr 2017 16:09:19 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AG9JHm017687; Mon, 10 Apr 2017 16:09:19 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201704101609.v3AG9JHm017687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 10 Apr 2017 16:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316680 - stable/11/release/arm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 16:09:20 -0000 Author: gjb Date: Mon Apr 10 16:09:19 2017 New Revision: 316680 URL: https://svnweb.freebsd.org/changeset/base/316680 Log: MFC r316617: - Increase the image size for RPI2 and IMX6-based boards from 1G to 1.5G. - Use the 'conv=sync' dd(1) option to fix writing the u-boot.imx file to the md(4) device for IMX6-based boards. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/arm/CUBOX-HUMMINGBOARD.conf stable/11/release/arm/RPI2.conf stable/11/release/arm/WANDBOARD.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- stable/11/release/arm/CUBOX-HUMMINGBOARD.conf Mon Apr 10 15:32:26 2017 (r316679) +++ stable/11/release/arm/CUBOX-HUMMINGBOARD.conf Mon Apr 10 16:09:19 2017 (r316680) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard" KERNEL="IMX6" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" -IMAGE_SIZE="1G" +IMAGE_SIZE="1536M" PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" @@ -23,7 +23,7 @@ arm_install_uboot() { FATMOUNT="${DESTDIR%${KERNEL}}/fat" UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ - of=/dev/${mddev} bs=512 seek=2 + of=/dev/${mddev} bs=512 seek=2 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} Modified: stable/11/release/arm/RPI2.conf ============================================================================== --- stable/11/release/arm/RPI2.conf Mon Apr 10 15:32:26 2017 (r316679) +++ stable/11/release/arm/RPI2.conf Mon Apr 10 16:09:19 2017 (r316680) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-rpi2" KERNEL="RPI2" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" -IMAGE_SIZE="1G" +IMAGE_SIZE="1536M" PART_SCHEME="MBR" FAT_SIZE="50m" FAT_TYPE="16" Modified: stable/11/release/arm/WANDBOARD.conf ============================================================================== --- stable/11/release/arm/WANDBOARD.conf Mon Apr 10 15:32:26 2017 (r316679) +++ stable/11/release/arm/WANDBOARD.conf Mon Apr 10 16:09:19 2017 (r316680) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-wandboard" KERNEL="IMX6" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" -IMAGE_SIZE="1G" +IMAGE_SIZE="1536M" PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" @@ -23,7 +23,7 @@ arm_install_uboot() { FATMOUNT="${DESTDIR%${KERNEL}}/fat" UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ - of=/dev/${mddev} bs=512 seek=2 + of=/dev/${mddev} bs=512 seek=2 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} From owner-svn-src-all@freebsd.org Mon Apr 10 17:05:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70F25D37279; Mon, 10 Apr 2017 17:05:56 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38A72C62; Mon, 10 Apr 2017 17:05:55 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7774820AAE; Mon, 10 Apr 2017 13:05:49 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Mon, 10 Apr 2017 13:05:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=rFDYadD/totDgU+Zi9 xBtWSFRm1LaIDHDxkvZY39H7Y=; b=fB4S0R7ZB4fi+RZlJAJOMC+HC2yKzoMw+F 31swXsMLs7QiBcDXdcSjwOIXE4a/Vx85zEnGrJHMQ2pHoj7YY4Wm8IWLmEJy4Rgi 6QSQhdJz9lgyIIZft8libcMUupS52mCiMeso2HH75pXU53oteubLfdya5PYxdG7a 7UZ+dk4zNBkfWPQ2zC92GMpJL/dAM1Mk7agULuoiohua4ppJJGY89vR92U4Ic2+m R+jl4UNnkSKCOq10eUFRg/XDqfm+qGVr8rQvGm0exxTGOXySrbF3X+iiZqXoQB+M 5QjVBdKdIufB7VA0lRiDZRZJfn7PMdWCtYUV1CGKRs5ryofCXb3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=rFDYadD/totDgU+Zi9xBtWSFRm1LaIDHDxkvZY39H7Y=; b=kb8iiOhm PyV0Cu+Cv9SQKgHU87uciLRN/+FG2pQQsi8czz6hq8+5PHhojp2uejDWM/GamQTf sjWr2myKqNsPRwtbNb9Y3d9egUdU9vFN6BwNhxPejXUg6fSZGkmkWX17koDzEbrN yp1qTRC/niWwonWkafvFAiPP4Y5aHjq8Zh1Hfzr/ZwnOMpNLID4L0/TVkrzjxGRc vIH5xhD6qAtto/ofuMXysMjHcXekhsCCf2aXZAq7PauM/I7QTThWGjCZvPUc63Jz 1EPKwEFo0jIf5PS/QWhZQfIIng9JXkSQKcPzVhynPNuWAbESICnWhFUaLxYbpc4L Iv2Uk8+lYLD9UQ== X-ME-Sender: X-Sasl-enc: 0D3zZ2Q6HkFfAawxa/sWtoIH/+Fm00lu7wUY+X9ktptf 1491843949 Received: from [192.168.1.88] (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id D2AED7E168; Mon, 10 Apr 2017 13:05:48 -0400 (EDT) Subject: Re: svn commit: r316676 - in head/sys/netinet: . tcp_stacks To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704100819.v3A8JZCh014531@repo.freebsd.org> From: Bruce Simpson Message-ID: <68e9768e-0562-6d2e-8934-689fb85235a7@fastmail.net> Date: Mon, 10 Apr 2017 18:05:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201704100819.v3A8JZCh014531@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 17:05:56 -0000 This is a really good thing to have in. Thanks, Steven and others, for optimizing for this big case. From owner-svn-src-all@freebsd.org Mon Apr 10 17:16:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2985D37648; Mon, 10 Apr 2017 17:16:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB9F1615; Mon, 10 Apr 2017 17:16:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AHFx5g046836; Mon, 10 Apr 2017 17:15:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AHFxlq046835; Mon, 10 Apr 2017 17:15:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704101715.v3AHFxlq046835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 10 Apr 2017 17:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316681 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 17:16:01 -0000 Author: markj Date: Mon Apr 10 17:15:59 2017 New Revision: 316681 URL: https://svnweb.freebsd.org/changeset/base/316681 Log: Handle NULL entries in gmirror disk ds_bios arrays. Entries may be removed and freed if an I/O error occurs during mirror synchronization, so we cannot assume that all entries of ds_bios are valid. Also ensure that a synchronization BIO's array index is preserved after a successful write. Reported and tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Mon Apr 10 16:09:19 2017 (r316680) +++ head/sys/geom/mirror/g_mirror.c Mon Apr 10 17:15:59 2017 (r316681) @@ -1304,11 +1304,13 @@ g_mirror_sync_release(struct g_mirror_so static void g_mirror_sync_request_free(struct g_mirror_disk *disk, struct bio *bp) { - int i; + int idx; if (disk != NULL && disk->d_sync.ds_bios != NULL) { - i = (int)(uintptr_t)bp->bio_caller1; - disk->d_sync.ds_bios[i] = NULL; + idx = (int)(uintptr_t)bp->bio_caller1; + KASSERT(disk->d_sync.ds_bios[idx] == bp, + ("unexpected sync BIO at %p:%d", disk, idx)); + disk->d_sync.ds_bios[idx] = NULL; } free(bp->bio_data, M_MIRROR); g_destroy_bio(bp); @@ -1375,7 +1377,7 @@ g_mirror_sync_request(struct bio *bp) { off_t offset; void *data; - int i; + int i, idx; KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_sync_request_write, bp->bio_error); @@ -1413,6 +1415,7 @@ g_mirror_sync_request(struct bio *bp) /* Send next synchronization request. */ data = bp->bio_data; + idx = (int)(uintptr_t)bp->bio_caller1; g_reset_bio(bp); bp->bio_cmd = BIO_READ; bp->bio_offset = sync->ds_offset; @@ -1422,6 +1425,7 @@ g_mirror_sync_request(struct bio *bp) bp->bio_data = data; bp->bio_from = sync->ds_consumer; bp->bio_to = sc->sc_provider; + bp->bio_caller1 = (void *)(uintptr_t)idx; G_MIRROR_LOGREQ(3, bp, "Sending synchronization request."); sync->ds_consumer->index++; /* @@ -1439,7 +1443,7 @@ g_mirror_sync_request(struct bio *bp) offset = sc->sc_mediasize; for (i = 0; i < g_mirror_syncreqs; i++) { bp = sync->ds_bios[i]; - if (bp->bio_offset < offset) + if (bp != NULL && bp->bio_offset < offset) offset = bp->bio_offset; } if (sync->ds_offset_done + (MAXPHYS * 100) < offset) { From owner-svn-src-all@freebsd.org Mon Apr 10 17:23:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D801FD37B96; Mon, 10 Apr 2017 17:23:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id C726DE84; Mon, 10 Apr 2017 17:23:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... To: Patrick Kelsey , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704090200.v39203Vf072867@repo.freebsd.org> From: Jung-uk Kim Message-ID: <0da40261-7829-8d63-c4aa-775a028367a2@FreeBSD.org> Date: Mon, 10 Apr 2017 13:23:04 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <201704090200.v39203Vf072867@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="q1QRfIsUf1EHVoJpE1712dtiNcPGqbBK1" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 17:23:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --q1QRfIsUf1EHVoJpE1712dtiNcPGqbBK1 Content-Type: multipart/mixed; boundary="vMuji50HhwuDT5VqX6l3cgAiJRGX2ctiO"; protected-headers="v1" From: Jung-uk Kim To: Patrick Kelsey , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <0da40261-7829-8d63-c4aa-775a028367a2@FreeBSD.org> Subject: Re: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... References: <201704090200.v39203Vf072867@repo.freebsd.org> In-Reply-To: <201704090200.v39203Vf072867@repo.freebsd.org> --vMuji50HhwuDT5VqX6l3cgAiJRGX2ctiO Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 04/08/2017 22:00, Patrick Kelsey wrote: > Author: pkelsey > Date: Sun Apr 9 02:00:03 2017 > New Revision: 316648 > URL: https://svnweb.freebsd.org/changeset/base/316648 >=20 > Log: > Corrected misspelled versions of rendezvous. > =20 > The MFC will include a compat definition of smp_no_rendevous_barrier(= ) > that calls smp_no_rendezvous_barrier(). > =20 > Reviewed by: gnn, kib > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D10313 =2E.. We knew about the problem but we didn't fix it because it breaks KPI. For example, sysutils/virtualbox-ose-kmod. If you really want to MFC this change, you have to implement shims. Jung-uk Kim --vMuji50HhwuDT5VqX6l3cgAiJRGX2ctiO-- --q1QRfIsUf1EHVoJpE1712dtiNcPGqbBK1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAljrv4UACgkQfJ+WJvzb 8UaGDwf/QRKyUXTynN5TbMmYNN36+q64XuRxRa8450kzb35093lC9sc0XyBxzWVk FLCOoFKALe+daXyIvXIjht1tz8SQY9rcZg7J7IJ5ZCdefhuSycUG8pxKDOkDmTVA oM9WAQ+H/6Z2QcnSVaAayQkCk1e7SXIuFn3LhsMmM+sVZS2FFUNft7yfpQKQKFv5 HJIoiz4jPOPUv1Ex8sWsECMCsWxAaYNmIo3r57wwTR2cuDwRjChwgUnEnjYRlSTk bnHJY3g+tcV+KylGMILyhwb2CHuMrlh4UY5P9tEZTxgRz6XAFQacOi/pW32IzeAE pfmXWwaljcwJRe+jEHPhOn9LGa2rGA== =uI0u -----END PGP SIGNATURE----- --q1QRfIsUf1EHVoJpE1712dtiNcPGqbBK1-- From owner-svn-src-all@freebsd.org Mon Apr 10 17:26:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 275ECD37C8F; Mon, 10 Apr 2017 17:26:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id 29A0283; Mon, 10 Apr 2017 17:26:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... To: Patrick Kelsey , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704090200.v39203Vf072867@repo.freebsd.org> <0da40261-7829-8d63-c4aa-775a028367a2@FreeBSD.org> From: Jung-uk Kim Message-ID: <7472f248-0dac-dd6c-da91-25e579e0631e@FreeBSD.org> Date: Mon, 10 Apr 2017 13:26:35 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <0da40261-7829-8d63-c4aa-775a028367a2@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vUiMNhfSbNFda01EdsAJnEAv5VOU3qjhL" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 17:26:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vUiMNhfSbNFda01EdsAJnEAv5VOU3qjhL Content-Type: multipart/mixed; boundary="l069xuQ9bgnNn0RULMcCfXANxn0Q2NaUF"; protected-headers="v1" From: Jung-uk Kim To: Patrick Kelsey , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <7472f248-0dac-dd6c-da91-25e579e0631e@FreeBSD.org> Subject: Re: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... References: <201704090200.v39203Vf072867@repo.freebsd.org> <0da40261-7829-8d63-c4aa-775a028367a2@FreeBSD.org> In-Reply-To: <0da40261-7829-8d63-c4aa-775a028367a2@FreeBSD.org> --l069xuQ9bgnNn0RULMcCfXANxn0Q2NaUF Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 04/10/2017 13:23, Jung-uk Kim wrote: > On 04/08/2017 22:00, Patrick Kelsey wrote: >> Author: pkelsey >> Date: Sun Apr 9 02:00:03 2017 >> New Revision: 316648 >> URL: https://svnweb.freebsd.org/changeset/base/316648 >> >> Log: >> Corrected misspelled versions of rendezvous. >> =20 >> The MFC will include a compat definition of smp_no_rendevous_barrier= () >> that calls smp_no_rendezvous_barrier(). >> =20 >> Reviewed by: gnn, kib >> MFC after: 1 week >> Differential Revision: https://reviews.freebsd.org/D10313 > ... >=20 > We knew about the problem but we didn't fix it because it breaks KPI. > For example, sysutils/virtualbox-ose-kmod. If you really want to MFC > this change, you have to implement shims. Actually, I meant to say current also needs a shim. Otherwise, _FreeBSD_version must be bumped. Sorry, I wasn't clear about this. Jung-uk Kim --l069xuQ9bgnNn0RULMcCfXANxn0Q2NaUF-- --vUiMNhfSbNFda01EdsAJnEAv5VOU3qjhL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAljrwE4ACgkQfJ+WJvzb 8UZhogf/ZgdQ7QI1d8H+88OurskP4oVCYGLiz2tkt8rNbXxbEH01RmntIVgkxTKu OgeAY6dtRHHaSwSKlH+AWTtxmOIL+pwZEFcAwev9ZRbI8zbXouNM46E/zg9LbbhW 0BuAdkqlbz0gLDmt0luE1G8wf/b+BhFDsQWyaNe+pJm1PmDRyNfcYhmL2Q5/yb7m kJbAODpcETOR6K/KrxtSlBi7bORFyWfffX729HGraT/7TUEINzCZbuPV1ilNXCT6 iuLHEokEBIvFFr2/W8jzlQxCio+v+DP2x0gBumQBr/eoSiIa13yGV6W7rccuNNi7 E6dU+lsPymtCpKr7oQHRQpfFpDAlnw== =mDQZ -----END PGP SIGNATURE----- --vUiMNhfSbNFda01EdsAJnEAv5VOU3qjhL-- From owner-svn-src-all@freebsd.org Mon Apr 10 17:42:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 249EAD3721D; Mon, 10 Apr 2017 17:42:40 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-pf0-x234.google.com (mail-pf0-x234.google.com [IPv6:2607:f8b0:400e:c00::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7243CBD; Mon, 10 Apr 2017 17:42:39 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: by mail-pf0-x234.google.com with SMTP id i5so36585977pfc.2; Mon, 10 Apr 2017 10:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=BODPESfqF0rhFUOGYI+n6EecFVSVMKS6Sf+IWETZeRs=; b=Y3wiXOvgISkbRxRbATYFcXWAQphnmTeILCn+vW+3AkQ4p67Prosgoch8Htie2gfW14 7SQCkSLvTC0Zm7X3HxcFHEw4Cg/dNY9LPc5xP4BwTf8Mdf9kKkEN2d6x8pMF80Vg1tr1 5EZf2Cir4UM9411Pmob8S9nYnYYMexjH7gGAZzYEnsm3spTo7+G1mMBlVnKCyBKH/VNJ MTEVYu0sLhYT0ympC3rqvJCVChoCZU77GCiukdvezDH0TPnR5IkgGIvOoTYaPOH7ydZQ eEsJqOSWKpfRl2ovaCY1qxXbo578cFdFX9djYA6xo56KKMJXXgXrSqzOny80dNLXC+SW XPMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=BODPESfqF0rhFUOGYI+n6EecFVSVMKS6Sf+IWETZeRs=; b=T/w3fd/0w4SV4yYF4AGSKSgCeIBPBTJ1pjvmrDdRkSRLbDCmzFQNUwOBSRMVJyYDcl NM3hynat79laC1hHjqGQxpQJPifK/kONzdz1viJQwBiwfT6nAA0Lq9l6vvU0TwZMgUEj tzTHtZitWjWU257lRveqEHw2qS5p7huLkxCgBA7SKF/FWMUJRhAdRcCydfxfBTV3pEcF jFLWZ7HF7iUbwn5XNjHu9sBccgLPOagWrZD0ajn7aAM2AZiV3Y+RsARonbGRdBvfJduv fSsTS5PB/+TN11avy0FddUwXHpEFHQGD/52thLlCAHlzgGzY8Mxl/Y6FVRLlxxIcObf/ R4AQ== X-Gm-Message-State: AFeK/H2OB3MWswoV6Bh+F2usBsdcd8mzBtC5gZQPFi5xnK1IRvq8Il+mEZ4uTk86YoaRJ8V0fNLn96Sj+CXfGw== X-Received: by 10.99.117.8 with SMTP id q8mr50861553pgc.106.1491846159301; Mon, 10 Apr 2017 10:42:39 -0700 (PDT) MIME-Version: 1.0 Sender: pkelsey@gmail.com Received: by 10.100.162.34 with HTTP; Mon, 10 Apr 2017 10:42:38 -0700 (PDT) In-Reply-To: <7472f248-0dac-dd6c-da91-25e579e0631e@FreeBSD.org> References: <201704090200.v39203Vf072867@repo.freebsd.org> <0da40261-7829-8d63-c4aa-775a028367a2@FreeBSD.org> <7472f248-0dac-dd6c-da91-25e579e0631e@FreeBSD.org> From: Patrick Kelsey Date: Mon, 10 Apr 2017 13:42:38 -0400 X-Google-Sender-Auth: OlQ6dq6ECd_YtXrhcQG_WqggVCE Message-ID: Subject: Re: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... To: Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 17:42:40 -0000 On Mon, Apr 10, 2017 at 1:26 PM, Jung-uk Kim wrote: > On 04/10/2017 13:23, Jung-uk Kim wrote: > > On 04/08/2017 22:00, Patrick Kelsey wrote: > >> Author: pkelsey > >> Date: Sun Apr 9 02:00:03 2017 > >> New Revision: 316648 > >> URL: https://svnweb.freebsd.org/changeset/base/316648 > >> > >> Log: > >> Corrected misspelled versions of rendezvous. > >> > >> The MFC will include a compat definition of smp_no_rendevous_barrier() > >> that calls smp_no_rendezvous_barrier(). > >> > >> Reviewed by: gnn, kib > >> MFC after: 1 week > >> Differential Revision: https://reviews.freebsd.org/D10313 > > ... > > > > We knew about the problem but we didn't fix it because it breaks KPI. > > For example, sysutils/virtualbox-ose-kmod. If you really want to MFC > > this change, you have to implement shims. > > Actually, I meant to say current also needs a shim. Otherwise, > _FreeBSD_version must be bumped. > > Sorry, I wasn't clear about this. > > I'm glad you clarified, as I was reading your last message just now wondering what I was missing. With respect to current, the intention is for the misspelled version to be gone in 12. The lack of a version bump was due to my misunderstanding of whether KPI changes were or weren't being tracked in __FreeBSD_version prior to a .0 release, but now that I've gone and found 1.6 in the Porter's Handbook, it's clear that they are. Thanks for catching this. -Patrick From owner-svn-src-all@freebsd.org Mon Apr 10 17:57:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD7B8D37B4F; Mon, 10 Apr 2017 17:57:57 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70D43990; Mon, 10 Apr 2017 17:57:57 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AHvunR063598; Mon, 10 Apr 2017 17:57:56 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AHvu4J063594; Mon, 10 Apr 2017 17:57:56 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201704101757.v3AHvu4J063594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 10 Apr 2017 17:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316682 - in head/sys/boot: ofw/libofw sparc64/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 17:57:57 -0000 Author: tsoome Date: Mon Apr 10 17:57:56 2017 New Revision: 316682 URL: https://svnweb.freebsd.org/changeset/base/316682 Log: loader: r316585 did miss sparc/ofw This update does add the code to pass partition size to vdev_probe() via simple callback. Tested via tinderbox build, but not yet with actual boot. The code can be improved still, but to verify the idea to read media block size and amedia size has to be confirmed first. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D10302 Modified: head/sys/boot/ofw/libofw/ofw_disk.c head/sys/boot/ofw/libofw/openfirm.c head/sys/boot/ofw/libofw/openfirm.h head/sys/boot/sparc64/loader/main.c Modified: head/sys/boot/ofw/libofw/ofw_disk.c ============================================================================== --- head/sys/boot/ofw/libofw/ofw_disk.c Mon Apr 10 17:15:59 2017 (r316681) +++ head/sys/boot/ofw/libofw/ofw_disk.c Mon Apr 10 17:57:56 2017 (r316682) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "bootstrap.h" #include "libofw.h" @@ -154,11 +155,26 @@ ofwd_close(struct open_file *f) } static int -ofwd_ioctl(struct open_file *f __unused, u_long cmd __unused, - void *data __unused) +ofwd_ioctl(struct open_file *f, u_long cmd, void *data) { + struct ofw_devdesc *dev = f->f_devdata; + int block_size; + unsigned int n; - return (EINVAL); + switch (cmd) { + case DIOCGSECTORSIZE: + block_size = OF_block_size(dev->d_handle); + *(u_int *)data = block_size; + break; + case DIOCGMEDIASIZE: + block_size = OF_block_size(dev->d_handle); + n = OF_blocks(dev->d_handle); + *(uint64_t *)data = (uint64_t)(n * block_size); + break; + default: + return (ENOTTY); + } + return (0); } static int Modified: head/sys/boot/ofw/libofw/openfirm.c ============================================================================== --- head/sys/boot/ofw/libofw/openfirm.c Mon Apr 10 17:15:59 2017 (r316681) +++ head/sys/boot/ofw/libofw/openfirm.c Mon Apr 10 17:57:56 2017 (r316682) @@ -622,6 +622,53 @@ OF_seek(ihandle_t instance, u_int64_t po return (args.status); } +/* Blocks. */ +unsigned int +OF_blocks(ihandle_t instance) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t instance; + cell_t result; + cell_t blocks; + } args = { + (cell_t)"#blocks", + 2, + 1, + }; + + args.instance = instance; + if (openfirmware(&args) == -1) + return ((unsigned int)-1); + return (args.blocks); +} + +/* Block size. */ +int +OF_block_size(ihandle_t instance) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t instance; + cell_t result; + cell_t size; + } args = { + (cell_t)"block-size", + 2, + 1, + }; + + args.instance = instance; + if (openfirmware(&args) == -1) + return (512); + return (args.size); +} + +/* /* * Memory functions */ Modified: head/sys/boot/ofw/libofw/openfirm.h ============================================================================== --- head/sys/boot/ofw/libofw/openfirm.h Mon Apr 10 17:15:59 2017 (r316681) +++ head/sys/boot/ofw/libofw/openfirm.h Mon Apr 10 17:57:56 2017 (r316682) @@ -105,6 +105,8 @@ void OF_close(ihandle_t); int OF_read(ihandle_t, void *, int); int OF_write(ihandle_t, void *, int); int OF_seek(ihandle_t, u_quad_t); +unsigned int OF_blocks(ihandle_t); +int OF_block_size(ihandle_t); /* Memory functions */ void *OF_claim(void *, u_int, u_int); Modified: head/sys/boot/sparc64/loader/main.c ============================================================================== --- head/sys/boot/sparc64/loader/main.c Mon Apr 10 17:15:59 2017 (r316681) +++ head/sys/boot/sparc64/loader/main.c Mon Apr 10 17:57:56 2017 (r316682) @@ -735,6 +735,16 @@ tlb_init_sun4u(void) } #ifdef LOADER_ZFS_SUPPORT + +/* Set by sparc64_zfs_probe to provide partition size. */ +static size_t part_size; + +uint64_t +ldi_get_size(void *priv __unused) +{ + return ((uint64_t)part_size); +} + static void sparc64_zfs_probe(void) { @@ -742,13 +752,11 @@ sparc64_zfs_probe(void) char alias[64], devname[sizeof(alias) + sizeof(":x") - 1]; char type[sizeof("device_type")]; char *bdev, *dev, *odev; - uint64_t guid; + uint64_t guid, *guidp; int fd, len, part; phandle_t aliases, options; - /* Get the GUID of the ZFS pool on the boot device. */ guid = 0; - zfs_probe_dev(bootpath, &guid); /* * Get the GUIDs of the ZFS pools on any additional disks listed in @@ -771,12 +779,6 @@ sparc64_zfs_probe(void) continue; strcpy(alias, dev); (void)OF_getprop(aliases, dev, alias, sizeof(alias)); - /* - * Don't probe the boot disk twice. Note that bootpath - * includes the partition specifier. - */ - if (strncmp(alias, bootpath, strlen(alias)) == 0) - continue; if (OF_getprop(OF_finddevice(alias), "device_type", type, sizeof(type)) == -1) continue; @@ -798,8 +800,14 @@ sparc64_zfs_probe(void) if (part == 2 || vtoc.part[part].tag != VTOC_TAG_FREEBSD_ZFS) continue; + part_size = vtoc.map[part].nblks; (void)sprintf(devname, "%s:%c", alias, part + 'a'); - if (zfs_probe_dev(devname, NULL) == ENXIO) + /* Get the GUID of the ZFS pool on the boot device. */ + if (strcmp(devname, bootpath) == 0) + guidp = &guid; + else + guidp = NULL; + if (zfs_probe_dev(devname, guidp) == ENXIO) break; } } From owner-svn-src-all@freebsd.org Mon Apr 10 17:59:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9473D37C30; Mon, 10 Apr 2017 17:59:30 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB4C4AFB; Mon, 10 Apr 2017 17:59:30 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AHxTko063702; Mon, 10 Apr 2017 17:59:29 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AHxTfg063701; Mon, 10 Apr 2017 17:59:29 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201704101759.v3AHxTfg063701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Mon, 10 Apr 2017 17:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316683 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 17:59:31 -0000 Author: pkelsey Date: Mon Apr 10 17:59:29 2017 New Revision: 316683 URL: https://svnweb.freebsd.org/changeset/base/316683 Log: Bump __FreeBSD_version due to r316648, rename of smp_no_redevous_barrier() to smp_no_rendezvous_barrier() Reported by: jkim Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Apr 10 17:57:56 2017 (r316682) +++ head/sys/sys/param.h Mon Apr 10 17:59:29 2017 (r316683) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200027 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200028 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Apr 10 18:10:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0419D37EE1; Mon, 10 Apr 2017 18:10:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEEF8331; Mon, 10 Apr 2017 18:10:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id E988A10A87D; Mon, 10 Apr 2017 14:10:06 -0400 (EDT) From: John Baldwin To: Olivier Houchard Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316665 - in head/sys: compat/linuxkpi/common/src contrib/ck/include contrib/ck/src Date: Mon, 10 Apr 2017 10:31:43 -0700 Message-ID: <7068804.e9AF6kJOBM@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170409230840.GA90254@ci0.org> References: <201704092102.v39L25oh040066@repo.freebsd.org> <20170409230840.GA90254@ci0.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 10 Apr 2017 14:10:07 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 18:10:09 -0000 On Monday, April 10, 2017 01:08:40 AM Olivier Houchard wrote: > On Sun, Apr 09, 2017 at 03:49:57PM -0700, Conrad Meyer wrote: > > On Sun, Apr 9, 2017 at 2:02 PM, Olivier Houchard wrote: > > > Author: cognet > > > Date: Sun Apr 9 21:02:05 2017 > > > New Revision: 316665 > > > URL: https://svnweb.freebsd.org/changeset/base/316665 > > > > > > Log: > > > Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32 > > > This brings us changes we needed in ck_epoch. > > > > Out of curiosity ??? what changes did we need, and why? > > > > Hi Conrad, > > What ck_epoch lacked was any way to do priority propagation, which led > to some nice deadlocks to the linuxkpi folks. This type of information should be in the commit log in future commits. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Apr 10 18:10:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBAA0D37F09; Mon, 10 Apr 2017 18:10:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B871E378; Mon, 10 Apr 2017 18:10:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8A79F10A82D; Mon, 10 Apr 2017 14:10:05 -0400 (EDT) From: John Baldwin To: Jung-uk Kim Cc: Patrick Kelsey , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... Date: Mon, 10 Apr 2017 10:43:12 -0700 Message-ID: <3233183.B722KJrnTC@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <0da40261-7829-8d63-c4aa-775a028367a2@FreeBSD.org> References: <201704090200.v39203Vf072867@repo.freebsd.org> <0da40261-7829-8d63-c4aa-775a028367a2@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 10 Apr 2017 14:10:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 18:10:14 -0000 On Monday, April 10, 2017 01:23:04 PM Jung-uk Kim wrote: > On 04/08/2017 22:00, Patrick Kelsey wrote: > > Author: pkelsey > > Date: Sun Apr 9 02:00:03 2017 > > New Revision: 316648 > > URL: https://svnweb.freebsd.org/changeset/base/316648 > > > > Log: > > Corrected misspelled versions of rendezvous. > > > > The MFC will include a compat definition of smp_no_rendevous_barrier() > > that calls smp_no_rendezvous_barrier(). > > > > Reviewed by: gnn, kib > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D10313 > ... > > We knew about the problem but we didn't fix it because it breaks KPI. > For example, sysutils/virtualbox-ose-kmod. If you really want to MFC > this change, you have to implement shims. Also, the function isn't actually called, but is only used in comparisons in smp_rendezvous_action(). To do a compat shim you will need to either change these comparisons to compare against both function pointers or define the alternate symbol as an alias of the existing function. That only helps the KBI though. For the KPI would just use a #define to point to the new name. Also, as Jung-uk notes, this already breaks virtualbox on HEAD, so you will need to patch the port now, not only if you MFC. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Apr 10 18:21:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FFAD374EB; Mon, 10 Apr 2017 18:21:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB13CFA7; Mon, 10 Apr 2017 18:21:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AILVGn074190; Mon, 10 Apr 2017 18:21:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AILVs5074189; Mon, 10 Apr 2017 18:21:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704101821.v3AILVs5074189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Apr 2017 18:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316684 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 18:21:32 -0000 Author: emaste Date: Mon Apr 10 18:21:30 2017 New Revision: 316684 URL: https://svnweb.freebsd.org/changeset/base/316684 Log: Make WITHOUT_TOOLCHAIN imply WITHOUT_LLD. LLD is a toolchain component. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon Apr 10 17:59:29 2017 (r316683) +++ head/share/mk/src.opts.mk Mon Apr 10 18:21:30 2017 (r316684) @@ -408,6 +408,7 @@ MK_CLANG:= no MK_GCC:= no MK_GDB:= no MK_INCLUDES:= no +MK_LLD:= no MK_LLDB:= no .endif From owner-svn-src-all@freebsd.org Mon Apr 10 19:22:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89FC7D37D8D; Mon, 10 Apr 2017 19:22:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56FC71C8; Mon, 10 Apr 2017 19:22:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AJMF67001218; Mon, 10 Apr 2017 19:22:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AJMFEK001217; Mon, 10 Apr 2017 19:22:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704101922.v3AJMFEK001217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Apr 2017 19:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316685 - head/contrib/elftoolchain/libelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 19:22:16 -0000 Author: emaste Date: Mon Apr 10 19:22:15 2017 New Revision: 316685 URL: https://svnweb.freebsd.org/changeset/base/316685 Log: libelf: add an assert that msz is non-zero Reported by: Coverity CID: 976023 Modified: head/contrib/elftoolchain/libelf/elf_update.c Modified: head/contrib/elftoolchain/libelf/elf_update.c ============================================================================== --- head/contrib/elftoolchain/libelf/elf_update.c Mon Apr 10 18:21:30 2017 (r316684) +++ head/contrib/elftoolchain/libelf/elf_update.c Mon Apr 10 19:22:15 2017 (r316685) @@ -808,6 +808,7 @@ _libelf_write_scn(Elf *e, unsigned char assert(d->d_buf != NULL); assert(d->d_version == e->e_version); + assert(msz != 0); assert(d->d_size % msz == 0); nobjects = (size_t) (d->d_size / msz); From owner-svn-src-all@freebsd.org Mon Apr 10 19:40:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECB76D37591 for ; Mon, 10 Apr 2017 19:40:35 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B30F91C2 for ; Mon, 10 Apr 2017 19:40:35 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io0-x234.google.com with SMTP id a103so45058939ioj.1 for ; Mon, 10 Apr 2017 12:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YwLfaDvJ3jOj0sxFtz/I4C+OqWxRBYOhuoYPierNsYI=; b=AqaX/fO/hcZhWtSt6X2l+VrQ2JGChACMpwo6orE7ZlLhupRpf+ZBSnQmnpBJOE0zvG mFnnyou8Phj2Z1elB8rTop04Y8KSRulyiRXSJref/7hByh95QOjy5AZS1tT2xcs55fMO 3bluvHtZczhnw7N28a/cfcnBMXmVCBlzKNEOPeVNQYkgLnz+XZxLFcb6BF0nNWG3wNpP OhuN5BjG5MMh9+3ON+zItGc9Dy39xRTGL49U8qCy4SZy6b0A70zyT0gVFFWyvrKuMVUb k7w0gXk+NL0v92tbHWk98xd9vkKhkRDpWzJciG6x5ADeIAu1iude++cTDkmjr83mm9We GUmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=YwLfaDvJ3jOj0sxFtz/I4C+OqWxRBYOhuoYPierNsYI=; b=G2omi4amGBHWRfgE0ykixNbGCn3OM0jc6QK4mDHyFnxHVFnb7zlCQG7yB59RtMVGvx 44Ef+vcPNi8l6vkJB8vZstpHZxgkistQ2NLAmM5dEAWhuiKR1og0y4gqRpKfiiEyyt3R tqxPINxHsUTVLu+RDGXy0a+FkHWWvlPcMH1rKyQZIiTxuPwzURx9x3Z9m/C0oa/9puOT ARpjGnqyznIado4BKujFD4ou5R8DT9cqA6xoHMhlLJqbP/xzFhjpOddMlYdkTAqkooYt vliPUW5k5pqP8lbyikA6oIaroWuf+AnyfP4C2JKgDKO0aAr18yIE7UZahPSdKNl4NZSX 41zw== X-Gm-Message-State: AN3rC/4Q87fxgVMkxL8zYIhLE/CXt0CQQauLbsRneTOV1u/GDCxdttzzsJLhBDlaHcViDMj/AkWiJpKaIBE0TjJo X-Received: by 10.36.170.68 with SMTP id y4mr13297852iti.7.1491853234973; Mon, 10 Apr 2017 12:40:34 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.112.210 with HTTP; Mon, 10 Apr 2017 12:40:34 -0700 (PDT) In-Reply-To: References: From: Maxim Sobolev Date: Mon, 10 Apr 2017 12:40:34 -0700 X-Google-Sender-Auth: QeyKm__Oqj-uId0iQMz0NyIxWCw Message-ID: Subject: Re: On shutting down UDP socket [Re: svn commit: r285910 - in head: lib/libc/sys sys/kern sys/sys] To: Ed Schouten Cc: Alexander Kabaev , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, mjg@freebsd.org, gnn@freebsd.org, FreeBSD Net Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 19:40:36 -0000 JFYI. I've opened a follow-up differential for this potential regression: https://reviews.freebsd.org/D10351 Thanks! -Max On Mon, Apr 10, 2017 at 7:43 AM, Maxim Sobolev wrote: > Hi Guys, I am sorry to bring this old thread up, but I think Ed's > comparison with other OSes here and in the relevant differential was not > entirely correct. What linux does (tested with 4.4.0) when UDP socket is > shut down is actually shutting down receiving end, so any threads that are > blocked in recv() on that socket return. Still shutdown() system call > itself returns ENOTCONN. FreeBSD on the other hand does not do anything for > the socket, so that the threads just hang. I am pretty sure there are at > least some software out there that relies on that behavior, at least in our > case we do. Bumped into this after upgrading to the 11.0. > > Therefore, I am curious about possibility to make our behavior match that > of Linux's, so we are not the odd one with regards to this, that is return > an error but still shutdown the socket? > > Small test case is attached. Both FreeBSD 10.3 and Linux 4.4.0 pass > (albeit Linux's shutdown() returns with an error), FreeBSD 11.0 fails. > > -Max > > On Sun, Aug 9, 2015 at 6:08 AM, Ed Schouten wrote: > >> Hi Alexander, >> >> 2015-08-09 14:55 GMT+02:00 Alexander Kabaev : >> > On Sun, 9 Aug 2015 09:37:13 +0200 >> > It most definitely does work, this is what I have done to get my >> > network scripts work again. I wonder if there are other means of >> > restricting raw sockets that can be used to achieve the result >> > authors of rtsold had hoped or? >> >> Yes, there sure are. We could for example call cap_rights_limit() on >> the socket and whitelist the exacty set of actions that the program >> needs. >> >> That said, it wouldn't make a difference in the end. It looks like >> rtsol/rtsold don't seem to drop any privileges or switch credentials >> after startup, assuming I haven't overlooked anything. Even if we were >> to restrict the raw socket, the process could always open a new one >> later on. >> >> I think it would make sense for now to just commit the patch that I >> proposed. Will push it into the tree tomorrow. >> >> Thanks, >> -- >> Ed Schouten >> Nuxi, 's-Hertogenbosch, the Netherlands >> KvK/VAT number: 62051717 >> >> > From owner-svn-src-all@freebsd.org Mon Apr 10 20:26:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3058AD38BD8; Mon, 10 Apr 2017 20:26:05 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F372FCAB; Mon, 10 Apr 2017 20:26:04 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: by mail-pg0-x242.google.com with SMTP id o123so27070116pga.1; Mon, 10 Apr 2017 13:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2MKwh83P0V6tdM0xOKCyMmLz3e4eJn92TpXzNxxV6K4=; b=R13nbTPkXGYKJNI6EYBgXmvhImebHduG6ym3CZb7ToYg4qwtiw7SL+uQNO/PWup3/Y 6bH4+6tfo8hmbUU7Px+aSEZfQiIpkcnX5LXwSPxxeJIibYEPpAkmLlLJBchV0ucA5D6B Z8TUJmt97POzLeIttmqcwDQW+iHPU8ET2IEUhrLfZdoAswQKeq3sz9izOCTbFygCtUW6 q02jpXpPOOop2EG+D7BI/T2UOul84qfQJTt9w8289AbttRahimbmfbs4NGhb+tt07ksY fa5hjGkW+UYBcuX9a0AqtjxZJBUx0ioe+PPcB5lnFSwV9g3IHw3B/zCAxbwwbuzrb1cM /Haw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2MKwh83P0V6tdM0xOKCyMmLz3e4eJn92TpXzNxxV6K4=; b=s73cVCVQYgzECDjtZPX9+GXEH7zRMhcGyNy0IS6yjHvn0wMmTimkdUQ8GmYln7w2OC 8oxMiFmvhZ+SKlhoZXbOO9qaRg8Lt+frSFTNUpZGJ+Z8xghIdu/Z65KHILJkoMRQiEnG a7QOlF/4qsZj08GwpqQMvOVF06JjXCYMKgu5X4bxWNQCB4HufA3kYeKPlC7auUnDhoJ2 zZH3MrbEMo2gRF35fxH8bknsx0lE/trKl0G2VnP12cAbW3RLK40hkqVZupbXAM7TbT1A TbDi/qzLmMYpHBbih2RWSUKG7Lq9f1TviilicAHncPCx6un5mImh005elUlpoAj93YXI ZycA== X-Gm-Message-State: AFeK/H2t2d7mTScUu8Ud1tMeKoK45Ix3SyeqZXIzo3BlhxrlGm0F4pcCIBYVfZQj0CxcGXxcrO+MsGi5J+aDdg== X-Received: by 10.98.11.218 with SMTP id 87mr55227440pfl.214.1491855964432; Mon, 10 Apr 2017 13:26:04 -0700 (PDT) MIME-Version: 1.0 Sender: pkelsey@gmail.com Received: by 10.100.162.34 with HTTP; Mon, 10 Apr 2017 13:26:03 -0700 (PDT) In-Reply-To: <3233183.B722KJrnTC@ralph.baldwin.cx> References: <201704090200.v39203Vf072867@repo.freebsd.org> <0da40261-7829-8d63-c4aa-775a028367a2@FreeBSD.org> <3233183.B722KJrnTC@ralph.baldwin.cx> From: Patrick Kelsey Date: Mon, 10 Apr 2017 16:26:03 -0400 X-Google-Sender-Auth: n2cwKOQheJKgt8BaYt0iDis21Ak Message-ID: Subject: Re: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... To: John Baldwin Cc: Jung-uk Kim , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 20:26:05 -0000 On Mon, Apr 10, 2017 at 1:43 PM, John Baldwin wrote: > On Monday, April 10, 2017 01:23:04 PM Jung-uk Kim wrote: > > On 04/08/2017 22:00, Patrick Kelsey wrote: > > > Author: pkelsey > > > Date: Sun Apr 9 02:00:03 2017 > > > New Revision: 316648 > > > URL: https://svnweb.freebsd.org/changeset/base/316648 > > > > > > Log: > > > Corrected misspelled versions of rendezvous. > > > > > > The MFC will include a compat definition of > smp_no_rendevous_barrier() > > > that calls smp_no_rendezvous_barrier(). > > > > > > Reviewed by: gnn, kib > > > MFC after: 1 week > > > Differential Revision: https://reviews.freebsd.org/D10313 > > ... > > > > We knew about the problem but we didn't fix it because it breaks KPI. > > For example, sysutils/virtualbox-ose-kmod. If you really want to MFC > > this change, you have to implement shims. > > Also, the function isn't actually called, but is only used in comparisons > in smp_rendezvous_action(). To do a compat shim you will need to either > change these comparisons to compare against both function pointers or > define the alternate symbol as an alias of the existing function. That > only helps the KBI though. For the KPI would just use a #define to point > to the new name. > That's a good point about the comparisons in smp_rendezvous_action() - if I had managed to miss that detail all the way through the compat shim implementation, it would have littered pointless empty function invocations and atomic increments into all the uses of smp_rendezvous() that used smp_no_rendezvous_barrier for at least one of the stages. I don't think we have an established place to define machine-independent symbol aliases. Approaching that through linker scripts would require spamming a PROVIDE() statement into each of the arch-specific scripts. Since this is a function, I think a better way than the symbol alias + #define approach would be to just define a function pointer called smp_no_rendevous_barrier that gets statically initialized to smp_no_rendezvous_barrier. In that case, the extern decl takes care of the KPI, the corresponding symbol definition takes care of the KBI, and it has a minimal, MI, code footprint. > > Also, as Jung-uk notes, this already breaks virtualbox on HEAD, so you will > need to patch the port now, not only if you MFC. Either that, or I relax the goal of purging it entirely and put the compat shim in current also to sidestep the port-patching issue. -Patrick From owner-svn-src-all@freebsd.org Mon Apr 10 20:30:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BCD2D38CC2; Mon, 10 Apr 2017 20:30:40 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8ECFE85; Mon, 10 Apr 2017 20:30:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x234.google.com with SMTP id r16so55208673ioi.2; Mon, 10 Apr 2017 13:30:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4C63+u220a3RBK6g+JVqephf5WC3JWUnEA42EVvWGlQ=; b=Jpl8QnHgF/J8e1Mr7QLdfIkTQfLfiggwweEaX1ZKAKlUcPG2NxPuWmnovrSEUhypK+ /NByEUsImTNp9HlEHq87xgSn/wsvl6XOA6vBlyleVBYHJRxxjQCpUrpam/JugAEECwgp dXCX1awyZXzNfkI2QEWUuWizfABRMcvtJIHjOHq0H6JzogvDMDFqv+01uUHDYJUEtdHG dJ9ZEBlaNlNzb/i17gzw3NSiyg1+bKAdE1CgkHJ4jf2seFif88YqMNr+7b9ETszW8tc1 +8LQW13XL54D+meGSzruJmgpChZHgnViYaEN1t4EoLKg81G3Kc5iGZPWXtgLal1aqkXZ SCjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4C63+u220a3RBK6g+JVqephf5WC3JWUnEA42EVvWGlQ=; b=YoOhNKsygp+MW7TEjE8AYOkTWNOg5EPcjE2nSsEtIiBrsCziyLvoeYkYzbgerTahzg Z92NPyckQXJDXxnQYcG+jFD4dh3EFprqYGwmsuMq7G0n8xDtldCAetUFyvVvY2yigWf2 hsZd2IV0YkYnZ0pLKYhZCE9Cs4ddcGrnQw0buPWixnFkrhmUMxO6S0Ssup+cRLDT/eGI DEi8vMzacovVAwzUDfLO32Q7azjQUlHSVt0yyAO9EMOKmSc2nuh9577/ZFyvkXVqLYsT gmQHrUTtUee/ZOrQh2oxpjhsUDYoLl7aqj+6Whl6FZlLiIbvlqT2rCjPHzNV5nPgaa8L fb7g== X-Gm-Message-State: AFeK/H2jNpkoxy9wBkXR+nBsqzNh2KMKuZSztMz6Bf/aADz2ryq2qr4ErGP2uVOoCvdh4JRWzMVz7CYpCvqPfw== X-Received: by 10.107.37.12 with SMTP id l12mr50790029iol.159.1491856239096; Mon, 10 Apr 2017 13:30:39 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.209 with HTTP; Mon, 10 Apr 2017 13:30:18 -0700 (PDT) In-Reply-To: <201704092102.v39L25oh040066@repo.freebsd.org> References: <201704092102.v39L25oh040066@repo.freebsd.org> From: Ed Maste Date: Mon, 10 Apr 2017 16:30:18 -0400 X-Google-Sender-Auth: ZLSslqDLjLxr0aVNhN1pq3ls7js Message-ID: Subject: Re: svn commit: r316665 - in head/sys: compat/linuxkpi/common/src contrib/ck/include contrib/ck/src To: Olivier Houchard Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 20:30:40 -0000 On 9 April 2017 at 17:02, Olivier Houchard wrote: > > Author: cognet > Date: Sun Apr 9 21:02:05 2017 > New Revision: 316665 > URL: https://svnweb.freebsd.org/changeset/base/316665 > > Log: > Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32 > This brings us changes we needed in ck_epoch. My tinderbox build now fails when building MIPS kernels, e.g. from _.mips.OCTEON1: ck_epoch.o: In function `ck_epoch_poll': /scratch/tmp/emaste/freebsd/sys/contrib/ck/src/ck_epoch.c:(.text+0x4b4): undefined reference to `__sync_bool_compare_and_swap_4' /scratch/tmp/emaste/freebsd/sys/contrib/ck/src/ck_epoch.c:(.text+0x4b4): relocation truncated to fit: R_MIPS_26 against `__sync_bool_compare_and_swap_4' From owner-svn-src-all@freebsd.org Mon Apr 10 20:30:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE76ED38D14; Mon, 10 Apr 2017 20:30:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CD74FF0; Mon, 10 Apr 2017 20:30:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x234.google.com with SMTP id f133so106694229qke.2; Mon, 10 Apr 2017 13:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ez25hHZP3AJRq5Hor/ZNxOVVQ8qkYfn3kUH33O1WuJQ=; b=JwWf7LZFLXh5XPVRbPwizZz5TgBHq9VsZuBhPZpFZbtTtK/Pw2abzqSr0nA+UQcbzl FTrvYsirFnV1kOjY7A8VWO1bsnjixD7f8UZH7heQD3cJOPWY44/ady0ebXYv6fQ4jx9V yu/KgBmnTgbzHxSDuaOVQyDf53FM/9VbpRjxGy9fVaUl5dPtlun6UhZjBVuOfyfILerD /s01DhG21S62Sa7buAfWNZeFDcOPB7AnTMoeJq9r7AqiIohrKL+e55hBbN8sSzbcCYyM mx1YRXLZODb5+1QUUatcxr5x0C25lSi19U+38hbL+FcALkRSOfq3HTPfUIo7NFGz4fhG h3NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ez25hHZP3AJRq5Hor/ZNxOVVQ8qkYfn3kUH33O1WuJQ=; b=ivscglHeaumvm8BZQvvVmC+i8A8jnQl5RnWw9feI3v9X2E5uuNeQsH11b9XaFFTtpk Sx0MPY7krCI8O4eSBek7f084SnUtJGBZ8qf4I+GHvj66dyezmGwIlztl3jOCPELJ+9rR hmI5JCqUtIWfGPGGhBN6fnKyfCvy2ejQ4kaJqgTJDhD/CqFsUqS2q55oTGoATlXGQ+1r Bz9tXhdpCnFfG2iMJgdGGijHsz88UHZHbBNkTXx0+c5lq95f/B0e34RC6oLtD8OnnSrU uRTk9I/nBJ/mblmh3+la/Eruib+UUfYkZ15cLxqKVcpFvPuRX33HdMabBZVVBkIh6uq9 +W7w== X-Gm-Message-State: AFeK/H1v+PQD+Jr+EBwbY/vuICD1Zqmiml7FIH9QqFQnhxGe1wGjQPmDqDO5ceECCJm0SVkiL2fSUxVJruti4A== X-Received: by 10.55.18.91 with SMTP id c88mr50089512qkh.3.1491856257419; Mon, 10 Apr 2017 13:30:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.93.83 with HTTP; Mon, 10 Apr 2017 13:30:57 -0700 (PDT) In-Reply-To: <201704101821.v3AILVs5074189@repo.freebsd.org> References: <201704101821.v3AILVs5074189@repo.freebsd.org> From: Ngie Cooper Date: Mon, 10 Apr 2017 13:30:57 -0700 Message-ID: Subject: Re: svn commit: r316684 - head/share/mk To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 20:30:58 -0000 On Mon, Apr 10, 2017 at 11:21 AM, Ed Maste wrote: > Author: emaste > Date: Mon Apr 10 18:21:30 2017 > New Revision: 316684 > URL: https://svnweb.freebsd.org/changeset/base/316684 > > Log: > Make WITHOUT_TOOLCHAIN imply WITHOUT_LLD. > > LLD is a toolchain component. src.conf(5) needs to be regenerated now. -Ngie From owner-svn-src-all@freebsd.org Mon Apr 10 20:55:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD0D1D3746C; Mon, 10 Apr 2017 20:55:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF239AF; Mon, 10 Apr 2017 20:55:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AKtg8g040138; Mon, 10 Apr 2017 20:55:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AKtg4h040137; Mon, 10 Apr 2017 20:55:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704102055.v3AKtg4h040137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 10 Apr 2017 20:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316686 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 20:55:44 -0000 Author: markj Date: Mon Apr 10 20:55:42 2017 New Revision: 316686 URL: https://svnweb.freebsd.org/changeset/base/316686 Log: Add some bounds assertions to the vm_map_entry clip functions. Reviewed by: kib MFC after: 1 week Sponsored by: Dell EMC Isilon X-Differential Revision: https://reviews.freebsd.org/D10349 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Apr 10 19:22:15 2017 (r316685) +++ head/sys/vm/vm_map.c Mon Apr 10 20:55:42 2017 (r316686) @@ -1655,6 +1655,8 @@ _vm_map_clip_start(vm_map_t map, vm_map_ vm_map_entry_t new_entry; VM_MAP_ASSERT_LOCKED(map); + KASSERT(entry->end > start && entry->start < start, + ("_vm_map_clip_start: invalid clip of entry %p", entry)); /* * Split off the front portion -- note that we must insert the new @@ -1739,6 +1741,8 @@ _vm_map_clip_end(vm_map_t map, vm_map_en vm_map_entry_t new_entry; VM_MAP_ASSERT_LOCKED(map); + KASSERT(entry->start < end && entry->end > end, + ("_vm_map_clip_end: invalid clip of entry %p", entry)); /* * If there is no object backing this entry, we might as well create From owner-svn-src-all@freebsd.org Mon Apr 10 20:57:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28E88D3751F; Mon, 10 Apr 2017 20:57:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2BBD20E; Mon, 10 Apr 2017 20:57:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AKvGPd040268; Mon, 10 Apr 2017 20:57:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AKvGwp040267; Mon, 10 Apr 2017 20:57:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704102057.v3AKvGwp040267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 10 Apr 2017 20:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316687 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 20:57:18 -0000 Author: markj Date: Mon Apr 10 20:57:16 2017 New Revision: 316687 URL: https://svnweb.freebsd.org/changeset/base/316687 Log: Consistently use for-loops in vm_map_protect(). No functional change. Reviewed by: kib MFC after: 1 week Sponsored by: Dell EMC Isilon X-Differential Revision: https://reviews.freebsd.org/D10349 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Apr 10 20:55:42 2017 (r316686) +++ head/sys/vm/vm_map.c Mon Apr 10 20:57:16 2017 (r316687) @@ -1976,8 +1976,8 @@ vm_map_protect(vm_map_t map, vm_offset_t /* * Make a first pass to check for protection violations. */ - current = entry; - while ((current != &map->header) && (current->start < end)) { + for (current = entry; current != &map->header && current->start < end; + current = current->next) { if (current->eflags & MAP_ENTRY_IS_SUB_MAP) { vm_map_unlock(map); return (KERN_INVALID_ARGUMENT); @@ -1986,17 +1986,15 @@ vm_map_protect(vm_map_t map, vm_offset_t vm_map_unlock(map); return (KERN_PROTECTION_FAILURE); } - current = current->next; } - /* * Do an accounting pass for private read-only mappings that * now will do cow due to allowed write (e.g. debugger sets * breakpoint on text segment) */ - for (current = entry; (current != &map->header) && - (current->start < end); current = current->next) { + for (current = entry; current != &map->header && current->start < end; + current = current->next) { vm_map_clip_end(map, current, end); @@ -2049,8 +2047,8 @@ vm_map_protect(vm_map_t map, vm_offset_t * Go back and fix up protections. [Note that clipping is not * necessary the second time.] */ - current = entry; - while ((current != &map->header) && (current->start < end)) { + for (current = entry; current != &map->header && current->start < end; + current = current->next) { old_prot = current->protection; if (set_max) @@ -2084,7 +2082,6 @@ vm_map_protect(vm_map_t map, vm_offset_t #undef MASK } vm_map_simplify_entry(map, current); - current = current->next; } vm_map_unlock(map); return (KERN_SUCCESS); From owner-svn-src-all@freebsd.org Mon Apr 10 21:00:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0B59D377AC; Mon, 10 Apr 2017 21:00:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BCFB961; Mon, 10 Apr 2017 21:00:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AL0lD5041546; Mon, 10 Apr 2017 21:00:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AL0lJX041545; Mon, 10 Apr 2017 21:00:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704102100.v3AL0lJX041545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Apr 2017 21:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316688 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 21:00:48 -0000 Author: emaste Date: Mon Apr 10 21:00:47 2017 New Revision: 316688 URL: https://svnweb.freebsd.org/changeset/base/316688 Log: regenerate src.conf.5 after r316647 and r316684 Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Apr 10 20:57:16 2017 (r316687) +++ head/share/man/man5/src.conf.5 Mon Apr 10 21:00:47 2017 (r316688) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 315768 2017-03-23 02:26:15Z ngie .\" $FreeBSD$ -.Dd March 22, 2017 +.Dd April 10, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -197,7 +197,7 @@ as part of the bootstrap process. This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_BLACKLIST -.\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST 313169 2017-02-03 19:09:46Z wblock Set this if you do not want to build blacklistd/blacklistctl. When set, it enforces these options: .Pp @@ -278,7 +278,7 @@ When set, it enforces these options: .\" from FreeBSD: head/tools/build/options/WITHOUT_CASPER 258838 2013-12-02 08:21:28Z pjd Set to not build Casper program and related libraries. .It Va WITH_CCACHE_BUILD -.\" from FreeBSD: head/tools/build/options/WITH_CCACHE_BUILD 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITH_CCACHE_BUILD 313169 2017-02-03 19:09:46Z wblock Set to use .Xr ccache 1 for the build. @@ -354,7 +354,7 @@ Set to build the Clang C/C++ compiler du This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_CLANG_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 313169 2017-02-03 19:09:46Z wblock Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. To be able to build the system, either gcc or clang bootstrap must be @@ -410,7 +410,7 @@ amd64/amd64, arm/arm, arm/armeb, arm/arm Set to not build .Xr cpp 1 . .It Va WITHOUT_CROSS_COMPILER -.\" from FreeBSD: head/tools/build/options/WITHOUT_CROSS_COMPILER 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_CROSS_COMPILER 313169 2017-02-03 19:09:46Z wblock Set to not build any cross compiler in the cross-tools stage of buildworld. When compiling a different version of .Fx @@ -520,7 +520,7 @@ When set, it enforces these options: Set to avoid building or installing standalone debug files for each executable binary and shared library. .It Va WITHOUT_DIALOG -.\" from FreeBSD: head/tools/build/options/WITHOUT_DIALOG 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_DIALOG 313169 2017-02-03 19:09:46Z wblock Set to not build .Xr dialog 1 , .Xr dialog 3 , @@ -537,7 +537,7 @@ When set, it enforces these options: .\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. .It Va WITH_DIRDEPS_BUILD -.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_BUILD 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_BUILD 313169 2017-02-03 19:09:46Z wblock This is an experimental build system. For details see http://www.crufty.net/sjg/docs/freebsd-meta-mode.htm. @@ -625,10 +625,10 @@ This must be set in the environment, mak not .Pa /etc/src.conf . .It Va WITHOUT_DMAGENT -.\" from FreeBSD: head/tools/build/options/WITHOUT_DMAGENT 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_DMAGENT 313169 2017-02-03 19:09:46Z wblock Set to not build dma Mail Transport Agent. .It Va WITHOUT_DOCCOMPRESS -.\" from FreeBSD: head/tools/build/options/WITHOUT_DOCCOMPRESS 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_DOCCOMPRESS 313169 2017-02-03 19:09:46Z wblock Set to not install compressed system documentation. Only the uncompressed version will be installed. .It Va WITH_DTRACE_TESTS @@ -835,7 +835,7 @@ Set to not build .Xr gpioctl 8 as part of the base system. .It Va WITHOUT_GPL_DTC -.\" from FreeBSD: head/tools/build/options/WITHOUT_GPL_DTC 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_GPL_DTC 313169 2017-02-03 19:09:46Z wblock Set to build the BSD licensed version of the device tree compiler rather than the GPLed one from elinux.org. .It Va WITHOUT_GROFF @@ -904,7 +904,7 @@ Set to not build .\" from FreeBSD: head/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz Set to build libraries, programs, and kernel modules without IPv4 support. .It Va WITHOUT_INSTALLLIB -.\" from FreeBSD: head/tools/build/options/WITHOUT_INSTALLLIB 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_INSTALLLIB 313172 2017-02-03 19:21:28Z wblock Set this to not install optional libraries. For example, when creating a .Xr nanobsd 8 @@ -913,7 +913,7 @@ image. The option does not work for build targets. .Ef .It Va WITH_INSTALL_AS_USER -.\" from FreeBSD: head/tools/build/options/WITH_INSTALL_AS_USER 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITH_INSTALL_AS_USER 313169 2017-02-03 19:09:46Z wblock Set to make install targets succeed for non-root users by installing files with owner and group attributes set to that of the user running the @@ -953,7 +953,7 @@ Set to not build and .Xr truss 1 . .It Va WITHOUT_KERBEROS -.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS 313169 2017-02-03 19:09:46Z wblock Set this to not build Kerberos 5 (KTH Heimdal). When set, it enforces these options: .Pp @@ -1086,14 +1086,29 @@ Set to build the LLDB debugger. .Pp This is a default setting on amd64/amd64 and arm64/aarch64. +.It Va WITHOUT_LLD_BOOTSTRAP +.\" from FreeBSD: head/tools/build/options/WITHOUT_LLD_BOOTSTRAP 316647 2017-04-09 01:35:19Z emaste +Set to not build the LLD linker during the bootstrap phase of +the build. +To be able to build the system, either Binutils or LLD bootstrap must be +enabled unless an alternate linker is provided via XLD. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +.It Va WITH_LLD_BOOTSTRAP +.\" from FreeBSD: head/tools/build/options/WITH_LLD_BOOTSTRAP 316647 2017-04-09 01:35:19Z emaste +Set to build the LLD linker during the bootstrap phase of the build. +.Pp +This is a default setting on +arm64/aarch64. .It Va WITHOUT_LLD_IS_LD -.\" from FreeBSD: head/tools/build/options/WITHOUT_LLD_IS_LD 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_LLD_IS_LD 312855 2017-01-27 01:59:12Z emaste Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLD_IS_LD -.\" from FreeBSD: head/tools/build/options/WITH_LLD_IS_LD 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITH_LLD_IS_LD 312855 2017-01-27 01:59:12Z emaste Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp This is a default setting on @@ -1189,7 +1204,7 @@ Set to not build utilities for manual pa .Xr manctl 8 , and related support files. .It Va WITH_META_MODE -.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 313169 2017-02-03 19:09:46Z wblock Create .Xr make 1 meta files when building, which can provide a reliable incremental build when @@ -1524,7 +1539,7 @@ This must be set in the environment, mak not .Pa /etc/src.conf . .It Va WITH_STAGING_MAN -.\" from FreeBSD: head/tools/build/options/WITH_STAGING_MAN 313788 2017-02-16 04:21:24Z ngie +.\" from FreeBSD: head/tools/build/options/WITH_STAGING_MAN 313169 2017-02-03 19:09:46Z wblock Enable staging of man pages to stage tree. .It Va WITH_STAGING_PROG .\" from FreeBSD: head/tools/build/options/WITH_STAGING_PROG 284708 2015-06-22 20:21:57Z sjg @@ -1679,6 +1694,8 @@ When set, it enforces these options: .It .Va WITHOUT_INCLUDES .It +.Va WITHOUT_LLD +.It .Va WITHOUT_LLDB .El .It Va WITHOUT_UNBOUND @@ -1690,7 +1707,7 @@ and related programs. .\" from FreeBSD: head/tools/build/options/WITHOUT_USB 156932 2006-03-21 07:50:50Z ru Set to not build USB-related programs and libraries. .It Va WITHOUT_USB_GADGET_EXAMPLES -.\" from FreeBSD: head/tools/build/options/WITHOUT_USB_GADGET_EXAMPLES 311550 2017-01-06 21:27:39Z ngie +.\" from FreeBSD: head/tools/build/options/WITHOUT_USB_GADGET_EXAMPLES 311548 2017-01-06 21:08:19Z ngie Set to not build USB gadget kernel modules. .It Va WITHOUT_UTMPX .\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 231530 2012-02-11 20:28:42Z ed From owner-svn-src-all@freebsd.org Mon Apr 10 21:01:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1434DD3797F; Mon, 10 Apr 2017 21:01:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D806AC7B; Mon, 10 Apr 2017 21:01:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AL1gsJ042364; Mon, 10 Apr 2017 21:01:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AL1gdt042363; Mon, 10 Apr 2017 21:01:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704102101.v3AL1gdt042363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 10 Apr 2017 21:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316689 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 21:01:44 -0000 Author: markj Date: Mon Apr 10 21:01:42 2017 New Revision: 316689 URL: https://svnweb.freebsd.org/changeset/base/316689 Log: Busy the map in vm_map_protect(). We are otherwise susceptible to a race with a concurrent vm_map_wire(), which may drop the map lock to fault pages into the object chain. In particular, vm_map_protect() will only copy newly writable wired pages into the top-level object when MAP_ENTRY_USER_WIRED is set, but vm_map_wire() only sets this flag after its fault loop. We may thus end up with a writable wired entry whose top-level object does not contain the entire range of pages. Reported and tested by: pho Reviewed by: kib MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D10349 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Apr 10 21:00:47 2017 (r316688) +++ head/sys/vm/vm_map.c Mon Apr 10 21:01:42 2017 (r316689) @@ -1965,6 +1965,14 @@ vm_map_protect(vm_map_t map, vm_offset_t vm_map_lock(map); + /* + * Ensure that we are not concurrently wiring pages. vm_map_wire() may + * need to fault pages into the map and will drop the map lock while + * doing so, and the VM object may end up in an inconsistent state if we + * update the protection on the map entry in between faults. + */ + vm_map_wait_busy(map); + VM_MAP_RANGE_CHECK(map, start, end); if (vm_map_lookup_entry(map, start, &entry)) { From owner-svn-src-all@freebsd.org Mon Apr 10 21:14:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39B4FD37E05; Mon, 10 Apr 2017 21:14:01 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 038447C5; Mon, 10 Apr 2017 21:14:01 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x233.google.com with SMTP id a103so48218164ioj.1; Mon, 10 Apr 2017 14:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=D8BUkBmag+ffBLSojvAknC0bMQaV2vZf1Lec12rJ0ws=; b=A5XsEziN4/KdW0FxHLRvoy6PrJkihXhAHtPXr6j5S0eysGEEmYvJsiDL46JafXxh6H kpkV93AQtvVxQe5OCBApL6+X17yGtoVN7FhlnGl9aZFUGS4nc/sJ008WJi3H74af0Fdv nZtp2JSblSVp4Onxy8oV/vzLhhOhoaa7eX2oUFsub4Gs1uDWuw8uIOgm/JL0mx9ak8Ws b38MdHHWHSQNpYS5FMyGcnxfEmmun0GkCml70QqroPnee+TxSP4TJ/1YawxY2zt9a3+Q 3mqoQUwzN13GrIaMHH/wkuq0cxzimHJXuSJeXwRM7iOeDx0hfGVVbTIBPo6J6dMEw3la MYNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=D8BUkBmag+ffBLSojvAknC0bMQaV2vZf1Lec12rJ0ws=; b=k8HcyL8pkSzL/aIZA0zmaclcInnOfXnmkag8UoPXz47I9dR4Lo/NDscZ5cGS5hij00 DHC8bQ6l1zhNB5P9Zi6ZBcK1tBFeNfkEGNbPlFlkwWdfE93LJF4N9fTyLQkiqnu3+iAW E9KBCfYDAOjOm8fKBnw6atYx3cbfQ0lG1Sj0fkm2m4H4J1flzE17XHdAHMLd4VbV57Dn xL/it6JYw+M6Hk6HHEu2QPm13YYZSQDrFdDcnQz/zTSCKv1yNF57IEhcZx5ZoOihrfMk KoOYiRKUoVoNy/OE7+XYugDuF+FrYCzG0dUg5ISocvQZMIab6ipgmb7lfBreL6CvG7mq rCow== X-Gm-Message-State: AFeK/H2dpwUZWjZP0IEgwyd/m9OB/W2+RMeYZINsmVRUDRuo6E/nNKL1G4j3OvZfGLj99SJ4h3zwWfWAm28jLQ== X-Received: by 10.107.47.102 with SMTP id j99mr54159180ioo.52.1491858840156; Mon, 10 Apr 2017 14:14:00 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.209 with HTTP; Mon, 10 Apr 2017 14:13:39 -0700 (PDT) In-Reply-To: <201704102100.v3AL0lJX041545@repo.freebsd.org> References: <201704102100.v3AL0lJX041545@repo.freebsd.org> From: Ed Maste Date: Mon, 10 Apr 2017 17:13:39 -0400 X-Google-Sender-Auth: 8fEM9CxYwLhiponX4x2nS9jkiIw Message-ID: Subject: Re: svn commit: r316688 - head/share/man/man5 To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 21:14:01 -0000 On 10 April 2017 at 17:00, Ed Maste wrote: > Author: emaste > Date: Mon Apr 10 21:00:47 2017 > New Revision: 316688 > URL: https://svnweb.freebsd.org/changeset/base/316688 > ... > -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 313788 2017-02-16 04:21:24Z ngie > +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 313169 2017-02-03 19:09:46Z wblock It looks like several of these $FreeBSD$ entries on the individual WITH_/WITHOUT_ entries ended up with bogus rev numbers on the previous src.conf.5 regen so there are a number of spurious entries in this diff, but I confirmed that the content changes are as desired. I'd like to change makeman to eliminate the copied $FreeBSD$ content from each WITH_/WITHOUT_ block, leaving one $FreeBSD$ for the generated file as a whole. My initial motivation was to allow src.conf.5 to be generated in a git working tree or other VCS that does not expand the $FreeBSD$ tags, but it also eliminates spurious diffs when regenerating on a stable branch and would have avoided the spurious changes here. That change is in Phabricator review D7997: https://reviews.freebsd.org/D7997. From owner-svn-src-all@freebsd.org Mon Apr 10 21:26:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C39CED38329; Mon, 10 Apr 2017 21:26:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93B7AFEB; Mon, 10 Apr 2017 21:26:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3ALQbcw053346; Mon, 10 Apr 2017 21:26:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3ALQbvs053345; Mon, 10 Apr 2017 21:26:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704102126.v3ALQbvs053345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 10 Apr 2017 21:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316690 - head/contrib/ofed/libibverbs/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 21:26:38 -0000 Author: bdrewery Date: Mon Apr 10 21:26:37 2017 New Revision: 316690 URL: https://svnweb.freebsd.org/changeset/base/316690 Log: Fix build with LLD by removing duplicate symbols already in IBVERBS_1.0. Reviewed by: emaste MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D10352 Modified: head/contrib/ofed/libibverbs/src/libibverbs.map Modified: head/contrib/ofed/libibverbs/src/libibverbs.map ============================================================================== --- head/contrib/ofed/libibverbs/src/libibverbs.map Mon Apr 10 21:01:42 2017 (r316689) +++ head/contrib/ofed/libibverbs/src/libibverbs.map Mon Apr 10 21:26:37 2017 (r316690) @@ -77,12 +77,6 @@ IBVERBS_1.0 { IBVERBS_1.1 { global: - ibv_get_device_list; - ibv_free_device_list; - ibv_get_device_name; - ibv_get_device_guid; - ibv_open_device; - ibv_close_device; ibv_resolve_eth_gid; ibv_init_ah_from_wc; From owner-svn-src-all@freebsd.org Mon Apr 10 21:44:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BF38D3866D; Mon, 10 Apr 2017 21:44:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0429AF0; Mon, 10 Apr 2017 21:44:14 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3ALiEQd061568; Mon, 10 Apr 2017 21:44:14 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3ALiExG061567; Mon, 10 Apr 2017 21:44:14 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201704102144.v3ALiExG061567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 10 Apr 2017 21:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316691 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 21:44:15 -0000 Author: cognet Date: Mon Apr 10 21:44:13 2017 New Revision: 316691 URL: https://svnweb.freebsd.org/changeset/base/316691 Log: Provide some kind of __sync_bool_compare_and_swap_4(), as it is used by CK, and our gcc is too ancient to provide it. This should fix the build on mips. Modified: head/sys/mips/mips/stdatomic.c Modified: head/sys/mips/mips/stdatomic.c ============================================================================== --- head/sys/mips/mips/stdatomic.c Mon Apr 10 21:26:37 2017 (r316690) +++ head/sys/mips/mips/stdatomic.c Mon Apr 10 21:44:13 2017 (r316691) @@ -287,8 +287,8 @@ EMIT_BITWISE_FETCH_AND_OP_N(2, uint16_t, * 32-bit routines. */ -uint32_t -__sync_val_compare_and_swap_4(uint32_t *mem, uint32_t expected, +static __inline uint32_t +do_compare_and_swap_4(uint32_t *mem, uint32_t expected, uint32_t desired) { uint32_t old, temp; @@ -307,6 +307,23 @@ __sync_val_compare_and_swap_4(uint32_t * return (old); } +uint32_t +__sync_val_compare_and_swap_4(uint32_t *mem, uint32_t expected, + uint32_t desired) +{ + + return (do_compare_and_swap_4(mem, expected, desired)); +} + +bool +__sync_bool_compare_and_swap_4(uint32_t *mem, uint32_t expected, + uint32_t desired) +{ + + return (do_compare_and_swap_4(mem, expected, desired) == + desired); +} + #define EMIT_FETCH_AND_OP_4(name, op) \ uint32_t \ __sync_##name##_4(uint32_t *mem, uint32_t val) \ From owner-svn-src-all@freebsd.org Mon Apr 10 21:45:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11876D386CD; Mon, 10 Apr 2017 21:45:07 +0000 (UTC) (envelope-from cognet@ci0.org) Received: from kanar.ci0.org (kanar.ci0.org [IPv6:2001:bc8:35e6::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "sd-123398", Issuer "sd-123398" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ABCD8C4F; Mon, 10 Apr 2017 21:45:06 +0000 (UTC) (envelope-from cognet@ci0.org) Received: from kanar.ci0.org (pluxor@localhost [127.0.0.1]) by kanar.ci0.org (8.15.2/8.15.2) with ESMTPS id v3ALiweJ000385 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 10 Apr 2017 23:44:58 +0200 (CEST) (envelope-from cognet@ci0.org) Received: (from doginou@localhost) by kanar.ci0.org (8.15.2/8.15.2/Submit) id v3ALiveg000383; Mon, 10 Apr 2017 23:44:57 +0200 (CEST) (envelope-from cognet@ci0.org) X-Authentication-Warning: kanar.ci0.org: doginou set sender to cognet@ci0.org using -f Date: Mon, 10 Apr 2017 23:44:57 +0200 From: Olivier Houchard To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r316665 - in head/sys: compat/linuxkpi/common/src contrib/ck/include contrib/ck/src Message-ID: <20170410214457.GA357@ci0.org> References: <201704092102.v39L25oh040066@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 21:45:07 -0000 On Mon, Apr 10, 2017 at 04:30:18PM -0400, Ed Maste wrote: > On 9 April 2017 at 17:02, Olivier Houchard wrote: > > > > Author: cognet > > Date: Sun Apr 9 21:02:05 2017 > > New Revision: 316665 > > URL: https://svnweb.freebsd.org/changeset/base/316665 > > > > Log: > > Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32 > > This brings us changes we needed in ck_epoch. > > My tinderbox build now fails when building MIPS kernels, e.g. from > _.mips.OCTEON1: > > ck_epoch.o: In function `ck_epoch_poll': > /scratch/tmp/emaste/freebsd/sys/contrib/ck/src/ck_epoch.c:(.text+0x4b4): > undefined reference to `__sync_bool_compare_and_swap_4' > /scratch/tmp/emaste/freebsd/sys/contrib/ck/src/ck_epoch.c:(.text+0x4b4): > relocation truncated to fit: R_MIPS_26 against > `__sync_bool_compare_and_swap_4' Hi Ed, Sorry about that, it should be fixed now. Regards, Olivier From owner-svn-src-all@freebsd.org Mon Apr 10 21:49:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85E9DD387AE; Mon, 10 Apr 2017 21:49:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55171EDF; Mon, 10 Apr 2017 21:49:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3ALnZrX062245; Mon, 10 Apr 2017 21:49:35 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3ALnZYk062244; Mon, 10 Apr 2017 21:49:35 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704102149.v3ALnZYk062244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 10 Apr 2017 21:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316692 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 21:49:36 -0000 Author: rmacklem Date: Mon Apr 10 21:49:35 2017 New Revision: 316692 URL: https://svnweb.freebsd.org/changeset/base/316692 Log: Set initial values for nfsstatfs in the NFSv4 client. The AmazonEFS NFSv4.1 server does not support the FILES_FREE and FILES_TOTAL attributes. As such, an NFSv4.1 mount to the server would return garbage for these values. This patch initializes the fields of the nfsstatfs structure, so that "df" and friends will at least return consistent bogus values. This patch should have effect when mounting other NFSv4.1 servers. Reported by: cperciva MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Mon Apr 10 21:44:13 2017 (r316691) +++ head/sys/fs/nfs/nfs_commonsubs.c Mon Apr 10 21:49:35 2017 (r316692) @@ -888,6 +888,14 @@ nfsv4_loadattr(struct nfsrv_descript *nd pc->pc_caseinsensitive = 0; pc->pc_casepreserving = 1; } + if (sfp != NULL) { + sfp->sf_ffiles = UINT64_MAX; + sfp->sf_tfiles = UINT64_MAX; + sfp->sf_afiles = UINT64_MAX; + sfp->sf_fbytes = UINT64_MAX; + sfp->sf_tbytes = UINT64_MAX; + sfp->sf_abytes = UINT64_MAX; + } } /* From owner-svn-src-all@freebsd.org Mon Apr 10 22:46:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3E85D3788C; Mon, 10 Apr 2017 22:46:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95B6FF10; Mon, 10 Apr 2017 22:46:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AMkYMD087403; Mon, 10 Apr 2017 22:46:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AMkYt0087402; Mon, 10 Apr 2017 22:46:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704102246.v3AMkYt0087402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 10 Apr 2017 22:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316693 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 22:46:35 -0000 Author: pfg Date: Mon Apr 10 22:46:34 2017 New Revision: 316693 URL: https://svnweb.freebsd.org/changeset/base/316693 Log: 8046 Let calloc() do the multiplication in libzfs_fru_refresh https://github.com/illumos/illumos-gate/commit/5697e03e6e3e2697f56ae341c7c8ce79680d6a2e https://www.illumos.org/issues/8046 Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Approved by: Robert Mustacchi Author: Pedro Giffuni Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_fru.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_fru.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_fru.c Mon Apr 10 21:49:35 2017 (r316692) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_fru.c Mon Apr 10 22:46:34 2017 (r316693) @@ -282,7 +282,7 @@ libzfs_fru_refresh(libzfs_handle_t *hdl) if (hdl->libzfs_fru_hash == NULL && (hdl->libzfs_fru_hash = - calloc(ZFS_FRU_HASH_SIZE * sizeof (void *), 1)) == NULL) + calloc(ZFS_FRU_HASH_SIZE, sizeof (void *))) == NULL) return; /* From owner-svn-src-all@freebsd.org Mon Apr 10 22:47:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66F7AD37927; Mon, 10 Apr 2017 22:47:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E78DA9; Mon, 10 Apr 2017 22:47:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AMlJBD087479; Mon, 10 Apr 2017 22:47:19 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AMlJaw087476; Mon, 10 Apr 2017 22:47:19 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704102247.v3AMlJaw087476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 10 Apr 2017 22:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316694 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 22:47:20 -0000 Author: rmacklem Date: Mon Apr 10 22:47:18 2017 New Revision: 316694 URL: https://svnweb.freebsd.org/changeset/base/316694 Log: Fix a crash during unmount of an NFSv4.1 mount. Larry Rosenman reported a crash on freebsd-current@ which was caused by a premature release of the krpc backchannel socket structure. I believe this was caused by a race between the SVC_RELEASE() in clnt_vc.c and the xprt_unregister() in the higher layer (clnt_rc.c), which tried to lock the mutex in the xprt structure and crashed. This patch fixes this by removing the xprt_unregister() in the clnt_vc layer and allowing this to always be done by the clnt_rc (higher reconnect layer). Reported by: ler@lerctr.org Tested by: ler@letctr.org MFC after: 2 weeks Modified: head/sys/rpc/clnt_rc.c head/sys/rpc/clnt_vc.c Modified: head/sys/rpc/clnt_rc.c ============================================================================== --- head/sys/rpc/clnt_rc.c Mon Apr 10 22:46:34 2017 (r316693) +++ head/sys/rpc/clnt_rc.c Mon Apr 10 22:47:18 2017 (r316694) @@ -450,7 +450,6 @@ clnt_reconnect_control(CLIENT *cl, u_int case CLSET_BACKCHANNEL: xprt = (SVCXPRT *)info; - SVC_ACQUIRE(xprt); xprt_register(xprt); rc->rc_backchannel = info; break; Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Mon Apr 10 22:46:34 2017 (r316693) +++ head/sys/rpc/clnt_vc.c Mon Apr 10 22:47:18 2017 (r316694) @@ -790,7 +790,7 @@ clnt_vc_destroy(CLIENT *cl) sx_xlock(&xprt->xp_lock); mtx_lock(&ct->ct_lock); xprt->xp_p2 = NULL; - xprt_unregister(xprt); + sx_xunlock(&xprt->xp_lock); } if (ct->ct_socket) { @@ -800,10 +800,6 @@ clnt_vc_destroy(CLIENT *cl) } mtx_unlock(&ct->ct_lock); - if (xprt != NULL) { - sx_xunlock(&xprt->xp_lock); - SVC_RELEASE(xprt); - } mtx_destroy(&ct->ct_lock); if (so) { From owner-svn-src-all@freebsd.org Mon Apr 10 22:56:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D33DD37B2B; Mon, 10 Apr 2017 22:56:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5C3B88A; Mon, 10 Apr 2017 22:56:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AMucrm091690; Mon, 10 Apr 2017 22:56:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AMucPC091689; Mon, 10 Apr 2017 22:56:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704102256.v3AMucPC091689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 10 Apr 2017 22:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316695 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 22:56:40 -0000 Author: pfg Date: Mon Apr 10 22:56:38 2017 New Revision: 316695 URL: https://svnweb.freebsd.org/changeset/base/316695 Log: MFV r316693: 8046 Let calloc() do the multiplication in libzfs_fru_refresh https://github.com/illumos/illumos-gate/commit/5697e03e6e3e2697f56ae341c7c8ce79680d6a2e https://www.illumos.org/issues/8046 Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Approved by: Robert Mustacchi Author: Pedro Giffuni MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c Mon Apr 10 22:47:18 2017 (r316694) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c Mon Apr 10 22:56:38 2017 (r316695) @@ -282,7 +282,7 @@ libzfs_fru_refresh(libzfs_handle_t *hdl) if (hdl->libzfs_fru_hash == NULL && (hdl->libzfs_fru_hash = - calloc(ZFS_FRU_HASH_SIZE * sizeof (void *), 1)) == NULL) + calloc(ZFS_FRU_HASH_SIZE, sizeof (void *))) == NULL) return; /* From owner-svn-src-all@freebsd.org Tue Apr 11 00:05:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA715D38C81; Tue, 11 Apr 2017 00:05:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x22f.google.com (mail-qt0-x22f.google.com [IPv6:2607:f8b0:400d:c0d::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86A09B77; Tue, 11 Apr 2017 00:05:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x22f.google.com with SMTP id v3so69896876qtd.3; Mon, 10 Apr 2017 17:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bXPHlrA1BMk/qX3ci3IV5qssW47b5QzdqzO+XmEgUY4=; b=QHcYg/ARYg/TZVNYD/0i9JRm4lwdSQAfliCxUeOrxlWH3Uo9tu9MFlcyUNUrpLHCH8 aKw2e/8l26nzJEU7DXCldBlTbne62tbUeEjGSSJ/5lbBq2g4GY1Zs2fTxAf5PBtvv6if Fnpw7x8zfBtt2NfH/iJ2iWiVXgZbb+99MsjyKSE8/OfwDvXL1Hd7gqRtRNr5F+bm8ksf yS0U7VLJ56RUiYLyFza19kttzAH5dJsC9nhuFf+TFob9LYKee2Wr+6yOEuMt8mRRZyEa bVcWKN7DvgmNtmikR5agpoJjGATTPl/QnFnhbO/Y+MyBLC7Xvadi0slmup6mzy/Sx6D0 OJPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bXPHlrA1BMk/qX3ci3IV5qssW47b5QzdqzO+XmEgUY4=; b=P2mluyTNYFN5u0SspnffxcabaaRzophxsy4szJ/lJaLd9g3/tlZogZ3bHEBf+fYT2a Pdjhs753xnETtwP1c2BBomTSbTj4WtjGycRLiqOVjgXOBeWae7pukvwM7f+UFbMC78dw ICBzCCw4eqxKObEq8kHrDf9F5l58FaZK6G+tigKA+tf0i9Xb4VAcGfAD3CWcAiC2FWOx pGKuSbdmBWB/gGxPMecOGDqXm6irViq21RBookXw5wVgTyvoO/kvnyJ4WIsT5x0vjZup pTegIjzV32rmjYcbB8EMiqlgz07nRG4zSN7dwiyEI4+bjE3v3YF8+IFQV3eb9/kMXI3M Yt4Q== X-Gm-Message-State: AN3rC/45y9bqp4N3H3SAj9Lhen2pVikH+4UlTKeEQDJtaKR/7WhZJSS5b7FTkkJQQexY6F61QEPZH8uQP2TY5A== X-Received: by 10.200.37.136 with SMTP id e8mr8552233qte.30.1491869127527; Mon, 10 Apr 2017 17:05:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.93.83 with HTTP; Mon, 10 Apr 2017 17:05:27 -0700 (PDT) In-Reply-To: References: <201704102100.v3AL0lJX041545@repo.freebsd.org> From: Ngie Cooper Date: Mon, 10 Apr 2017 17:05:27 -0700 Message-ID: Subject: Re: svn commit: r316688 - head/share/man/man5 To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 00:05:28 -0000 On Mon, Apr 10, 2017 at 2:13 PM, Ed Maste wrote: ... > It looks like several of these $FreeBSD$ entries on the individual > WITH_/WITHOUT_ entries ended up with bogus rev numbers on the previous > src.conf.5 regen so there are a number of spurious entries in this > diff, but I confirmed that the content changes are as desired. > > I'd like to change makeman to eliminate the copied $FreeBSD$ content > from each WITH_/WITHOUT_ block, leaving one $FreeBSD$ for the > generated file as a whole. My initial motivation was to allow > src.conf.5 to be generated in a git working tree or other VCS that > does not expand the $FreeBSD$ tags, but it also eliminates spurious > diffs when regenerating on a stable branch and would have avoided the > spurious changes here. > > That change is in Phabricator review D7997: https://reviews.freebsd.org/D7997. The reason for the bogus $FreeBSD$ entries is actually because the files themselves are fixed in time (due to svn copy/svn switch'es and the like). Admittedly, this is a good case for getting rid of the RCS metadata altogether. Thanks! -Ngie From owner-svn-src-all@freebsd.org Tue Apr 11 05:24:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9032AD2FC48; Tue, 11 Apr 2017 05:24:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F41F8C4; Tue, 11 Apr 2017 05:24:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id F2F8C10A7B9; Tue, 11 Apr 2017 01:24:54 -0400 (EDT) From: John Baldwin To: Patrick Kelsey Cc: Jung-uk Kim , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... Date: Mon, 10 Apr 2017 22:24:38 -0700 Message-ID: <2086739.zQDsh9Zz6K@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201704090200.v39203Vf072867@repo.freebsd.org> <3233183.B722KJrnTC@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 11 Apr 2017 01:24:55 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 05:24:57 -0000 On Monday, April 10, 2017 04:26:03 PM Patrick Kelsey wrote: > On Mon, Apr 10, 2017 at 1:43 PM, John Baldwin wrote: > > > On Monday, April 10, 2017 01:23:04 PM Jung-uk Kim wrote: > > > On 04/08/2017 22:00, Patrick Kelsey wrote: > > > > Author: pkelsey > > > > Date: Sun Apr 9 02:00:03 2017 > > > > New Revision: 316648 > > > > URL: https://svnweb.freebsd.org/changeset/base/316648 > > > > > > > > Log: > > > > Corrected misspelled versions of rendezvous. > > > > > > > > The MFC will include a compat definition of > > smp_no_rendevous_barrier() > > > > that calls smp_no_rendezvous_barrier(). > > > > > > > > Reviewed by: gnn, kib > > > > MFC after: 1 week > > > > Differential Revision: https://reviews.freebsd.org/D10313 > > > ... > > > > > > We knew about the problem but we didn't fix it because it breaks KPI. > > > For example, sysutils/virtualbox-ose-kmod. If you really want to MFC > > > this change, you have to implement shims. > > > > Also, the function isn't actually called, but is only used in comparisons > > in smp_rendezvous_action(). To do a compat shim you will need to either > > change these comparisons to compare against both function pointers or > > define the alternate symbol as an alias of the existing function. That > > only helps the KBI though. For the KPI would just use a #define to point > > to the new name. > > > > That's a good point about the comparisons in smp_rendezvous_action() - if I > had managed to miss that detail all the way through the compat shim > implementation, it would have littered pointless empty function invocations > and atomic increments into all the uses of smp_rendezvous() that used > smp_no_rendezvous_barrier for at least one of the stages. > > I don't think we have an established place to define machine-independent > symbol aliases. Approaching that through linker scripts would require > spamming a PROVIDE() statement into each of the arch-specific scripts. > Since this is a function, I think a better way than the symbol alias + > #define approach would be to just define a function pointer called > smp_no_rendevous_barrier that gets statically initialized to > smp_no_rendezvous_barrier. In that case, the extern decl takes care of the > KPI, the corresponding symbol definition takes care of the KBI, and it has > a minimal, MI, code footprint. I was thinking something along the lines of __weak_reference() from sys/cdefs.h. Actually, maybe __strong_reference(smp_no_rendezvous, smp_no_rendevous_barrier) would be sufficient? > Either that, or I relax the goal of purging it entirely and put the compat > shim in current also to sidestep the port-patching issue. Well, I'd like to not have it live around forever, but we could add the compat shim to HEAD in the short term (also makes MFC slightly simpler as you just group the two commits together when you MFC). Once the port is patched with the updated FreeBSD_version we can remove the shim from HEAD. -- John Baldwin From owner-svn-src-all@freebsd.org Tue Apr 11 06:21:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5705D39A68; Tue, 11 Apr 2017 06:21:06 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D18CFFD; Tue, 11 Apr 2017 06:21:06 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id o126so11802874pfb.1; Mon, 10 Apr 2017 23:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=cFbAu4IRz2bq1VNmWydhWGGEuKEiVTawLVOdBnumFTY=; b=aQ7kvlQaKUAfBlmTiW2ciE3sDiOA56TpIu3z5eZkSWORZ2dni9qw5nDa+x5DbK/2kD 23yCIS5HNhUDiKHWFkvw7FATNwQwEecCbZjzwryAq5ghtmR1d5pHyij9iP5yaBbqJz61 y9ZklQ6NBgx1HhWr5dGXl7YahSMN6nm9x9ct6bTIoVAdL3hjq8Q0TRj811L8ZiFJAV7Y SjiNn0GkL0p491BDiYs8x6jLoE2dICus8AsivKYxzdspZxJxIaJjE3ckH1x8Kq+XGIya wWiWBEOz96UDVrXxytMbNKE5Yq2UaB2AtUTx7hq+QaQaAqJqYvurF89uaYNWThOyFGpE EmfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=cFbAu4IRz2bq1VNmWydhWGGEuKEiVTawLVOdBnumFTY=; b=SCFX62OXsylqMDYE1+B1LWb16kcddNKm3TELkARhhAmzQh45vJsGGvJ+33ascAsQFo 6iryCj+4omG/kEQkiAbpDf7Wt2/LCc1Hw9ZVouAm4sCuUJlBYbexpdbqACScAx5YVDG3 LK61g4uaeyDfADIPaiQ9vIy1VT10gzvsPQXTnI7IETi0hGyS0ODKmC82f3dIsBIsgVW5 6Le1HfPK3NzUE2LWBxpsFgXLQqFeqV6C3hnWN5eiqvRxfe2047iiRcjLqaLrKnjEMcYV xjgZEiBwfWpag2K0THUJLPr2PLP0SYQCGFKV8yBPVMuBUk9yTvvD7f46lI3+YvhucWNy 3hgA== X-Gm-Message-State: AFeK/H3euhwFYaHUxT9HQ7F5GnAzuRKkdzZzyZV+rUeOqIOVv83LgCEcN3V02dyZFcwG7Guxs/yWl7agL3qinw== X-Received: by 10.99.117.8 with SMTP id q8mr53551030pgc.106.1491891665796; Mon, 10 Apr 2017 23:21:05 -0700 (PDT) MIME-Version: 1.0 Sender: pkelsey@gmail.com Received: by 10.100.162.34 with HTTP; Mon, 10 Apr 2017 23:21:05 -0700 (PDT) In-Reply-To: <2086739.zQDsh9Zz6K@ralph.baldwin.cx> References: <201704090200.v39203Vf072867@repo.freebsd.org> <3233183.B722KJrnTC@ralph.baldwin.cx> <2086739.zQDsh9Zz6K@ralph.baldwin.cx> From: Patrick Kelsey Date: Tue, 11 Apr 2017 02:21:05 -0400 X-Google-Sender-Auth: hda3QoAVw-NhHhcV7RYBOt5ygHA Message-ID: Subject: Re: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... To: John Baldwin Cc: Jung-uk Kim , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 06:21:06 -0000 On Tue, Apr 11, 2017 at 1:24 AM, John Baldwin wrote: > On Monday, April 10, 2017 04:26:03 PM Patrick Kelsey wrote: > > On Mon, Apr 10, 2017 at 1:43 PM, John Baldwin wrote: > > > > > On Monday, April 10, 2017 01:23:04 PM Jung-uk Kim wrote: > > > > On 04/08/2017 22:00, Patrick Kelsey wrote: > > > > > Author: pkelsey > > > > > Date: Sun Apr 9 02:00:03 2017 > > > > > New Revision: 316648 > > > > > URL: https://svnweb.freebsd.org/changeset/base/316648 > > > > > > > > > > Log: > > > > > Corrected misspelled versions of rendezvous. > > > > > > > > > > The MFC will include a compat definition of > > > smp_no_rendevous_barrier() > > > > > that calls smp_no_rendezvous_barrier(). > > > > > > > > > > Reviewed by: gnn, kib > > > > > MFC after: 1 week > > > > > Differential Revision: https://reviews.freebsd.org/D10313 > > > > ... > > > > > > > > We knew about the problem but we didn't fix it because it breaks KPI. > > > > For example, sysutils/virtualbox-ose-kmod. If you really want to MFC > > > > this change, you have to implement shims. > > > > > > Also, the function isn't actually called, but is only used in > comparisons > > > in smp_rendezvous_action(). To do a compat shim you will need to > either > > > change these comparisons to compare against both function pointers or > > > define the alternate symbol as an alias of the existing function. That > > > only helps the KBI though. For the KPI would just use a #define to > point > > > to the new name. > > > > > > > That's a good point about the comparisons in smp_rendezvous_action() - > if I > > had managed to miss that detail all the way through the compat shim > > implementation, it would have littered pointless empty function > invocations > > and atomic increments into all the uses of smp_rendezvous() that used > > smp_no_rendezvous_barrier for at least one of the stages. > > > > I don't think we have an established place to define machine-independent > > symbol aliases. Approaching that through linker scripts would require > > spamming a PROVIDE() statement into each of the arch-specific scripts. > > Since this is a function, I think a better way than the symbol alias + > > #define approach would be to just define a function pointer called > > smp_no_rendevous_barrier that gets statically initialized to > > smp_no_rendezvous_barrier. In that case, the extern decl takes care of > the > > KPI, the corresponding symbol definition takes care of the KBI, and it > has > > a minimal, MI, code footprint. > > I was thinking something along the lines of __weak_reference() from > sys/cdefs.h. Actually, maybe > __strong_reference(smp_no_rendezvous, smp_no_rendevous_barrier) > would be sufficient? > > __strong_reference() is it. > > Either that, or I relax the goal of purging it entirely and put the > compat > > shim in current also to sidestep the port-patching issue. > > Well, I'd like to not have it live around forever, but we could add the > compat shim to HEAD in the short term (also makes MFC slightly simpler as > you just group the two commits together when you MFC). Once the port is > patched with the updated FreeBSD_version we can remove the shim from HEAD. > > So far it doesn't look like patching ports will be much of an issue. I extracted sources for all ports that contained INSTALL_KLD in their Makefile and grepped them for smp_no_rendevous - the only ports turned up that way are emulators/virtualbox-ose-additions and emulators/virtualbox-ose-kmod. One set of patches will serve both, and I've sent them off to the maintainers. -Patrick From owner-svn-src-all@freebsd.org Tue Apr 11 07:05:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD67D39483; Tue, 11 Apr 2017 07:05:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4623E9F4; Tue, 11 Apr 2017 07:05:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3B75tNc094740; Tue, 11 Apr 2017 07:05:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3B75tlV094739; Tue, 11 Apr 2017 07:05:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201704110705.v3B75tlV094739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 11 Apr 2017 07:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316696 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 07:05:56 -0000 Author: adrian Date: Tue Apr 11 07:05:55 2017 New Revision: 316696 URL: https://svnweb.freebsd.org/changeset/base/316696 Log: [net80211] refactor out "add slot" and "purge slot" for A-MPDU. This is in preparation for A-MSDU decap in A-MPDU support. * refactor out the code to purge a single reorder slot into ampdu_rx_purge_slot(). * refactor out the code to add a frame to the given reorder slot to ampdu_rx_add_slot(). This should be a big no-op as far as current code is concerned. Tested: * QCA9880v2, STA mode (11ac) * iwn(4), STA mode (11n) Reviewed by: avos Differential Revision: https://reviews.freebsd.org/D10328 Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Mon Apr 10 22:56:38 2017 (r316695) +++ head/sys/net80211/ieee80211_ht.c Tue Apr 11 07:05:55 2017 (r316696) @@ -513,23 +513,67 @@ ieee80211_decap_amsdu(struct ieee80211_n } /* + * Add the given frame to the current RX reorder slot. + * + * For future offloaded A-MSDU handling where multiple frames with + * the same sequence number show up here, this routine will append + * those frames as long as they're appropriately tagged. + */ +static int +ampdu_rx_add_slot(struct ieee80211_rx_ampdu *rap, int off, int tid, + ieee80211_seq rxseq, + struct ieee80211_node *ni, + struct mbuf *m) +{ + struct ieee80211vap *vap = ni->ni_vap; + + if (rap->rxa_m[off] == NULL) { + rap->rxa_m[off] = m; + rap->rxa_qframes++; + rap->rxa_qbytes += m->m_pkthdr.len; + vap->iv_stats.is_ampdu_rx_reorder++; + return (0); + } else { + IEEE80211_DISCARD_MAC(vap, + IEEE80211_MSG_INPUT | IEEE80211_MSG_11N, + ni->ni_macaddr, "a-mpdu duplicate", + "seqno %u tid %u BA win <%u:%u>", + rxseq, tid, rap->rxa_start, + IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1)); + vap->iv_stats.is_rx_dup++; + IEEE80211_NODE_STAT(ni, rx_dup); + m_freem(m); + return (-1); + } +} + +static void +ampdu_rx_purge_slot(struct ieee80211_rx_ampdu *rap, int i) +{ + struct mbuf *m; + + m = rap->rxa_m[i]; + if (m == NULL) + return; + + rap->rxa_m[i] = NULL; + rap->rxa_qbytes -= m->m_pkthdr.len; + rap->rxa_qframes--; + m_freem(m); +} + +/* * Purge all frames in the A-MPDU re-order queue. */ static void ampdu_rx_purge(struct ieee80211_rx_ampdu *rap) { - struct mbuf *m; int i; for (i = 0; i < rap->rxa_wnd; i++) { - m = rap->rxa_m[i]; - if (m != NULL) { - rap->rxa_m[i] = NULL; - rap->rxa_qbytes -= m->m_pkthdr.len; - m_freem(m); - if (--rap->rxa_qframes == 0) - break; - } + ampdu_rx_purge_slot(rap, i); + if (rap->rxa_qframes == 0) + break; } KASSERT(rap->rxa_qbytes == 0 && rap->rxa_qframes == 0, ("lost %u data, %u frames on ampdu rx q", @@ -949,23 +993,9 @@ again: rap->rxa_age = ticks; } - /* save packet */ - if (rap->rxa_m[off] == NULL) { - rap->rxa_m[off] = m; - rap->rxa_qframes++; - rap->rxa_qbytes += m->m_pkthdr.len; - vap->iv_stats.is_ampdu_rx_reorder++; - } else { - IEEE80211_DISCARD_MAC(vap, - IEEE80211_MSG_INPUT | IEEE80211_MSG_11N, - ni->ni_macaddr, "a-mpdu duplicate", - "seqno %u tid %u BA win <%u:%u>", - rxseq, tid, rap->rxa_start, - IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1)); - vap->iv_stats.is_rx_dup++; - IEEE80211_NODE_STAT(ni, rx_dup); - m_freem(m); - } + /* save packet - this consumes, no matter what */ + ampdu_rx_add_slot(rap, off, tid, rxseq, ni, m); + return CONSUMED; } if (off < IEEE80211_SEQ_BA_RANGE) { From owner-svn-src-all@freebsd.org Tue Apr 11 07:40:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A32BD39EEE; Tue, 11 Apr 2017 07:40:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1740DD90; Tue, 11 Apr 2017 07:40:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3B7ei5J010364; Tue, 11 Apr 2017 07:40:44 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3B7eiib010362; Tue, 11 Apr 2017 07:40:44 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704110740.v3B7eiib010362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 11 Apr 2017 07:40:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316697 - in stable/11: sbin/setkey sys/netipsec X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 07:40:45 -0000 Author: ae Date: Tue Apr 11 07:40:43 2017 New Revision: 316697 URL: https://svnweb.freebsd.org/changeset/base/316697 Log: MFC r316490: When we are doing SA lookup for TCP-MD5, check both source and destination addresses. Previous code has used only destination address for lookup. But for inbound packets the source address was used as SA destination address. Thus only outbound SA were used for both directions. Now we use addresses from a packet as is, thus SAs for both directions are needed. Reported by: Mike Tancsa MFC r316507,316508: In the example section show that TCP-MD5 connection needs SA for both directions. Use unique SPI. Modified: stable/11/sbin/setkey/setkey.8 stable/11/sys/netipsec/key.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/setkey/setkey.8 ============================================================================== --- stable/11/sbin/setkey/setkey.8 Tue Apr 11 07:05:55 2017 (r316696) +++ stable/11/sbin/setkey/setkey.8 Tue Apr 11 07:40:43 2017 (r316697) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2017 +.Dd April 5, 2017 .Dt SETKEY 8 .Os .\" @@ -696,6 +696,7 @@ spdadd 10.0.11.41/32[21] 10.0.11.33/32[a Use TCP MD5 between two numerically specified hosts: .Bd -literal -offset indent add 10.1.10.34 10.1.10.36 tcp 0x1000 -A tcp-md5 "TCP-MD5 BGP secret" ; +add 10.1.10.36 10.1.10.34 tcp 0x1001 -A tcp-md5 "TCP-MD5 BGP secret" ; .Ed .\" .Sh SEE ALSO Modified: stable/11/sys/netipsec/key.c ============================================================================== --- stable/11/sys/netipsec/key.c Tue Apr 11 07:05:55 2017 (r316696) +++ stable/11/sys/netipsec/key.c Tue Apr 11 07:40:43 2017 (r316697) @@ -863,7 +863,8 @@ key_allocsa_tcpmd5(struct secasindex *sa kdebug_secash(sah, " ")); if (sah->saidx.proto != IPPROTO_TCP) continue; - if (!key_sockaddrcmp(&saidx->dst.sa, &sah->saidx.dst.sa, 0)) + if (!key_sockaddrcmp(&saidx->dst.sa, &sah->saidx.dst.sa, 0) && + !key_sockaddrcmp(&saidx->src.sa, &sah->saidx.src.sa, 0)) break; } if (sah != NULL) { @@ -4962,7 +4963,8 @@ key_getsav_tcpmd5(struct secasindex *sai LIST_FOREACH(sah, SAHADDRHASH_HASH(saidx), addrhash) { if (sah->saidx.proto != IPPROTO_TCP) continue; - if (!key_sockaddrcmp(&saidx->dst.sa, &sah->saidx.dst.sa, 0)) + if (!key_sockaddrcmp(&saidx->dst.sa, &sah->saidx.dst.sa, 0) && + !key_sockaddrcmp(&saidx->src.sa, &sah->saidx.src.sa, 0)) break; } if (sah != NULL) { From owner-svn-src-all@freebsd.org Tue Apr 11 08:29:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F207D38F6C; Tue, 11 Apr 2017 08:29:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 015CE7A6; Tue, 11 Apr 2017 08:29:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3B8TDfb027806; Tue, 11 Apr 2017 08:29:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3B8TDge027805; Tue, 11 Apr 2017 08:29:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704110829.v3B8TDge027805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Apr 2017 08:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316698 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 08:29:14 -0000 Author: kib Date: Tue Apr 11 08:29:12 2017 New Revision: 316698 URL: https://svnweb.freebsd.org/changeset/base/316698 Log: Remove debugging printf. Instead, issue a diagnostic and return appropriate error if ncl_flush() was unable to clean buffer queue after the specified number or retries. Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Tue Apr 11 07:40:43 2017 (r316697) +++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Apr 11 08:29:12 2017 (r316698) @@ -2971,14 +2971,17 @@ done: free(bvec, M_TEMP); if (error == 0 && commit != 0 && waitfor == MNT_WAIT && (bo->bo_dirty.bv_cnt != 0 || bo->bo_numoutput != 0 || - np->n_directio_asyncwr != 0) && trycnt++ < 5) { - /* try, try again... */ - passone = 1; - wcred = NULL; - bvec = NULL; - bvecsize = 0; -printf("try%d\n", trycnt); - goto again; + np->n_directio_asyncwr != 0)) { + if (trycnt++ < 5) { + /* try, try again... */ + passone = 1; + wcred = NULL; + bvec = NULL; + bvecsize = 0; + goto again; + } + vn_printf(vp, "ncl_flush failed"); + error = called_from_renewthread != 0 ? EIO : EBUSY; } return (error); } From owner-svn-src-all@freebsd.org Tue Apr 11 08:56:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D3EED377E5; Tue, 11 Apr 2017 08:56:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 479C47FA; Tue, 11 Apr 2017 08:56:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3B8uJ0j039809; Tue, 11 Apr 2017 08:56:19 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3B8uJq5039806; Tue, 11 Apr 2017 08:56:19 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704110856.v3B8uJq5039806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 11 Apr 2017 08:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316699 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 08:56:20 -0000 Author: ae Date: Tue Apr 11 08:56:18 2017 New Revision: 316699 URL: https://svnweb.freebsd.org/changeset/base/316699 Log: Do not adjust interface MTU automatically. Leave this task to the system administrator. This restores the behavior that was prior to r274246. No objection from: #network MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10215 Modified: head/sys/net/if_gre.c head/sys/net/if_gre.h head/sys/net/if_me.c Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Tue Apr 11 08:29:12 2017 (r316698) +++ head/sys/net/if_gre.c Tue Apr 11 08:56:18 2017 (r316699) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define GREMTU 1500 +#define GREMTU 1476 static const char grename[] = "gre"; static MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation"); static VNET_DEFINE(struct mtx, gre_mtx); @@ -173,7 +173,7 @@ gre_clone_create(struct if_clone *ifc, i GRE2IFP(sc)->if_softc = sc; if_initname(GRE2IFP(sc), grename, unit); - GRE2IFP(sc)->if_mtu = sc->gre_mtu = GREMTU; + GRE2IFP(sc)->if_mtu = GREMTU; GRE2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST; GRE2IFP(sc)->if_output = gre_output; GRE2IFP(sc)->if_ioctl = gre_ioctl; @@ -231,7 +231,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, /* XXX: */ if (ifr->ifr_mtu < 576) return (EINVAL); - break; + ifp->if_mtu = ifr->ifr_mtu; + return (0); case SIOCSIFADDR: ifp->if_flags |= IFF_UP; case SIOCSIFFLAGS: @@ -255,12 +256,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, } error = 0; switch (cmd) { - case SIOCSIFMTU: - GRE_WLOCK(sc); - sc->gre_mtu = ifr->ifr_mtu; - gre_updatehdr(sc); - GRE_WUNLOCK(sc); - goto end; case SIOCSIFPHYADDR: #ifdef INET6 case SIOCSIFPHYADDR_IN6: @@ -549,7 +544,6 @@ gre_updatehdr(struct gre_softc *sc) } else sc->gre_oseq = 0; gh->gre_flags = htons(flags); - GRE2IFP(sc)->if_mtu = sc->gre_mtu - sc->gre_hlen; } static void Modified: head/sys/net/if_gre.h ============================================================================== --- head/sys/net/if_gre.h Tue Apr 11 08:29:12 2017 (r316698) +++ head/sys/net/if_gre.h Tue Apr 11 08:56:18 2017 (r316699) @@ -69,7 +69,6 @@ struct gre_softc { uint32_t gre_oseq; uint32_t gre_key; uint32_t gre_options; - uint32_t gre_mtu; u_int gre_fibnum; u_int gre_hlen; /* header size */ union { Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Tue Apr 11 08:29:12 2017 (r316698) +++ head/sys/net/if_me.c Tue Apr 11 08:56:18 2017 (r316699) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define MEMTU 1500 +#define MEMTU (1500 - sizeof(struct mobhdr)) static const char mename[] = "me"; static MALLOC_DEFINE(M_IFME, mename, "Minimal Encapsulation for IP"); static VNET_DEFINE(struct mtx, me_mtx); @@ -186,7 +186,7 @@ me_clone_create(struct if_clone *ifc, in ME2IFP(sc)->if_softc = sc; if_initname(ME2IFP(sc), mename, unit); - ME2IFP(sc)->if_mtu = MEMTU - sizeof(struct mobhdr); + ME2IFP(sc)->if_mtu = MEMTU;; ME2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST; ME2IFP(sc)->if_output = me_output; ME2IFP(sc)->if_ioctl = me_ioctl; @@ -236,7 +236,7 @@ me_ioctl(struct ifnet *ifp, u_long cmd, case SIOCSIFMTU: if (ifr->ifr_mtu < 576) return (EINVAL); - ifp->if_mtu = ifr->ifr_mtu - sizeof(struct mobhdr); + ifp->if_mtu = ifr->ifr_mtu; return (0); case SIOCSIFADDR: ifp->if_flags |= IFF_UP; From owner-svn-src-all@freebsd.org Tue Apr 11 12:49:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 045ACD390FA; Tue, 11 Apr 2017 12:49:27 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB398280; Tue, 11 Apr 2017 12:49:26 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BCnPfc034471; Tue, 11 Apr 2017 12:49:25 GMT (envelope-from mmokhi@FreeBSD.org) Received: (from mmokhi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BCnPhc034464; Tue, 11 Apr 2017 12:49:25 GMT (envelope-from mmokhi@FreeBSD.org) Message-Id: <201704111249.v3BCnPhc034464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmokhi set sender to mmokhi@FreeBSD.org using -f From: Mahdi Mokhtari Date: Tue, 11 Apr 2017 12:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316701 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 12:49:27 -0000 Author: mmokhi (ports committer) Date: Tue Apr 11 12:49:25 2017 New Revision: 316701 URL: https://svnweb.freebsd.org/changeset/base/316701 Log: MFC r314782: Add UNIMPLEMENTED() placeholder macro for the syscalls that are not implemented in Linux kernel itself. Cleanup DUMMY() macros. Approved by: trasz Modified: stable/11/sys/amd64/linux/linux_dummy.c stable/11/sys/amd64/linux/syscalls.master stable/11/sys/amd64/linux32/linux32_dummy.c stable/11/sys/amd64/linux32/syscalls.master stable/11/sys/compat/linux/linux_util.h stable/11/sys/i386/linux/linux_dummy.c stable/11/sys/i386/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/11/sys/amd64/linux/linux_dummy.c Tue Apr 11 12:38:42 2017 (r316700) +++ stable/11/sys/amd64/linux/linux_dummy.c Tue Apr 11 12:49:25 2017 (r316701) @@ -43,6 +43,22 @@ __FBSDID("$FreeBSD$"); /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); +UNIMPLEMENTED(afs_syscall); +UNIMPLEMENTED(create_module); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(epoll_ctl_old); +UNIMPLEMENTED(epoll_wait_old); +UNIMPLEMENTED(get_kernel_syms); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(get_thread_area); +UNIMPLEMENTED(getpmsg); +UNIMPLEMENTED(nfsservctl); /* added in linux 2.2 removed in 3.1 */ +UNIMPLEMENTED(putpmsg); +UNIMPLEMENTED(query_module); /* added in linux 2.2 removed in 2.6 */ +UNIMPLEMENTED(security); +UNIMPLEMENTED(set_thread_area); +UNIMPLEMENTED(tuxcall); +UNIMPLEMENTED(uselib); +UNIMPLEMENTED(vserver); + DUMMY(mincore); DUMMY(sendfile); DUMMY(syslog); @@ -53,22 +69,10 @@ DUMMY(vhangup); DUMMY(pivot_root); DUMMY(adjtimex); DUMMY(swapoff); -DUMMY(create_module); DUMMY(init_module); DUMMY(delete_module); -DUMMY(get_kernel_syms); -DUMMY(query_module); DUMMY(quotactl); -DUMMY(nfsservctl); -DUMMY(getpmsg); -DUMMY(putpmsg); -DUMMY(afs_syscall); -DUMMY(tuxcall); -DUMMY(security); -DUMMY(set_thread_area); DUMMY(lookup_dcookie); -DUMMY(epoll_ctl_old); -DUMMY(epoll_wait_old); DUMMY(remap_file_pages); DUMMY(semtimedop); DUMMY(mbind); Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Tue Apr 11 12:38:42 2017 (r316700) +++ stable/11/sys/amd64/linux/syscalls.master Tue Apr 11 12:49:25 2017 (r316701) @@ -333,18 +333,18 @@ l_int len); } 172 AUE_NULL STD { int linux_iopl(l_uint level); } 173 AUE_NULL UNIMPL ioperm -174 AUE_NULL STD { int linux_create_module(void); } +174 AUE_NULL UNIMPL create_module 175 AUE_NULL STD { int linux_init_module(void); } 176 AUE_NULL STD { int linux_delete_module(void); } -177 AUE_NULL STD { int linux_get_kernel_syms(void); } -178 AUE_NULL STD { int linux_query_module(void); } +177 AUE_NULL UNIMPL get_kernel_syms +178 AUE_NULL UNIMPL query_module 179 AUE_QUOTACTL STD { int linux_quotactl(void); } -180 AUE_NULL STD { int linux_nfsservctl(void); } -181 AUE_GETPMSG STD { int linux_getpmsg(void); } -182 AUE_PUTPMSG STD { int linux_putpmsg(void); } -183 AUE_NULL STD { int linux_afs_syscall(void); } -184 AUE_NULL STD { int linux_tuxcall(void); } -185 AUE_NULL STD { int linux_security(void); } +180 AUE_NULL UNIMPL nfsservctl +181 AUE_GETPMSG UNIMPL getpmsg +182 AUE_PUTPMSG UNIMPL putpmsg +183 AUE_NULL UNIMPL afs_syscall +184 AUE_NULL UNIMPL tuxcall +185 AUE_NULL UNIMPL security 186 AUE_NULL STD { int linux_gettid(void); } 187 AUE_NULL UNIMPL linux_readahead 188 AUE_NULL STD { int linux_setxattr(void); } @@ -367,17 +367,17 @@ l_ulong *user_mask_ptr); } 204 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, l_uint len, \ l_ulong *user_mask_ptr); } -205 AUE_NULL STD { int linux_set_thread_area(void); } +205 AUE_NULL UNIMPL set_thread_area 206 AUE_NULL UNIMPL linux_io_setup 207 AUE_NULL UNIMPL linux_io_destroy 208 AUE_NULL UNIMPL linux_io_getevents 209 AUE_NULL UNIMPL linux_io_submit 210 AUE_NULL UNIMPL linux_io_cancel -211 AUE_NULL UNIMPL linux_get_thread_area +211 AUE_NULL UNIMPL get_thread_area 212 AUE_NULL STD { int linux_lookup_dcookie(void); } 213 AUE_NULL STD { int linux_epoll_create(l_int size); } -214 AUE_NULL STD { int linux_epoll_ctl_old(void); } -215 AUE_NULL STD { int linux_epoll_wait_old(void); } +214 AUE_NULL UNIMPL epoll_ctl_old +215 AUE_NULL UNIMPL epoll_wait_old 216 AUE_NULL STD { int linux_remap_file_pages(void); } 217 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ void *dirent, l_uint count); } Modified: stable/11/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_dummy.c Tue Apr 11 12:38:42 2017 (r316700) +++ stable/11/sys/amd64/linux32/linux32_dummy.c Tue Apr 11 12:49:25 2017 (r316701) @@ -45,6 +45,24 @@ __FBSDID("$FreeBSD$"); /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); +UNIMPLEMENTED(afs_syscall); +UNIMPLEMENTED(break); +UNIMPLEMENTED(create_module); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(ftime); +UNIMPLEMENTED(get_kernel_syms); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(getpmsg); +UNIMPLEMENTED(gtty); +UNIMPLEMENTED(stty); +UNIMPLEMENTED(lock); +UNIMPLEMENTED(mpx); +UNIMPLEMENTED(nfsservctl); /* added in linux 2.2 removed in 3.1 */ +UNIMPLEMENTED(prof); +UNIMPLEMENTED(profil); +UNIMPLEMENTED(putpmsg); +UNIMPLEMENTED(query_module); /* added in linux 2.2 removed in 2.6 */ +UNIMPLEMENTED(ulimit); +UNIMPLEMENTED(vserver); + DUMMY(stime); DUMMY(olduname); DUMMY(syslog); @@ -52,15 +70,11 @@ DUMMY(uname); DUMMY(vhangup); DUMMY(swapoff); DUMMY(adjtimex); -DUMMY(create_module); DUMMY(init_module); DUMMY(delete_module); -DUMMY(get_kernel_syms); DUMMY(quotactl); DUMMY(bdflush); DUMMY(sysfs); -DUMMY(query_module); -DUMMY(nfsservctl); DUMMY(sendfile); DUMMY(setfsuid); DUMMY(setfsgid); Modified: stable/11/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux32/syscalls.master Tue Apr 11 12:38:42 2017 (r316700) +++ stable/11/sys/amd64/linux32/syscalls.master Tue Apr 11 12:49:25 2017 (r316701) @@ -230,10 +230,10 @@ int prot); } 126 AUE_SIGPROCMASK STD { int linux_sigprocmask(l_int how, \ l_osigset_t *mask, l_osigset_t *omask); } -127 AUE_NULL STD { int linux_create_module(void); } +127 AUE_NULL UNIMPL create_module 128 AUE_NULL STD { int linux_init_module(void); } 129 AUE_NULL STD { int linux_delete_module(void); } -130 AUE_NULL STD { int linux_get_kernel_syms(void); } +130 AUE_NULL UNIMPL get_kernel_syms 131 AUE_QUOTACTL STD { int linux_quotactl(void); } 132 AUE_GETPGID NOPROTO { int getpgid(int pid); } 133 AUE_FCHDIR NOPROTO { int fchdir(int fd); } @@ -296,10 +296,10 @@ 165 AUE_GETRESUID STD { int linux_getresuid16(l_uid16_t *ruid, \ l_uid16_t *euid, l_uid16_t *suid); } 166 AUE_NULL UNIMPL vm86 -167 AUE_NULL STD { int linux_query_module(void); } +167 AUE_NULL UNIMPL query_module 168 AUE_POLL NOPROTO { int poll(struct pollfd *fds, \ unsigned int nfds, int timeout); } -169 AUE_NULL STD { int linux_nfsservctl(void); } +169 AUE_NULL UNIMPL nfsservctl 170 AUE_SETRESGID STD { int linux_setresgid16(l_gid16_t rgid, \ l_gid16_t egid, l_gid16_t sgid); } 171 AUE_GETRESGID STD { int linux_getresgid16(l_gid16_t *rgid, \ Modified: stable/11/sys/compat/linux/linux_util.h ============================================================================== --- stable/11/sys/compat/linux/linux_util.h Tue Apr 11 12:38:42 2017 (r316700) +++ stable/11/sys/compat/linux/linux_util.h Tue Apr 11 12:49:25 2017 (r316701) @@ -93,6 +93,14 @@ linux_ ## s(struct thread *td, struct li } \ struct __hack +/* + * This is for the syscalls that are not even yet implemented in Linux. + * + * They're marked as UNIMPL in syscall.master so it will + * have nosys record in linux_sysent[]. + */ +#define UNIMPLEMENTED(s) + void linux_msg(const struct thread *td, const char *fmt, ...) __printflike(2, 3); Modified: stable/11/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/11/sys/i386/linux/linux_dummy.c Tue Apr 11 12:38:42 2017 (r316700) +++ stable/11/sys/i386/linux/linux_dummy.c Tue Apr 11 12:49:25 2017 (r316701) @@ -45,6 +45,24 @@ __FBSDID("$FreeBSD$"); /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); +UNIMPLEMENTED(afs_syscall); +UNIMPLEMENTED(break); +UNIMPLEMENTED(create_module); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(ftime); +UNIMPLEMENTED(get_kernel_syms); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(getpmsg); +UNIMPLEMENTED(gtty); +UNIMPLEMENTED(stty); +UNIMPLEMENTED(lock); +UNIMPLEMENTED(mpx); +UNIMPLEMENTED(nfsservctl); /* added in linux 2.2 removed in 3.1 */ +UNIMPLEMENTED(prof); +UNIMPLEMENTED(profil); +UNIMPLEMENTED(putpmsg); +UNIMPLEMENTED(query_module); /* added in linux 2.2 removed in 2.6 */ +UNIMPLEMENTED(ulimit); +UNIMPLEMENTED(vserver); + DUMMY(stime); DUMMY(fstat); DUMMY(olduname); @@ -54,16 +72,12 @@ DUMMY(vhangup); DUMMY(vm86old); DUMMY(swapoff); DUMMY(adjtimex); -DUMMY(create_module); DUMMY(init_module); DUMMY(delete_module); -DUMMY(get_kernel_syms); DUMMY(quotactl); DUMMY(bdflush); DUMMY(sysfs); DUMMY(vm86); -DUMMY(query_module); -DUMMY(nfsservctl); DUMMY(sendfile); /* different semantics */ DUMMY(setfsuid); DUMMY(setfsgid); Modified: stable/11/sys/i386/linux/syscalls.master ============================================================================== --- stable/11/sys/i386/linux/syscalls.master Tue Apr 11 12:38:42 2017 (r316700) +++ stable/11/sys/i386/linux/syscalls.master Tue Apr 11 12:49:25 2017 (r316701) @@ -232,10 +232,10 @@ int prot); } 126 AUE_SIGPROCMASK STD { int linux_sigprocmask(l_int how, \ l_osigset_t *mask, l_osigset_t *omask); } -127 AUE_NULL STD { int linux_create_module(void); } +127 AUE_NULL UNIMPL create_module 128 AUE_NULL STD { int linux_init_module(void); } 129 AUE_NULL STD { int linux_delete_module(void); } -130 AUE_NULL STD { int linux_get_kernel_syms(void); } +130 AUE_NULL UNIMPL get_kernel_syms 131 AUE_QUOTACTL STD { int linux_quotactl(void); } 132 AUE_GETPGID NOPROTO { int getpgid(int pid); } 133 AUE_FCHDIR NOPROTO { int fchdir(int fd); } @@ -298,10 +298,10 @@ 165 AUE_GETRESUID STD { int linux_getresuid16(l_uid16_t *ruid, \ l_uid16_t *euid, l_uid16_t *suid); } 166 AUE_NULL STD { int linux_vm86(void); } -167 AUE_NULL STD { int linux_query_module(void); } +167 AUE_NULL UNIMPL query_module 168 AUE_POLL NOPROTO { int poll(struct pollfd* fds, \ unsigned int nfds, long timeout); } -169 AUE_NULL STD { int linux_nfsservctl(void); } +169 AUE_NULL UNIMPL nfsservctl 170 AUE_SETRESGID STD { int linux_setresgid16(l_gid16_t rgid, \ l_gid16_t egid, l_gid16_t sgid); } 171 AUE_GETRESGID STD { int linux_getresgid16(l_gid16_t *rgid, \ From owner-svn-src-all@freebsd.org Tue Apr 11 13:31:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98BBFD393DD; Tue, 11 Apr 2017 13:31:28 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 692C3FBC; Tue, 11 Apr 2017 13:31:28 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BDVRtC051527; Tue, 11 Apr 2017 13:31:27 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BDVRYj051526; Tue, 11 Apr 2017 13:31:27 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201704111331.v3BDVRYj051526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 11 Apr 2017 13:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316702 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 13:31:28 -0000 Author: cognet Date: Tue Apr 11 13:31:27 2017 New Revision: 316702 URL: https://svnweb.freebsd.org/changeset/base/316702 Log: This file is also used in libcompiler_rt, so bring in stdbool.h if we're not in the kernel. Modified: head/sys/mips/mips/stdatomic.c Modified: head/sys/mips/mips/stdatomic.c ============================================================================== --- head/sys/mips/mips/stdatomic.c Tue Apr 11 12:49:25 2017 (r316701) +++ head/sys/mips/mips/stdatomic.c Tue Apr 11 13:31:27 2017 (r316702) @@ -33,6 +33,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef _KERNEL +#include +#endif /* _KERNEL */ + #if defined(__SYNC_ATOMICS) /* From owner-svn-src-all@freebsd.org Tue Apr 11 13:42:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B461AD396DD; Tue, 11 Apr 2017 13:42:29 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E9A4B72; Tue, 11 Apr 2017 13:42:29 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BDgSZF059446; Tue, 11 Apr 2017 13:42:28 GMT (envelope-from mmokhi@FreeBSD.org) Received: (from mmokhi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BDgRLG059432; Tue, 11 Apr 2017 13:42:27 GMT (envelope-from mmokhi@FreeBSD.org) Message-Id: <201704111342.v3BDgRLG059432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmokhi set sender to mmokhi@FreeBSD.org using -f From: Mahdi Mokhtari Date: Tue, 11 Apr 2017 13:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316703 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 13:42:29 -0000 Author: mmokhi (ports committer) Date: Tue Apr 11 13:42:26 2017 New Revision: 316703 URL: https://svnweb.freebsd.org/changeset/base/316703 Log: MFC 314783: Regenerated Linuxulator syscall tables for r314782 Approved by: trasz Modified: stable/11/sys/amd64/linux/linux_proto.h stable/11/sys/amd64/linux/linux_syscall.h stable/11/sys/amd64/linux/linux_syscalls.c stable/11/sys/amd64/linux/linux_sysent.c stable/11/sys/amd64/linux/linux_systrace_args.c stable/11/sys/amd64/linux32/linux32_proto.h stable/11/sys/amd64/linux32/linux32_syscall.h stable/11/sys/amd64/linux32/linux32_syscalls.c stable/11/sys/amd64/linux32/linux32_sysent.c stable/11/sys/amd64/linux32/linux32_systrace_args.c stable/11/sys/i386/linux/linux_proto.h stable/11/sys/i386/linux/linux_syscall.h stable/11/sys/i386/linux/linux_syscalls.c stable/11/sys/i386/linux/linux_sysent.c stable/11/sys/i386/linux/linux_systrace_args.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/11/sys/amd64/linux/linux_proto.h Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/amd64/linux/linux_proto.h Tue Apr 11 13:42:26 2017 (r316703) @@ -606,42 +606,15 @@ struct linux_setdomainname_args { struct linux_iopl_args { char level_l_[PADL_(l_uint)]; l_uint level; char level_r_[PADR_(l_uint)]; }; -struct linux_create_module_args { - register_t dummy; -}; struct linux_init_module_args { register_t dummy; }; struct linux_delete_module_args { register_t dummy; }; -struct linux_get_kernel_syms_args { - register_t dummy; -}; -struct linux_query_module_args { - register_t dummy; -}; struct linux_quotactl_args { register_t dummy; }; -struct linux_nfsservctl_args { - register_t dummy; -}; -struct linux_getpmsg_args { - register_t dummy; -}; -struct linux_putpmsg_args { - register_t dummy; -}; -struct linux_afs_syscall_args { - register_t dummy; -}; -struct linux_tuxcall_args { - register_t dummy; -}; -struct linux_security_args { - register_t dummy; -}; struct linux_gettid_args { register_t dummy; }; @@ -706,21 +679,12 @@ struct linux_sched_getaffinity_args { char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; }; -struct linux_set_thread_area_args { - register_t dummy; -}; struct linux_lookup_dcookie_args { register_t dummy; }; struct linux_epoll_create_args { char size_l_[PADL_(l_int)]; l_int size; char size_r_[PADR_(l_int)]; }; -struct linux_epoll_ctl_old_args { - register_t dummy; -}; -struct linux_epoll_wait_old_args { - register_t dummy; -}; struct linux_remap_file_pages_args { register_t dummy; }; @@ -1378,18 +1342,9 @@ int linux_reboot(struct thread *, struct int linux_sethostname(struct thread *, struct linux_sethostname_args *); int linux_setdomainname(struct thread *, struct linux_setdomainname_args *); int linux_iopl(struct thread *, struct linux_iopl_args *); -int linux_create_module(struct thread *, struct linux_create_module_args *); int linux_init_module(struct thread *, struct linux_init_module_args *); int linux_delete_module(struct thread *, struct linux_delete_module_args *); -int linux_get_kernel_syms(struct thread *, struct linux_get_kernel_syms_args *); -int linux_query_module(struct thread *, struct linux_query_module_args *); int linux_quotactl(struct thread *, struct linux_quotactl_args *); -int linux_nfsservctl(struct thread *, struct linux_nfsservctl_args *); -int linux_getpmsg(struct thread *, struct linux_getpmsg_args *); -int linux_putpmsg(struct thread *, struct linux_putpmsg_args *); -int linux_afs_syscall(struct thread *, struct linux_afs_syscall_args *); -int linux_tuxcall(struct thread *, struct linux_tuxcall_args *); -int linux_security(struct thread *, struct linux_security_args *); int linux_gettid(struct thread *, struct linux_gettid_args *); int linux_setxattr(struct thread *, struct linux_setxattr_args *); int linux_lsetxattr(struct thread *, struct linux_lsetxattr_args *); @@ -1408,11 +1363,8 @@ int linux_time(struct thread *, struct l int linux_sys_futex(struct thread *, struct linux_sys_futex_args *); int linux_sched_setaffinity(struct thread *, struct linux_sched_setaffinity_args *); int linux_sched_getaffinity(struct thread *, struct linux_sched_getaffinity_args *); -int linux_set_thread_area(struct thread *, struct linux_set_thread_area_args *); int linux_lookup_dcookie(struct thread *, struct linux_lookup_dcookie_args *); int linux_epoll_create(struct thread *, struct linux_epoll_create_args *); -int linux_epoll_ctl_old(struct thread *, struct linux_epoll_ctl_old_args *); -int linux_epoll_wait_old(struct thread *, struct linux_epoll_wait_old_args *); int linux_remap_file_pages(struct thread *, struct linux_remap_file_pages_args *); int linux_getdents64(struct thread *, struct linux_getdents64_args *); int linux_set_tid_address(struct thread *, struct linux_set_tid_address_args *); @@ -1690,18 +1642,9 @@ int linux_pkey_free(struct thread *, str #define LINUX_SYS_AUE_linux_sethostname AUE_SYSCTL #define LINUX_SYS_AUE_linux_setdomainname AUE_SYSCTL #define LINUX_SYS_AUE_linux_iopl AUE_NULL -#define LINUX_SYS_AUE_linux_create_module AUE_NULL #define LINUX_SYS_AUE_linux_init_module AUE_NULL #define LINUX_SYS_AUE_linux_delete_module AUE_NULL -#define LINUX_SYS_AUE_linux_get_kernel_syms AUE_NULL -#define LINUX_SYS_AUE_linux_query_module AUE_NULL #define LINUX_SYS_AUE_linux_quotactl AUE_QUOTACTL -#define LINUX_SYS_AUE_linux_nfsservctl AUE_NULL -#define LINUX_SYS_AUE_linux_getpmsg AUE_GETPMSG -#define LINUX_SYS_AUE_linux_putpmsg AUE_PUTPMSG -#define LINUX_SYS_AUE_linux_afs_syscall AUE_NULL -#define LINUX_SYS_AUE_linux_tuxcall AUE_NULL -#define LINUX_SYS_AUE_linux_security AUE_NULL #define LINUX_SYS_AUE_linux_gettid AUE_NULL #define LINUX_SYS_AUE_linux_setxattr AUE_NULL #define LINUX_SYS_AUE_linux_lsetxattr AUE_NULL @@ -1720,11 +1663,8 @@ int linux_pkey_free(struct thread *, str #define LINUX_SYS_AUE_linux_sys_futex AUE_NULL #define LINUX_SYS_AUE_linux_sched_setaffinity AUE_NULL #define LINUX_SYS_AUE_linux_sched_getaffinity AUE_NULL -#define LINUX_SYS_AUE_linux_set_thread_area AUE_NULL #define LINUX_SYS_AUE_linux_lookup_dcookie AUE_NULL #define LINUX_SYS_AUE_linux_epoll_create AUE_NULL -#define LINUX_SYS_AUE_linux_epoll_ctl_old AUE_NULL -#define LINUX_SYS_AUE_linux_epoll_wait_old AUE_NULL #define LINUX_SYS_AUE_linux_remap_file_pages AUE_NULL #define LINUX_SYS_AUE_linux_getdents64 AUE_GETDIRENTRIES #define LINUX_SYS_AUE_linux_set_tid_address AUE_NULL Modified: stable/11/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/11/sys/amd64/linux/linux_syscall.h Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/amd64/linux/linux_syscall.h Tue Apr 11 13:42:26 2017 (r316703) @@ -177,18 +177,9 @@ #define LINUX_SYS_linux_sethostname 170 #define LINUX_SYS_linux_setdomainname 171 #define LINUX_SYS_linux_iopl 172 -#define LINUX_SYS_linux_create_module 174 #define LINUX_SYS_linux_init_module 175 #define LINUX_SYS_linux_delete_module 176 -#define LINUX_SYS_linux_get_kernel_syms 177 -#define LINUX_SYS_linux_query_module 178 #define LINUX_SYS_linux_quotactl 179 -#define LINUX_SYS_linux_nfsservctl 180 -#define LINUX_SYS_linux_getpmsg 181 -#define LINUX_SYS_linux_putpmsg 182 -#define LINUX_SYS_linux_afs_syscall 183 -#define LINUX_SYS_linux_tuxcall 184 -#define LINUX_SYS_linux_security 185 #define LINUX_SYS_linux_gettid 186 #define LINUX_SYS_linux_setxattr 188 #define LINUX_SYS_linux_lsetxattr 189 @@ -207,11 +198,8 @@ #define LINUX_SYS_linux_sys_futex 202 #define LINUX_SYS_linux_sched_setaffinity 203 #define LINUX_SYS_linux_sched_getaffinity 204 -#define LINUX_SYS_linux_set_thread_area 205 #define LINUX_SYS_linux_lookup_dcookie 212 #define LINUX_SYS_linux_epoll_create 213 -#define LINUX_SYS_linux_epoll_ctl_old 214 -#define LINUX_SYS_linux_epoll_wait_old 215 #define LINUX_SYS_linux_remap_file_pages 216 #define LINUX_SYS_linux_getdents64 217 #define LINUX_SYS_linux_set_tid_address 218 Modified: stable/11/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/11/sys/amd64/linux/linux_syscalls.c Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/amd64/linux/linux_syscalls.c Tue Apr 11 13:42:26 2017 (r316703) @@ -182,18 +182,18 @@ const char *linux_syscallnames[] = { "linux_setdomainname", /* 171 = linux_setdomainname */ "linux_iopl", /* 172 = linux_iopl */ "#173", /* 173 = ioperm */ - "linux_create_module", /* 174 = linux_create_module */ + "#174", /* 174 = create_module */ "linux_init_module", /* 175 = linux_init_module */ "linux_delete_module", /* 176 = linux_delete_module */ - "linux_get_kernel_syms", /* 177 = linux_get_kernel_syms */ - "linux_query_module", /* 178 = linux_query_module */ + "#177", /* 177 = get_kernel_syms */ + "#178", /* 178 = query_module */ "linux_quotactl", /* 179 = linux_quotactl */ - "linux_nfsservctl", /* 180 = linux_nfsservctl */ - "linux_getpmsg", /* 181 = linux_getpmsg */ - "linux_putpmsg", /* 182 = linux_putpmsg */ - "linux_afs_syscall", /* 183 = linux_afs_syscall */ - "linux_tuxcall", /* 184 = linux_tuxcall */ - "linux_security", /* 185 = linux_security */ + "#180", /* 180 = nfsservctl */ + "#181", /* 181 = getpmsg */ + "#182", /* 182 = putpmsg */ + "#183", /* 183 = afs_syscall */ + "#184", /* 184 = tuxcall */ + "#185", /* 185 = security */ "linux_gettid", /* 186 = linux_gettid */ "#187", /* 187 = linux_readahead */ "linux_setxattr", /* 188 = linux_setxattr */ @@ -213,17 +213,17 @@ const char *linux_syscallnames[] = { "linux_sys_futex", /* 202 = linux_sys_futex */ "linux_sched_setaffinity", /* 203 = linux_sched_setaffinity */ "linux_sched_getaffinity", /* 204 = linux_sched_getaffinity */ - "linux_set_thread_area", /* 205 = linux_set_thread_area */ + "#205", /* 205 = set_thread_area */ "#206", /* 206 = linux_io_setup */ "#207", /* 207 = linux_io_destroy */ "#208", /* 208 = linux_io_getevents */ "#209", /* 209 = linux_io_submit */ "#210", /* 210 = linux_io_cancel */ - "#211", /* 211 = linux_get_thread_area */ + "#211", /* 211 = get_thread_area */ "linux_lookup_dcookie", /* 212 = linux_lookup_dcookie */ "linux_epoll_create", /* 213 = linux_epoll_create */ - "linux_epoll_ctl_old", /* 214 = linux_epoll_ctl_old */ - "linux_epoll_wait_old", /* 215 = linux_epoll_wait_old */ + "#214", /* 214 = epoll_ctl_old */ + "#215", /* 215 = epoll_wait_old */ "linux_remap_file_pages", /* 216 = linux_remap_file_pages */ "linux_getdents64", /* 217 = linux_getdents64 */ "linux_set_tid_address", /* 218 = linux_set_tid_address */ Modified: stable/11/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysent.c Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/amd64/linux/linux_sysent.c Tue Apr 11 13:42:26 2017 (r316703) @@ -192,18 +192,18 @@ struct sysent linux_sysent[] = { { AS(linux_setdomainname_args), (sy_call_t *)linux_setdomainname, AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 171 = linux_setdomainname */ { AS(linux_iopl_args), (sy_call_t *)linux_iopl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 172 = linux_iopl */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 173 = ioperm */ - { 0, (sy_call_t *)linux_create_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 174 = linux_create_module */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 174 = create_module */ { 0, (sy_call_t *)linux_init_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = linux_init_module */ { 0, (sy_call_t *)linux_delete_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = linux_delete_module */ - { 0, (sy_call_t *)linux_get_kernel_syms, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 177 = linux_get_kernel_syms */ - { 0, (sy_call_t *)linux_query_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 178 = linux_query_module */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 177 = get_kernel_syms */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 178 = query_module */ { 0, (sy_call_t *)linux_quotactl, AUE_QUOTACTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 179 = linux_quotactl */ - { 0, (sy_call_t *)linux_nfsservctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 180 = linux_nfsservctl */ - { 0, (sy_call_t *)linux_getpmsg, AUE_GETPMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 181 = linux_getpmsg */ - { 0, (sy_call_t *)linux_putpmsg, AUE_PUTPMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 182 = linux_putpmsg */ - { 0, (sy_call_t *)linux_afs_syscall, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 183 = linux_afs_syscall */ - { 0, (sy_call_t *)linux_tuxcall, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 184 = linux_tuxcall */ - { 0, (sy_call_t *)linux_security, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 185 = linux_security */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 180 = nfsservctl */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 181 = getpmsg */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 182 = putpmsg */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 183 = afs_syscall */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 184 = tuxcall */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 185 = security */ { 0, (sy_call_t *)linux_gettid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 186 = linux_gettid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 187 = linux_readahead */ { 0, (sy_call_t *)linux_setxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 188 = linux_setxattr */ @@ -223,17 +223,17 @@ struct sysent linux_sysent[] = { { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 202 = linux_sys_futex */ { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 203 = linux_sched_setaffinity */ { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 204 = linux_sched_getaffinity */ - { 0, (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 205 = linux_set_thread_area */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 205 = set_thread_area */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 206 = linux_io_setup */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 207 = linux_io_destroy */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = linux_io_getevents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 209 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = linux_io_cancel */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = linux_get_thread_area */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = get_thread_area */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 212 = linux_lookup_dcookie */ { AS(linux_epoll_create_args), (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 213 = linux_epoll_create */ - { 0, (sy_call_t *)linux_epoll_ctl_old, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 214 = linux_epoll_ctl_old */ - { 0, (sy_call_t *)linux_epoll_wait_old, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 215 = linux_epoll_wait_old */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 214 = epoll_ctl_old */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 215 = epoll_wait_old */ { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 216 = linux_remap_file_pages */ { AS(linux_getdents64_args), (sy_call_t *)linux_getdents64, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 217 = linux_getdents64 */ { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 218 = linux_set_tid_address */ Modified: stable/11/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux/linux_systrace_args.c Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/amd64/linux/linux_systrace_args.c Tue Apr 11 13:42:26 2017 (r316703) @@ -1396,11 +1396,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* linux_create_module */ - case 174: { - *n_args = 0; - break; - } /* linux_init_module */ case 175: { *n_args = 0; @@ -1411,51 +1406,11 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } - /* linux_get_kernel_syms */ - case 177: { - *n_args = 0; - break; - } - /* linux_query_module */ - case 178: { - *n_args = 0; - break; - } /* linux_quotactl */ case 179: { *n_args = 0; break; } - /* linux_nfsservctl */ - case 180: { - *n_args = 0; - break; - } - /* linux_getpmsg */ - case 181: { - *n_args = 0; - break; - } - /* linux_putpmsg */ - case 182: { - *n_args = 0; - break; - } - /* linux_afs_syscall */ - case 183: { - *n_args = 0; - break; - } - /* linux_tuxcall */ - case 184: { - *n_args = 0; - break; - } - /* linux_security */ - case 185: { - *n_args = 0; - break; - } /* linux_gettid */ case 186: { *n_args = 0; @@ -1566,11 +1521,6 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* linux_set_thread_area */ - case 205: { - *n_args = 0; - break; - } /* linux_lookup_dcookie */ case 212: { *n_args = 0; @@ -1583,16 +1533,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* linux_epoll_ctl_old */ - case 214: { - *n_args = 0; - break; - } - /* linux_epoll_wait_old */ - case 215: { - *n_args = 0; - break; - } /* linux_remap_file_pages */ case 216: { *n_args = 0; @@ -4771,42 +4711,15 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* linux_create_module */ - case 174: - break; /* linux_init_module */ case 175: break; /* linux_delete_module */ case 176: break; - /* linux_get_kernel_syms */ - case 177: - break; - /* linux_query_module */ - case 178: - break; /* linux_quotactl */ case 179: break; - /* linux_nfsservctl */ - case 180: - break; - /* linux_getpmsg */ - case 181: - break; - /* linux_putpmsg */ - case 182: - break; - /* linux_afs_syscall */ - case 183: - break; - /* linux_tuxcall */ - case 184: - break; - /* linux_security */ - case 185: - break; /* linux_gettid */ case 186: break; @@ -4926,9 +4839,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* linux_set_thread_area */ - case 205: - break; /* linux_lookup_dcookie */ case 212: break; @@ -4942,12 +4852,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* linux_epoll_ctl_old */ - case 214: - break; - /* linux_epoll_wait_old */ - case 215: - break; /* linux_remap_file_pages */ case 216: break; @@ -7214,30 +7118,12 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* linux_create_module */ - case 174: /* linux_init_module */ case 175: /* linux_delete_module */ case 176: - /* linux_get_kernel_syms */ - case 177: - /* linux_query_module */ - case 178: /* linux_quotactl */ case 179: - /* linux_nfsservctl */ - case 180: - /* linux_getpmsg */ - case 181: - /* linux_putpmsg */ - case 182: - /* linux_afs_syscall */ - case 183: - /* linux_tuxcall */ - case 184: - /* linux_security */ - case 185: /* linux_gettid */ case 186: /* linux_setxattr */ @@ -7289,8 +7175,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* linux_set_thread_area */ - case 205: /* linux_lookup_dcookie */ case 212: /* linux_epoll_create */ @@ -7298,10 +7182,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* linux_epoll_ctl_old */ - case 214: - /* linux_epoll_wait_old */ - case 215: /* linux_remap_file_pages */ case 216: /* linux_getdents64 */ Modified: stable/11/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/11/sys/amd64/linux32/linux32_proto.h Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/amd64/linux32/linux32_proto.h Tue Apr 11 13:42:26 2017 (r316703) @@ -403,18 +403,12 @@ struct linux_sigprocmask_args { char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; char omask_l_[PADL_(l_osigset_t *)]; l_osigset_t * omask; char omask_r_[PADR_(l_osigset_t *)]; }; -struct linux_create_module_args { - register_t dummy; -}; struct linux_init_module_args { register_t dummy; }; struct linux_delete_module_args { register_t dummy; }; -struct linux_get_kernel_syms_args { - register_t dummy; -}; struct linux_quotactl_args { register_t dummy; }; @@ -525,12 +519,6 @@ struct linux_getresuid16_args { char euid_l_[PADL_(l_uid16_t *)]; l_uid16_t * euid; char euid_r_[PADR_(l_uid16_t *)]; char suid_l_[PADL_(l_uid16_t *)]; l_uid16_t * suid; char suid_r_[PADR_(l_uid16_t *)]; }; -struct linux_query_module_args { - register_t dummy; -}; -struct linux_nfsservctl_args { - register_t dummy; -}; struct linux_setresgid16_args { char rgid_l_[PADL_(l_gid16_t)]; l_gid16_t rgid; char rgid_r_[PADR_(l_gid16_t)]; char egid_l_[PADL_(l_gid16_t)]; l_gid16_t egid; char egid_r_[PADR_(l_gid16_t)]; @@ -1471,10 +1459,8 @@ int linux_newuname(struct thread *, stru int linux_adjtimex(struct thread *, struct linux_adjtimex_args *); int linux_mprotect(struct thread *, struct linux_mprotect_args *); int linux_sigprocmask(struct thread *, struct linux_sigprocmask_args *); -int linux_create_module(struct thread *, struct linux_create_module_args *); int linux_init_module(struct thread *, struct linux_init_module_args *); int linux_delete_module(struct thread *, struct linux_delete_module_args *); -int linux_get_kernel_syms(struct thread *, struct linux_get_kernel_syms_args *); int linux_quotactl(struct thread *, struct linux_quotactl_args *); int linux_bdflush(struct thread *, struct linux_bdflush_args *); int linux_sysfs(struct thread *, struct linux_sysfs_args *); @@ -1501,8 +1487,6 @@ int linux_nanosleep(struct thread *, str int linux_mremap(struct thread *, struct linux_mremap_args *); int linux_setresuid16(struct thread *, struct linux_setresuid16_args *); int linux_getresuid16(struct thread *, struct linux_getresuid16_args *); -int linux_query_module(struct thread *, struct linux_query_module_args *); -int linux_nfsservctl(struct thread *, struct linux_nfsservctl_args *); int linux_setresgid16(struct thread *, struct linux_setresgid16_args *); int linux_getresgid16(struct thread *, struct linux_getresgid16_args *); int linux_prctl(struct thread *, struct linux_prctl_args *); @@ -1817,10 +1801,8 @@ int linux_pkey_free(struct thread *, str #define LINUX32_SYS_AUE_linux_adjtimex AUE_ADJTIME #define LINUX32_SYS_AUE_linux_mprotect AUE_MPROTECT #define LINUX32_SYS_AUE_linux_sigprocmask AUE_SIGPROCMASK -#define LINUX32_SYS_AUE_linux_create_module AUE_NULL #define LINUX32_SYS_AUE_linux_init_module AUE_NULL #define LINUX32_SYS_AUE_linux_delete_module AUE_NULL -#define LINUX32_SYS_AUE_linux_get_kernel_syms AUE_NULL #define LINUX32_SYS_AUE_linux_quotactl AUE_QUOTACTL #define LINUX32_SYS_AUE_linux_bdflush AUE_BDFLUSH #define LINUX32_SYS_AUE_linux_sysfs AUE_NULL @@ -1847,8 +1829,6 @@ int linux_pkey_free(struct thread *, str #define LINUX32_SYS_AUE_linux_mremap AUE_NULL #define LINUX32_SYS_AUE_linux_setresuid16 AUE_SETRESUID #define LINUX32_SYS_AUE_linux_getresuid16 AUE_GETRESUID -#define LINUX32_SYS_AUE_linux_query_module AUE_NULL -#define LINUX32_SYS_AUE_linux_nfsservctl AUE_NULL #define LINUX32_SYS_AUE_linux_setresgid16 AUE_SETRESGID #define LINUX32_SYS_AUE_linux_getresgid16 AUE_GETRESGID #define LINUX32_SYS_AUE_linux_prctl AUE_PRCTL Modified: stable/11/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/11/sys/amd64/linux32/linux32_syscall.h Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/amd64/linux32/linux32_syscall.h Tue Apr 11 13:42:26 2017 (r316703) @@ -117,10 +117,8 @@ #define LINUX32_SYS_linux_adjtimex 124 #define LINUX32_SYS_linux_mprotect 125 #define LINUX32_SYS_linux_sigprocmask 126 -#define LINUX32_SYS_linux_create_module 127 #define LINUX32_SYS_linux_init_module 128 #define LINUX32_SYS_linux_delete_module 129 -#define LINUX32_SYS_linux_get_kernel_syms 130 #define LINUX32_SYS_linux_quotactl 131 #define LINUX32_SYS_getpgid 132 #define LINUX32_SYS_fchdir 133 @@ -155,9 +153,7 @@ #define LINUX32_SYS_linux_mremap 163 #define LINUX32_SYS_linux_setresuid16 164 #define LINUX32_SYS_linux_getresuid16 165 -#define LINUX32_SYS_linux_query_module 167 #define LINUX32_SYS_poll 168 -#define LINUX32_SYS_linux_nfsservctl 169 #define LINUX32_SYS_linux_setresgid16 170 #define LINUX32_SYS_linux_getresgid16 171 #define LINUX32_SYS_linux_prctl 172 Modified: stable/11/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_syscalls.c Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/amd64/linux32/linux32_syscalls.c Tue Apr 11 13:42:26 2017 (r316703) @@ -135,10 +135,10 @@ const char *linux32_syscallnames[] = { "linux_adjtimex", /* 124 = linux_adjtimex */ "linux_mprotect", /* 125 = linux_mprotect */ "linux_sigprocmask", /* 126 = linux_sigprocmask */ - "linux_create_module", /* 127 = linux_create_module */ + "#127", /* 127 = create_module */ "linux_init_module", /* 128 = linux_init_module */ "linux_delete_module", /* 129 = linux_delete_module */ - "linux_get_kernel_syms", /* 130 = linux_get_kernel_syms */ + "#130", /* 130 = get_kernel_syms */ "linux_quotactl", /* 131 = linux_quotactl */ "getpgid", /* 132 = getpgid */ "fchdir", /* 133 = fchdir */ @@ -175,9 +175,9 @@ const char *linux32_syscallnames[] = { "linux_setresuid16", /* 164 = linux_setresuid16 */ "linux_getresuid16", /* 165 = linux_getresuid16 */ "#166", /* 166 = vm86 */ - "linux_query_module", /* 167 = linux_query_module */ + "#167", /* 167 = query_module */ "poll", /* 168 = poll */ - "linux_nfsservctl", /* 169 = linux_nfsservctl */ + "#169", /* 169 = nfsservctl */ "linux_setresgid16", /* 170 = linux_setresgid16 */ "linux_getresgid16", /* 171 = linux_getresgid16 */ "linux_prctl", /* 172 = linux_prctl */ Modified: stable/11/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysent.c Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/amd64/linux32/linux32_sysent.c Tue Apr 11 13:42:26 2017 (r316703) @@ -146,10 +146,10 @@ struct sysent linux32_sysent[] = { { 0, (sy_call_t *)linux_adjtimex, AUE_ADJTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 124 = linux_adjtimex */ { AS(linux_mprotect_args), (sy_call_t *)linux_mprotect, AUE_MPROTECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 125 = linux_mprotect */ { AS(linux_sigprocmask_args), (sy_call_t *)linux_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 126 = linux_sigprocmask */ - { 0, (sy_call_t *)linux_create_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 127 = linux_create_module */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 127 = create_module */ { 0, (sy_call_t *)linux_init_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 128 = linux_init_module */ { 0, (sy_call_t *)linux_delete_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 129 = linux_delete_module */ - { 0, (sy_call_t *)linux_get_kernel_syms, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 130 = linux_get_kernel_syms */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 130 = get_kernel_syms */ { 0, (sy_call_t *)linux_quotactl, AUE_QUOTACTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 131 = linux_quotactl */ { AS(getpgid_args), (sy_call_t *)sys_getpgid, AUE_GETPGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 132 = getpgid */ { AS(fchdir_args), (sy_call_t *)sys_fchdir, AUE_FCHDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 133 = fchdir */ @@ -186,9 +186,9 @@ struct sysent linux32_sysent[] = { { AS(linux_setresuid16_args), (sy_call_t *)linux_setresuid16, AUE_SETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 164 = linux_setresuid16 */ { AS(linux_getresuid16_args), (sy_call_t *)linux_getresuid16, AUE_GETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 165 = linux_getresuid16 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 166 = vm86 */ - { 0, (sy_call_t *)linux_query_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 167 = linux_query_module */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 167 = query_module */ { AS(poll_args), (sy_call_t *)sys_poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 168 = poll */ - { 0, (sy_call_t *)linux_nfsservctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 169 = linux_nfsservctl */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 169 = nfsservctl */ { AS(linux_setresgid16_args), (sy_call_t *)linux_setresgid16, AUE_SETRESGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 170 = linux_setresgid16 */ { AS(linux_getresgid16_args), (sy_call_t *)linux_getresgid16, AUE_GETRESGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 171 = linux_getresgid16 */ { AS(linux_prctl_args), (sy_call_t *)linux_prctl, AUE_PRCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 172 = linux_prctl */ Modified: stable/11/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_systrace_args.c Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/amd64/linux32/linux32_systrace_args.c Tue Apr 11 13:42:26 2017 (r316703) @@ -854,11 +854,6 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* linux_create_module */ - case 127: { - *n_args = 0; - break; - } /* linux_init_module */ case 128: { *n_args = 0; @@ -869,11 +864,6 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } - /* linux_get_kernel_syms */ - case 130: { - *n_args = 0; - break; - } /* linux_quotactl */ case 131: { *n_args = 0; @@ -1139,11 +1129,6 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* linux_query_module */ - case 167: { - *n_args = 0; - break; - } /* poll */ case 168: { struct poll_args *p = params; @@ -1153,11 +1138,6 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* linux_nfsservctl */ - case 169: { - *n_args = 0; - break; - } /* linux_setresgid16 */ case 170: { struct linux_setresgid16_args *p = params; @@ -4026,18 +4006,12 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* linux_create_module */ - case 127: - break; /* linux_init_module */ case 128: break; /* linux_delete_module */ case 129: break; - /* linux_get_kernel_syms */ - case 130: - break; /* linux_quotactl */ case 131: break; @@ -4455,9 +4429,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* linux_query_module */ - case 167: - break; /* poll */ case 168: switch(ndx) { @@ -4474,9 +4445,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* linux_nfsservctl */ - case 169: - break; /* linux_setresgid16 */ case 170: switch(ndx) { @@ -7464,14 +7432,10 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* linux_create_module */ - case 127: /* linux_init_module */ case 128: /* linux_delete_module */ case 129: - /* linux_get_kernel_syms */ - case 130: /* linux_quotactl */ case 131: /* getpgid */ @@ -7630,15 +7594,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* linux_query_module */ - case 167: /* poll */ case 168: if (ndx == 0 || ndx == 1) p = "int"; break; - /* linux_nfsservctl */ - case 169: /* linux_setresgid16 */ case 170: if (ndx == 0 || ndx == 1) Modified: stable/11/sys/i386/linux/linux_proto.h ============================================================================== --- stable/11/sys/i386/linux/linux_proto.h Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/i386/linux/linux_proto.h Tue Apr 11 13:42:26 2017 (r316703) @@ -411,18 +411,12 @@ struct linux_sigprocmask_args { char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; char omask_l_[PADL_(l_osigset_t *)]; l_osigset_t * omask; char omask_r_[PADR_(l_osigset_t *)]; }; -struct linux_create_module_args { - register_t dummy; -}; struct linux_init_module_args { register_t dummy; }; struct linux_delete_module_args { register_t dummy; }; -struct linux_get_kernel_syms_args { - register_t dummy; -}; struct linux_quotactl_args { register_t dummy; }; @@ -526,12 +520,6 @@ struct linux_getresuid16_args { struct linux_vm86_args { register_t dummy; }; -struct linux_query_module_args { - register_t dummy; -}; -struct linux_nfsservctl_args { - register_t dummy; -}; struct linux_setresgid16_args { char rgid_l_[PADL_(l_gid16_t)]; l_gid16_t rgid; char rgid_r_[PADR_(l_gid16_t)]; char egid_l_[PADL_(l_gid16_t)]; l_gid16_t egid; char egid_r_[PADR_(l_gid16_t)]; @@ -1491,10 +1479,8 @@ int linux_modify_ldt(struct thread *, st int linux_adjtimex(struct thread *, struct linux_adjtimex_args *); int linux_mprotect(struct thread *, struct linux_mprotect_args *); int linux_sigprocmask(struct thread *, struct linux_sigprocmask_args *); -int linux_create_module(struct thread *, struct linux_create_module_args *); int linux_init_module(struct thread *, struct linux_init_module_args *); int linux_delete_module(struct thread *, struct linux_delete_module_args *); -int linux_get_kernel_syms(struct thread *, struct linux_get_kernel_syms_args *); int linux_quotactl(struct thread *, struct linux_quotactl_args *); int linux_bdflush(struct thread *, struct linux_bdflush_args *); int linux_sysfs(struct thread *, struct linux_sysfs_args *); @@ -1520,8 +1506,6 @@ int linux_mremap(struct thread *, struct int linux_setresuid16(struct thread *, struct linux_setresuid16_args *); int linux_getresuid16(struct thread *, struct linux_getresuid16_args *); int linux_vm86(struct thread *, struct linux_vm86_args *); -int linux_query_module(struct thread *, struct linux_query_module_args *); -int linux_nfsservctl(struct thread *, struct linux_nfsservctl_args *); int linux_setresgid16(struct thread *, struct linux_setresgid16_args *); int linux_getresgid16(struct thread *, struct linux_getresgid16_args *); int linux_prctl(struct thread *, struct linux_prctl_args *); @@ -1839,10 +1823,8 @@ int linux_pkey_free(struct thread *, str #define LINUX_SYS_AUE_linux_adjtimex AUE_ADJTIME #define LINUX_SYS_AUE_linux_mprotect AUE_MPROTECT #define LINUX_SYS_AUE_linux_sigprocmask AUE_SIGPROCMASK -#define LINUX_SYS_AUE_linux_create_module AUE_NULL #define LINUX_SYS_AUE_linux_init_module AUE_NULL #define LINUX_SYS_AUE_linux_delete_module AUE_NULL -#define LINUX_SYS_AUE_linux_get_kernel_syms AUE_NULL #define LINUX_SYS_AUE_linux_quotactl AUE_QUOTACTL #define LINUX_SYS_AUE_linux_bdflush AUE_BDFLUSH #define LINUX_SYS_AUE_linux_sysfs AUE_NULL @@ -1868,8 +1850,6 @@ int linux_pkey_free(struct thread *, str #define LINUX_SYS_AUE_linux_setresuid16 AUE_SETRESUID #define LINUX_SYS_AUE_linux_getresuid16 AUE_GETRESUID #define LINUX_SYS_AUE_linux_vm86 AUE_NULL -#define LINUX_SYS_AUE_linux_query_module AUE_NULL -#define LINUX_SYS_AUE_linux_nfsservctl AUE_NULL #define LINUX_SYS_AUE_linux_setresgid16 AUE_SETRESGID #define LINUX_SYS_AUE_linux_getresgid16 AUE_GETRESGID #define LINUX_SYS_AUE_linux_prctl AUE_PRCTL Modified: stable/11/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/11/sys/i386/linux/linux_syscall.h Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/i386/linux/linux_syscall.h Tue Apr 11 13:42:26 2017 (r316703) @@ -122,10 +122,8 @@ #define LINUX_SYS_linux_adjtimex 124 #define LINUX_SYS_linux_mprotect 125 #define LINUX_SYS_linux_sigprocmask 126 -#define LINUX_SYS_linux_create_module 127 #define LINUX_SYS_linux_init_module 128 #define LINUX_SYS_linux_delete_module 129 -#define LINUX_SYS_linux_get_kernel_syms 130 #define LINUX_SYS_linux_quotactl 131 #define LINUX_SYS_getpgid 132 #define LINUX_SYS_fchdir 133 @@ -161,9 +159,7 @@ #define LINUX_SYS_linux_setresuid16 164 #define LINUX_SYS_linux_getresuid16 165 #define LINUX_SYS_linux_vm86 166 -#define LINUX_SYS_linux_query_module 167 #define LINUX_SYS_poll 168 -#define LINUX_SYS_linux_nfsservctl 169 #define LINUX_SYS_linux_setresgid16 170 #define LINUX_SYS_linux_getresgid16 171 #define LINUX_SYS_linux_prctl 172 Modified: stable/11/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/11/sys/i386/linux/linux_syscalls.c Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/i386/linux/linux_syscalls.c Tue Apr 11 13:42:26 2017 (r316703) @@ -135,10 +135,10 @@ const char *linux_syscallnames[] = { "linux_adjtimex", /* 124 = linux_adjtimex */ "linux_mprotect", /* 125 = linux_mprotect */ "linux_sigprocmask", /* 126 = linux_sigprocmask */ - "linux_create_module", /* 127 = linux_create_module */ + "#127", /* 127 = create_module */ "linux_init_module", /* 128 = linux_init_module */ "linux_delete_module", /* 129 = linux_delete_module */ - "linux_get_kernel_syms", /* 130 = linux_get_kernel_syms */ + "#130", /* 130 = get_kernel_syms */ "linux_quotactl", /* 131 = linux_quotactl */ "getpgid", /* 132 = getpgid */ "fchdir", /* 133 = fchdir */ @@ -175,9 +175,9 @@ const char *linux_syscallnames[] = { "linux_setresuid16", /* 164 = linux_setresuid16 */ "linux_getresuid16", /* 165 = linux_getresuid16 */ "linux_vm86", /* 166 = linux_vm86 */ - "linux_query_module", /* 167 = linux_query_module */ + "#167", /* 167 = query_module */ "poll", /* 168 = poll */ - "linux_nfsservctl", /* 169 = linux_nfsservctl */ + "#169", /* 169 = nfsservctl */ "linux_setresgid16", /* 170 = linux_setresgid16 */ "linux_getresgid16", /* 171 = linux_getresgid16 */ "linux_prctl", /* 172 = linux_prctl */ Modified: stable/11/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysent.c Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/i386/linux/linux_sysent.c Tue Apr 11 13:42:26 2017 (r316703) @@ -145,10 +145,10 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_adjtimex, AUE_ADJTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 124 = linux_adjtimex */ { AS(linux_mprotect_args), (sy_call_t *)linux_mprotect, AUE_MPROTECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 125 = linux_mprotect */ { AS(linux_sigprocmask_args), (sy_call_t *)linux_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 126 = linux_sigprocmask */ - { 0, (sy_call_t *)linux_create_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 127 = linux_create_module */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 127 = create_module */ { 0, (sy_call_t *)linux_init_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 128 = linux_init_module */ { 0, (sy_call_t *)linux_delete_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 129 = linux_delete_module */ - { 0, (sy_call_t *)linux_get_kernel_syms, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 130 = linux_get_kernel_syms */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 130 = get_kernel_syms */ { 0, (sy_call_t *)linux_quotactl, AUE_QUOTACTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 131 = linux_quotactl */ { AS(getpgid_args), (sy_call_t *)sys_getpgid, AUE_GETPGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 132 = getpgid */ { AS(fchdir_args), (sy_call_t *)sys_fchdir, AUE_FCHDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 133 = fchdir */ @@ -185,9 +185,9 @@ struct sysent linux_sysent[] = { { AS(linux_setresuid16_args), (sy_call_t *)linux_setresuid16, AUE_SETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 164 = linux_setresuid16 */ { AS(linux_getresuid16_args), (sy_call_t *)linux_getresuid16, AUE_GETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 165 = linux_getresuid16 */ { 0, (sy_call_t *)linux_vm86, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 166 = linux_vm86 */ - { 0, (sy_call_t *)linux_query_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 167 = linux_query_module */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 167 = query_module */ { AS(poll_args), (sy_call_t *)sys_poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 168 = poll */ - { 0, (sy_call_t *)linux_nfsservctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 169 = linux_nfsservctl */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 169 = nfsservctl */ { AS(linux_setresgid16_args), (sy_call_t *)linux_setresgid16, AUE_SETRESGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 170 = linux_setresgid16 */ { AS(linux_getresgid16_args), (sy_call_t *)linux_getresgid16, AUE_GETRESGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 171 = linux_getresgid16 */ { AS(linux_prctl_args), (sy_call_t *)linux_prctl, AUE_PRCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 172 = linux_prctl */ Modified: stable/11/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/i386/linux/linux_systrace_args.c Tue Apr 11 13:31:27 2017 (r316702) +++ stable/11/sys/i386/linux/linux_systrace_args.c Tue Apr 11 13:42:26 2017 (r316703) @@ -892,11 +892,6 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* linux_create_module */ - case 127: { - *n_args = 0; - break; - } /* linux_init_module */ case 128: { *n_args = 0; @@ -907,11 +902,6 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } - /* linux_get_kernel_syms */ - case 130: { - *n_args = 0; - break; - } /* linux_quotactl */ case 131: { *n_args = 0; @@ -1182,11 +1172,6 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } - /* linux_query_module */ - case 167: { - *n_args = 0; - break; - } /* poll */ case 168: { struct poll_args *p = params; @@ -1196,11 +1181,6 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* linux_nfsservctl */ - case 169: { - *n_args = 0; - break; - } /* linux_setresgid16 */ case 170: { struct linux_setresgid16_args *p = params; @@ -4160,18 +4140,12 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* linux_create_module */ - case 127: - break; /* linux_init_module */ case 128: break; /* linux_delete_module */ case 129: break; - /* linux_get_kernel_syms */ - case 130: - break; /* linux_quotactl */ case 131: break; @@ -4592,9 +4566,6 @@ systrace_entry_setargdesc(int sysnum, in /* linux_vm86 */ case 166: break; - /* linux_query_module */ - case 167: - break; /* poll */ case 168: switch(ndx) { @@ -4611,9 +4582,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* linux_nfsservctl */ - case 169: - break; /* linux_setresgid16 */ case 170: switch(ndx) { @@ -7717,14 +7685,10 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* linux_create_module */ - case 127: /* linux_init_module */ case 128: /* linux_delete_module */ case 129: - /* linux_get_kernel_syms */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 11 15:20:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2397AD39C6E; Tue, 11 Apr 2017 15:20:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D13C0B70; Tue, 11 Apr 2017 15:20:33 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BFKXMJ097542; Tue, 11 Apr 2017 15:20:33 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BFKWAi097541; Tue, 11 Apr 2017 15:20:32 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201704111520.v3BFKWAi097541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 11 Apr 2017 15:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316704 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 15:20:34 -0000 Author: tsoome Date: Tue Apr 11 15:20:32 2017 New Revision: 316704 URL: https://svnweb.freebsd.org/changeset/base/316704 Log: loader.efi: only fetch zfs pool guid for the actual boot device With the zfs probe cleanup, the mistake did slip in the probe code; instead of reading the pool GUID for the actual boot device (partition), we read GUID for first found pool from the boot disk. This will break the case when there are both zfs pool and ufs on the boot disk, and the ufs is used for boot, not zfs. Reviewed by: smh Differential Revision: https://reviews.freebsd.org/D10359 Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Tue Apr 11 13:42:26 2017 (r316703) +++ head/sys/boot/efi/loader/main.c Tue Apr 11 15:20:32 2017 (r316704) @@ -804,38 +804,26 @@ efi_zfs_probe(void) pdinfo_t *hd, *pd = NULL; EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; EFI_LOADED_IMAGE *img; - EFI_HANDLE boot_disk = NULL; char devname[SPECNAMELEN + 1]; - uint64_t *guidp = NULL; BS->HandleProtocol(IH, &imgid, (VOID**)&img); - - /* Find the handle for the boot disk. */ hdi = efiblk_get_pdinfo_list(&efipart_hddev); - STAILQ_FOREACH(hd, hdi, pd_link) { - STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { - if (pd->pd_handle == img->DeviceHandle) - boot_disk = hd->pd_handle; - } - } /* - * We provide non-NULL guid pointer if the disk was used for boot, - * and reset after the first found pool. - * Technically this solution is not very correct, we assume the boot - * pool is the first pool on this disk. + * Find the handle for the boot device. The boot1 did find the + * device with loader binary, now we need to search for the + * same device and if it is part of the zfs pool, we record the + * pool GUID for currdev setup. */ - STAILQ_FOREACH(hd, hdi, pd_link) { - if (hd->pd_handle == boot_disk) - guidp = &pool_guid; - STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { + snprintf(devname, sizeof(devname), "%s%dp%d:", efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit); - (void) zfs_probe_dev(devname, guidp); - if (guidp != NULL && pool_guid != 0) - guidp = NULL; + if (pd->pd_handle == img->DeviceHandle) + (void) zfs_probe_dev(devname, &pool_guid); + else + (void) zfs_probe_dev(devname, NULL); } } } From owner-svn-src-all@freebsd.org Tue Apr 11 16:32:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABD09D39E2B; Tue, 11 Apr 2017 16:32:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 638EFCDC; Tue, 11 Apr 2017 16:32:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BGWkU6032739; Tue, 11 Apr 2017 16:32:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BGWkWd032738; Tue, 11 Apr 2017 16:32:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704111632.v3BGWkWd032738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 11 Apr 2017 16:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316705 - stable/11/usr.bin/sdiff X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 16:32:47 -0000 Author: bapt Date: Tue Apr 11 16:32:46 2017 New Revision: 316705 URL: https://svnweb.freebsd.org/changeset/base/316705 Log: MFC r316637-r316638 r316637: When passingthrough from sdiff to diff the -H/--speed-large-files options rename it to the long version as GNU diff only support the long version of the option not the short version r316638: Remove a useless loop over the long options before passing through some options to diff(1) Modified: stable/11/usr.bin/sdiff/sdiff.1 stable/11/usr.bin/sdiff/sdiff.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/sdiff/sdiff.1 ============================================================================== --- stable/11/usr.bin/sdiff/sdiff.1 Tue Apr 11 15:20:32 2017 (r316704) +++ stable/11/usr.bin/sdiff/sdiff.1 Tue Apr 11 16:32:46 2017 (r316705) @@ -4,7 +4,7 @@ .\" Written by Raymond Lai . .\" Public domain. .\" -.Dd $Mdocdate: July 5 2012 $ +.Dd April 8, 2017 .Dt SDIFF 1 .Os .Sh NAME @@ -12,7 +12,7 @@ .Nd side-by-side diff .Sh SYNOPSIS .Nm -.Op Fl abdilstW +.Op Fl abdilstHW .Op Fl I Ar regexp .Op Fl o Ar outfile .Op Fl w Ar width Modified: stable/11/usr.bin/sdiff/sdiff.c ============================================================================== --- stable/11/usr.bin/sdiff/sdiff.c Tue Apr 11 15:20:32 2017 (r316704) +++ stable/11/usr.bin/sdiff/sdiff.c Tue Apr 11 16:32:46 2017 (r316705) @@ -214,7 +214,6 @@ main(int argc, char **argv) int ch, fd[2] = {-1}, status; pid_t pid=0; const char *outfile = NULL; - struct option *popt; char **diffargv, *diffprog = DIFF_PATH, *filename1, *filename2, *tmp1, *tmp2, *s1, *s2; int i; @@ -260,9 +259,7 @@ main(int argc, char **argv) case 'E': case 'i': case 't': - case 'H': case 'W': - for(popt = longopts; ch != popt->val && popt->name != NULL; popt++); diffargv[1] = realloc(diffargv[1], sizeof(char) * strlen(diffargv[1]) + 2); /* * In diff, the 'W' option is 'w' and the 'w' is 'W'. @@ -272,6 +269,9 @@ main(int argc, char **argv) else sprintf(diffargv[1], "%s%c", diffargv[1], ch); break; + case 'H': + diffargv[diffargc++] = "--speed-large-files"; + break; case DIFFPROG_OPT: diffargv[0] = diffprog = optarg; break; @@ -1152,7 +1152,7 @@ usage(void) { fprintf(stderr, - "usage: sdiff [-abdilstW] [-I regexp] [-o outfile] [-w width] file1" + "usage: sdiff [-abdilstHW] [-I regexp] [-o outfile] [-w width] file1" " file2\n"); exit(2); } From owner-svn-src-all@freebsd.org Tue Apr 11 16:51:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECC7BD3A5C2; Tue, 11 Apr 2017 16:51:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5085AA0; Tue, 11 Apr 2017 16:51:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3BGpZJ9075425; Tue, 11 Apr 2017 09:51:35 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3BGpZi9075424; Tue, 11 Apr 2017 09:51:35 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704111651.v3BGpZi9075424@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316699 - head/sys/net In-Reply-To: <201704110856.v3B8uJq5039806@repo.freebsd.org> To: "Andrey V. Elsukov" Date: Tue, 11 Apr 2017 09:51:35 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 16:51:37 -0000 > Author: ae > Date: Tue Apr 11 08:56:18 2017 > New Revision: 316699 > URL: https://svnweb.freebsd.org/changeset/base/316699 > > Log: > Do not adjust interface MTU automatically. Leave this task to the system > administrator. > > This restores the behavior that was prior to r274246. > > No objection from: #network > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D10215 > > Modified: > head/sys/net/if_gre.c > head/sys/net/if_gre.h > head/sys/net/if_me.c > > Modified: head/sys/net/if_gre.c > ============================================================================== > --- head/sys/net/if_gre.c Tue Apr 11 08:29:12 2017 (r316698) > +++ head/sys/net/if_gre.c Tue Apr 11 08:56:18 2017 (r316699) > @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -#define GREMTU 1500 > +#define GREMTU 1476 I would of thought that this was #define GREMTU ETHERMTU and now should probably be: #define GREMTU ETHERMTU - gre_hlen; Or what ever the approprite sizeof(foo) is; Isn't this arguably wrong in the face of JumboFrames? > static const char grename[] = "gre"; > static MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation"); > static VNET_DEFINE(struct mtx, gre_mtx); > @@ -173,7 +173,7 @@ gre_clone_create(struct if_clone *ifc, i > GRE2IFP(sc)->if_softc = sc; > if_initname(GRE2IFP(sc), grename, unit); > > - GRE2IFP(sc)->if_mtu = sc->gre_mtu = GREMTU; > + GRE2IFP(sc)->if_mtu = GREMTU; > GRE2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST; > GRE2IFP(sc)->if_output = gre_output; > GRE2IFP(sc)->if_ioctl = gre_ioctl; > @@ -231,7 +231,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, > /* XXX: */ > if (ifr->ifr_mtu < 576) This is another magic constant that should be in a #define. > return (EINVAL); > - break; > + ifp->if_mtu = ifr->ifr_mtu; > + return (0); > case SIOCSIFADDR: > ifp->if_flags |= IFF_UP; > case SIOCSIFFLAGS: > @@ -255,12 +256,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, > } > error = 0; > switch (cmd) { > - case SIOCSIFMTU: > - GRE_WLOCK(sc); > - sc->gre_mtu = ifr->ifr_mtu; > - gre_updatehdr(sc); > - GRE_WUNLOCK(sc); > - goto end; > case SIOCSIFPHYADDR: > #ifdef INET6 > case SIOCSIFPHYADDR_IN6: > @@ -549,7 +544,6 @@ gre_updatehdr(struct gre_softc *sc) > } else > sc->gre_oseq = 0; > gh->gre_flags = htons(flags); > - GRE2IFP(sc)->if_mtu = sc->gre_mtu - sc->gre_hlen; > } > > static void > > Modified: head/sys/net/if_gre.h > ============================================================================== > --- head/sys/net/if_gre.h Tue Apr 11 08:29:12 2017 (r316698) > +++ head/sys/net/if_gre.h Tue Apr 11 08:56:18 2017 (r316699) > @@ -69,7 +69,6 @@ struct gre_softc { > uint32_t gre_oseq; > uint32_t gre_key; > uint32_t gre_options; > - uint32_t gre_mtu; > u_int gre_fibnum; > u_int gre_hlen; /* header size */ > union { > > Modified: head/sys/net/if_me.c > ============================================================================== > --- head/sys/net/if_me.c Tue Apr 11 08:29:12 2017 (r316698) > +++ head/sys/net/if_me.c Tue Apr 11 08:56:18 2017 (r316699) > @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -#define MEMTU 1500 > +#define MEMTU (1500 - sizeof(struct mobhdr)) 1500 -> ETHERMTU? > static const char mename[] = "me"; > static MALLOC_DEFINE(M_IFME, mename, "Minimal Encapsulation for IP"); > static VNET_DEFINE(struct mtx, me_mtx); > @@ -186,7 +186,7 @@ me_clone_create(struct if_clone *ifc, in > ME2IFP(sc)->if_softc = sc; > if_initname(ME2IFP(sc), mename, unit); > > - ME2IFP(sc)->if_mtu = MEMTU - sizeof(struct mobhdr); > + ME2IFP(sc)->if_mtu = MEMTU;; > ME2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST; > ME2IFP(sc)->if_output = me_output; > ME2IFP(sc)->if_ioctl = me_ioctl; > @@ -236,7 +236,7 @@ me_ioctl(struct ifnet *ifp, u_long cmd, > case SIOCSIFMTU: > if (ifr->ifr_mtu < 576) > return (EINVAL); > - ifp->if_mtu = ifr->ifr_mtu - sizeof(struct mobhdr); > + ifp->if_mtu = ifr->ifr_mtu; > return (0); > case SIOCSIFADDR: > ifp->if_flags |= IFF_UP; > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Apr 11 16:55:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D8B0D3A654; Tue, 11 Apr 2017 16:55:44 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 1F57BCF9; Tue, 11 Apr 2017 16:55:43 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id C2B8117893; Tue, 11 Apr 2017 09:47:55 -0700 (PDT) Date: Tue, 11 Apr 2017 09:47:55 -0700 From: hiren panchasara To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316699 - head/sys/net Message-ID: <20170411164755.GK74488@strugglingcoder.info> References: <201704110856.v3B8uJq5039806@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zH41lVBEV8cLJnCl" Content-Disposition: inline In-Reply-To: <201704110856.v3B8uJq5039806@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 16:55:44 -0000 --zH41lVBEV8cLJnCl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 04/11/17 at 08:56P, Andrey V. Elsukov wrote: > Author: ae > Date: Tue Apr 11 08:56:18 2017 > New Revision: 316699 > URL: https://svnweb.freebsd.org/changeset/base/316699 >=20 > Log: > Do not adjust interface MTU automatically. Leave this task to the system > administrator. > =20 > This restores the behavior that was prior to r274246. Hi Andrey, I was going to ask for more context and then I saw that phabric review has a lot more details that I wish were a part of the commit log. Cheers, Hiren --zH41lVBEV8cLJnCl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJY7Qi4XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lhF0H/2Mi8YgIhEdwxVQBcYNJK4Cb yEuSgfgY85xhIr1ggeu9EYoWT44Vi2RawSGHcNXa7U4niwHDnT/jV9dhex9A8UF/ 66WX6Hg6reTtMZeS5HmXu5Iy1NvRDSvvVkl5T9g4rdguz8ZpqGdpGs3ZWDST2Tbu qUePhDwtoj2EVMseEtHFtvsqw1VyNNGQClGrMSkqd1qSTtJXT1IB8rGIFVsgGgR2 B2OfX1AH6TB7bHZjJHwsj4xBIAii5ueCmeXm7J9ixqiDKnELaXmsc/QAKRlCDDoP dASH2aGWrRTA3OzT71XHCDqsjVjzmjnJX43+Cz/0zwYdU6RXs1gVL1i7EU/C6vw= =hXhD -----END PGP SIGNATURE----- --zH41lVBEV8cLJnCl-- From owner-svn-src-all@freebsd.org Tue Apr 11 17:01:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F09ECD3A7A5; Tue, 11 Apr 2017 17:01:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A74C8FD2; Tue, 11 Apr 2017 17:01:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BH1Kfc043419; Tue, 11 Apr 2017 17:01:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BH1Kxq043418; Tue, 11 Apr 2017 17:01:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704111701.v3BH1Kxq043418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 11 Apr 2017 17:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316706 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 17:01:22 -0000 Author: emaste Date: Tue Apr 11 17:01:20 2017 New Revision: 316706 URL: https://svnweb.freebsd.org/changeset/base/316706 Log: makeman: don't copy $FreeBSD$ tags from source files into output Copying the source VCS ID from WITH_/WITHOUT_* into the generated src.conf.5 is not necessary, as it is generally possible to determine the same information using the VCS to examine commit metadata. The individual source files also match the name of the option recorded in the generated file, so it is clear from where the content originated. The copied IDs generate extraneous, non-content noise in the generated src.conf.5 in some cases, including the first time the file is generated on a stable branch. In addition, the source file $FreeBSD$ tags are not expanded by git or other non-Subversion VCSs, which means that makeman previously could not be used in a non-Subversion working tree. I accept that there's some desire to keep these, but on balance believe there is more benefit in removing them. Reviewed by: imp, ngie MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7997 Modified: head/tools/build/options/makeman Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Tue Apr 11 16:32:46 2017 (r316705) +++ head/tools/build/options/makeman Tue Apr 11 17:01:20 2017 (r316706) @@ -1,12 +1,12 @@ #!/bin/sh # # This file is in the public domain. +# +# $FreeBSD$ set -o errexit export LC_ALL=C -ident='$FreeBSD$' - t=$(mktemp -d -t makeman) trap 'test -d $t && rm -rf $t' exit @@ -126,12 +126,9 @@ main() { echo "building src.conf.5 man page from files in ${PWD}" >&2 - ident=${ident#$} - ident=${ident% $} fbsdid='$'FreeBSD'$' cat < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DB3DD3AA73; Tue, 11 Apr 2017 17:06:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2FD88A9; Tue, 11 Apr 2017 17:06:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BH6qPh045038; Tue, 11 Apr 2017 17:06:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BH6qlY045037; Tue, 11 Apr 2017 17:06:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704111706.v3BH6qlY045037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 11 Apr 2017 17:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316707 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 17:06:54 -0000 Author: emaste Date: Tue Apr 11 17:06:52 2017 New Revision: 316707 URL: https://svnweb.freebsd.org/changeset/base/316707 Log: Regenerate src.conf.5 after r316706 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Apr 11 17:01:20 2017 (r316706) +++ head/share/man/man5/src.conf.5 Tue Apr 11 17:06:52 2017 (r316707) @@ -1,5 +1,4 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: head/tools/build/options/makeman 315768 2017-03-23 02:26:15Z ngie .\" $FreeBSD$ .Dd April 10, 2017 .Dt SRC.CONF 5 @@ -94,56 +93,45 @@ This list provides a name and short desc that can be used for source builds. .Bl -tag -width indent .It Va WITHOUT_ACCT -.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed Set to not build process accounting tools such as .Xr accton 8 and .Xr sa 8 . .It Va WITHOUT_ACPI -.\" from FreeBSD: head/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru Set to not build .Xr acpiconf 8 , .Xr acpidump 8 and related programs. .It Va WITHOUT_AMD -.\" from FreeBSD: head/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam Set to not build .Xr amd 8 , and related programs. .It Va WITHOUT_APM -.\" from FreeBSD: head/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam Set to not build .Xr apm 8 , .Xr apmd 8 and related programs. .It Va WITHOUT_ASSERT_DEBUG -.\" from FreeBSD: head/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru Set to compile programs and libraries without the .Xr assert 3 checks. .It Va WITHOUT_AT -.\" from FreeBSD: head/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam Set to not build .Xr at 1 and related utilities. .It Va WITHOUT_ATM -.\" from FreeBSD: head/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru Set to not build programs and libraries related to ATM networking. .It Va WITHOUT_AUDIT -.\" from FreeBSD: head/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru Set to not build audit support into system programs. .It Va WITHOUT_AUTHPF -.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru Set to not build .Xr authpf 8 . .It Va WITHOUT_AUTOFS -.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTOFS 296264 2016-03-01 11:36:10Z trasz Set to not build .Xr autofs 5 related programs, libraries, and kernel modules. .It Va WITH_AUTO_OBJ -.\" from FreeBSD: head/tools/build/options/WITH_AUTO_OBJ 284708 2015-06-22 20:21:57Z sjg Enable automatic creation of objdirs. .Pp This must be set in the environment, make command line, or @@ -151,14 +139,12 @@ This must be set in the environment, mak not .Pa /etc/src.conf . .It Va WITHOUT_BHYVE -.\" from FreeBSD: head/tools/build/options/WITHOUT_BHYVE 277727 2015-01-26 06:44:48Z ngie Set to not build or install .Xr bhyve 8 , associated utilities, and examples. .Pp This option only affects amd64/amd64. .It Va WITHOUT_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 286332 2015-08-05 18:30:00Z emaste Set to not build or install binutils (as, ld, objcopy, and objdump ) as part of the normal system build. The resulting system cannot build programs from source. @@ -172,14 +158,12 @@ When set, it enforces these options: .Va WITHOUT_GDB .El .It Va WITH_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITH_BINUTILS 295491 2016-02-11 00:14:00Z emaste Set to build and install binutils (as, ld, objcopy, and objdump) as part of the normal system build. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 295490 2016-02-10 23:57:09Z emaste Set to not build binutils (as, ld, objcopy and objdump) as part of the bootstrap process. .Bf -symbolic @@ -190,14 +174,12 @@ toolchain is provided. This is a default setting on arm64/aarch64. .It Va WITH_BINUTILS_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITH_BINUTILS_BOOTSTRAP 295491 2016-02-11 00:14:00Z emaste Set build binutils (as, ld, objcopy and objdump) as part of the bootstrap process. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_BLACKLIST -.\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST 313169 2017-02-03 19:09:46Z wblock Set this if you do not want to build blacklistd/blacklistctl. When set, it enforces these options: .Pp @@ -206,7 +188,6 @@ When set, it enforces these options: .Va WITHOUT_BLACKLIST_SUPPORT .El .It Va WITHOUT_BLACKLIST_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT 301554 2016-06-07 16:35:55Z lidl Set to build some programs without blacklistd support, like .Xr fingerd 8 , .Xr ftpd 8 , @@ -215,39 +196,30 @@ Set to build some programs without black and .Xr sshd 8 . .It Va WITHOUT_BLUETOOTH -.\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. .It Va WITHOUT_BOOT -.\" from FreeBSD: head/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru Set to not build the boot blocks and loader. .It Va WITHOUT_BOOTPARAMD -.\" from FreeBSD: head/tools/build/options/WITHOUT_BOOTPARAMD 278192 2015-02-04 10:19:32Z ngie Set to not build or install .Xr bootparamd 8 . .It Va WITHOUT_BOOTPD -.\" from FreeBSD: head/tools/build/options/WITHOUT_BOOTPD 278192 2015-02-04 10:19:32Z ngie Set to not build or install .Xr bootpd 8 . .It Va WITHOUT_BSDINSTALL -.\" from FreeBSD: head/tools/build/options/WITHOUT_BSDINSTALL 277677 2015-01-25 04:43:13Z ngie Set to not build .Xr bsdinstall 8 , .Xr sade 8 , and related programs. .It Va WITHOUT_BSD_CPIO -.\" from FreeBSD: head/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . .It Va WITH_BSD_GREP -.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien Install BSD-licensed grep as '[ef]grep' instead of GNU grep. .It Va WITHOUT_BSNMP -.\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam Set to not build or install .Xr bsnmpd 1 and related libraries and data files. .It Va WITHOUT_BZIP2 -.\" from FreeBSD: head/tools/build/options/WITHOUT_BZIP2 174550 2007-12-12 16:43:17Z ru Set to not build contributed bzip2 software as a part of the base system. .Bf -symbolic The option has no effect yet. @@ -259,14 +231,11 @@ When set, it enforces these options: .Va WITHOUT_BZIP2_SUPPORT .El .It Va WITHOUT_BZIP2_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_BZIP2_SUPPORT 166255 2007-01-26 10:19:08Z delphij Set to build some programs without optional bzip2 support. .It Va WITHOUT_CALENDAR -.\" from FreeBSD: head/tools/build/options/WITHOUT_CALENDAR 156932 2006-03-21 07:50:50Z ru Set to not build .Xr calendar 1 . .It Va WITHOUT_CAPSICUM -.\" from FreeBSD: head/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 21:57:58Z rwatson Set to not build Capsicum support into system programs. When set, it enforces these options: .Pp @@ -275,10 +244,8 @@ When set, it enforces these options: .Va WITHOUT_CASPER .El .It Va WITHOUT_CASPER -.\" from FreeBSD: head/tools/build/options/WITHOUT_CASPER 258838 2013-12-02 08:21:28Z pjd Set to not build Casper program and related libraries. .It Va WITH_CCACHE_BUILD -.\" from FreeBSD: head/tools/build/options/WITH_CCACHE_BUILD 313169 2017-02-03 19:09:46Z wblock Set to use .Xr ccache 1 for the build. @@ -318,12 +285,10 @@ See .Xr ccache 1 for more configuration options. .It Va WITHOUT_CCD -.\" from FreeBSD: head/tools/build/options/WITHOUT_CCD 277678 2015-01-25 04:52:48Z ngie Set to not build .Xr geom_ccd 4 and related utilities. .It Va WITHOUT_CDDL -.\" from FreeBSD: head/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb Set to not build code licensed under Sun's CDDL. When set, it enforces these options: .Pp @@ -334,7 +299,6 @@ When set, it enforces these options: .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 264660 2014-04-18 17:03:58Z imp Set to not build the Clang C/C++ compiler during the regular phase of the build. .Pp This is a default setting on @@ -348,13 +312,11 @@ When set, it enforces these options: .Va WITHOUT_CLANG_FULL .El .It Va WITH_CLANG -.\" from FreeBSD: head/tools/build/options/WITH_CLANG 264660 2014-04-18 17:03:58Z imp Set to build the Clang C/C++ compiler during the normal phase of the build. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_CLANG_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 313169 2017-02-03 19:09:46Z wblock Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. To be able to build the system, either gcc or clang bootstrap must be @@ -363,30 +325,25 @@ enabled unless an alternate compiler is This is a default setting on mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_CLANG_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITH_CLANG_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. .It Va WITH_CLANG_EXTRAS -.\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim Set to build additional clang and llvm tools, such as bugpoint. .It Va WITHOUT_CLANG_FULL -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp This is a default setting on sparc64/sparc64. .It Va WITH_CLANG_FULL -.\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_CLANG_IS_CC -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks Set to install the GCC compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ @@ -396,7 +353,6 @@ and This is a default setting on mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_CLANG_IS_CC -.\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ @@ -406,11 +362,9 @@ and This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. .It Va WITHOUT_CPP -.\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build .Xr cpp 1 . .It Va WITHOUT_CROSS_COMPILER -.\" from FreeBSD: head/tools/build/options/WITHOUT_CROSS_COMPILER 313169 2017-02-03 19:09:46Z wblock Set to not build any cross compiler in the cross-tools stage of buildworld. When compiling a different version of .Fx @@ -436,7 +390,6 @@ When set, it enforces these options: .Va WITHOUT_GCC_BOOTSTRAP .El .It Va WITHOUT_CRYPT -.\" from FreeBSD: head/tools/build/options/WITHOUT_CRYPT 156932 2006-03-21 07:50:50Z ru Set to not build any crypto code. When set, it enforces these options: .Pp @@ -460,34 +413,28 @@ When set, these options are also in effe is set explicitly) .El .It Va WITH_CTF -.\" from FreeBSD: head/tools/build/options/WITH_CTF 228159 2011-11-30 18:22:44Z fjoe Set to compile with CTF (Compact C Type Format) data. CTF data encapsulates a reduced form of debugging information similar to DWARF and the venerable stabs and is required for DTrace. .It Va WITHOUT_CTM -.\" from FreeBSD: head/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam Set to not build .Xr ctm 1 and related utilities. .It Va WITHOUT_CUSE -.\" from FreeBSD: head/tools/build/options/WITHOUT_CUSE 270171 2014-08-19 15:40:26Z hselasky Set to not build CUSE-related programs and libraries. .It Va WITHOUT_CXGBETOOL -.\" from FreeBSD: head/tools/build/options/WITHOUT_CXGBETOOL 314579 2017-03-03 03:11:58Z np Set to not build .Xr cxgbetool 8 .Pp This is a default setting on arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc and powerpc/powerpcspe. .It Va WITH_CXGBETOOL -.\" from FreeBSD: head/tools/build/options/WITH_CXGBETOOL 314579 2017-03-03 03:11:58Z np Set to build .Xr cxgbetool 8 .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_CXX -.\" from FreeBSD: head/tools/build/options/WITHOUT_CXX 281053 2015-04-03 23:55:04Z bdrewery Set to not build .Xr c++ 1 and related libraries. @@ -516,11 +463,9 @@ When set, it enforces these options: .Va WITHOUT_TESTS_SUPPORT .El .It Va WITHOUT_DEBUG_FILES -.\" from FreeBSD: head/tools/build/options/WITHOUT_DEBUG_FILES 290059 2015-10-27 20:49:56Z emaste Set to avoid building or installing standalone debug files for each executable binary and shared library. .It Va WITHOUT_DIALOG -.\" from FreeBSD: head/tools/build/options/WITHOUT_DIALOG 313169 2017-02-03 19:09:46Z wblock Set to not build .Xr dialog 1 , .Xr dialog 3 , @@ -534,10 +479,8 @@ When set, it enforces these options: .Va WITHOUT_BSDINSTALL .El .It Va WITHOUT_DICT -.\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. .It Va WITH_DIRDEPS_BUILD -.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_BUILD 313169 2017-02-03 19:09:46Z wblock This is an experimental build system. For details see http://www.crufty.net/sjg/docs/freebsd-meta-mode.htm. @@ -614,7 +557,6 @@ This must be set in the environment, mak not .Pa /etc/src.conf . .It Va WITH_DIRDEPS_CACHE -.\" from FreeBSD: head/tools/build/options/WITH_DIRDEPS_CACHE 290816 2015-11-14 03:24:48Z sjg Cache result of dirdeps.mk which can save significant time for subsequent builds. Depends on @@ -625,38 +567,31 @@ This must be set in the environment, mak not .Pa /etc/src.conf . .It Va WITHOUT_DMAGENT -.\" from FreeBSD: head/tools/build/options/WITHOUT_DMAGENT 313169 2017-02-03 19:09:46Z wblock Set to not build dma Mail Transport Agent. .It Va WITHOUT_DOCCOMPRESS -.\" from FreeBSD: head/tools/build/options/WITHOUT_DOCCOMPRESS 313169 2017-02-03 19:09:46Z wblock Set to not install compressed system documentation. Only the uncompressed version will be installed. .It Va WITH_DTRACE_TESTS -.\" from FreeBSD: head/tools/build/options/WITH_DTRACE_TESTS 286174 2015-08-02 00:37:33Z markj Set to build and install the DTrace test suite in .Pa /usr/tests/cddl/usr.sbin/dtrace . This test suite is considered experimental on architectures other than amd64/amd64 and running it may cause system instability. .It Va WITHOUT_DYNAMICROOT -.\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru Set this if you do not want to link .Pa /bin and .Pa /sbin dynamically. .It Va WITHOUT_ED_CRYPTO -.\" from FreeBSD: head/tools/build/options/WITHOUT_ED_CRYPTO 235660 2012-05-19 20:05:27Z marcel Set to build .Xr ed 1 without support for encryption/decryption. .It Va WITHOUT_EE -.\" from FreeBSD: head/tools/build/options/WITHOUT_EE 277663 2015-01-25 00:03:44Z ngie Set to not build and install .Xr edit 1 , .Xr ee 1 , and related programs. .It Va WITHOUT_EFI -.\" from FreeBSD: head/tools/build/options/WITHOUT_EFI 311135 2017-01-02 20:07:56Z ngie Set not to build .Xr efivar 3 and @@ -665,7 +600,6 @@ and This is a default setting on mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_EFI -.\" from FreeBSD: head/tools/build/options/WITH_EFI 311135 2017-01-02 20:07:56Z ngie Set to build .Xr efivar 3 and @@ -674,7 +608,6 @@ and This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. .It Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP 295491 2016-02-11 00:14:00Z emaste Set to not build ELF Tool Chain tools (addr2line, nm, size, strings and strip) as part of the bootstrap process. @@ -682,76 +615,60 @@ as part of the bootstrap process. An alternate bootstrap tool chain must be provided. .Ef .It Va WITHOUT_EXAMPLES -.\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru Set to avoid installing examples to .Pa /usr/share/examples/ . .It Va WITH_EXTRA_TCP_STACKS -.\" from FreeBSD: head/tools/build/options/WITH_EXTRA_TCP_STACKS 302247 2016-06-28 13:37:01Z jtl Set to build extra TCP stack modules. .It Va WITHOUT_FDT -.\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru Set to not build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .It Va WITHOUT_FILE -.\" from FreeBSD: head/tools/build/options/WITHOUT_FILE 278193 2015-02-04 10:24:40Z ngie Set to not build .Xr file 1 and related programs. .It Va WITHOUT_FINGER -.\" from FreeBSD: head/tools/build/options/WITHOUT_FINGER 278192 2015-02-04 10:19:32Z ngie Set to not build or install .Xr finger 1 and .Xr fingerd 8 . .It Va WITHOUT_FLOPPY -.\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru Set to not build or install programs for operating floppy disk driver. .It Va WITHOUT_FMTREE -.\" from FreeBSD: head/tools/build/options/WITHOUT_FMTREE 261299 2014-01-30 21:37:43Z brooks Set to not build and install .Pa /usr/sbin/fmtree . .It Va WITHOUT_FORMAT_EXTENSIONS -.\" from FreeBSD: head/tools/build/options/WITHOUT_FORMAT_EXTENSIONS 250658 2013-05-15 13:04:10Z brooks Set to not enable .Fl fformat-extensions when compiling the kernel. Also disables all format checking. .It Va WITHOUT_FORTH -.\" from FreeBSD: head/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru Set to build bootloaders without Forth support. .It Va WITHOUT_FP_LIBC -.\" from FreeBSD: head/tools/build/options/WITHOUT_FP_LIBC 156932 2006-03-21 07:50:50Z ru Set to build .Nm libc without floating-point support. .It Va WITHOUT_FREEBSD_UPDATE -.\" from FreeBSD: head/tools/build/options/WITHOUT_FREEBSD_UPDATE 183242 2008-09-21 22:02:26Z sam Set to not build .Xr freebsd-update 8 . .It Va WITHOUT_FTP -.\" from FreeBSD: head/tools/build/options/WITHOUT_FTP 278192 2015-02-04 10:19:32Z ngie Set to not build or install .Xr ftp 1 and .Xr ftpd 8 . .It Va WITHOUT_GAMES -.\" from FreeBSD: head/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru Set to not build games. .It Va WITHOUT_GCC -.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC 264660 2014-04-18 17:03:58Z imp Set to not build and install gcc and g++ as part of the normal build process. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. .It Va WITH_GCC -.\" from FreeBSD: head/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising Set to build and install gcc and g++. .Pp This is a default setting on mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GCC_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer Set to not build gcc and g++ as part of the bootstrap process. You must enable either gcc or clang bootstrap to be able to build the system, unless an alternative compiler is provided via @@ -760,32 +677,27 @@ XCC. This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. .It Va WITH_GCC_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITH_GCC_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp Set to build gcc and g++ as part of the bootstrap process. .Pp This is a default setting on mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GCOV -.\" from FreeBSD: head/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru Set to not build the .Xr gcov 1 tool. .It Va WITHOUT_GDB -.\" from FreeBSD: head/tools/build/options/WITHOUT_GDB 156932 2006-03-21 07:50:50Z ru Set to not build .Xr gdb 1 . .Pp This is a default setting on arm64/aarch64. .It Va WITH_GDB -.\" from FreeBSD: head/tools/build/options/WITH_GDB 295493 2016-02-11 00:30:51Z emaste Set to build .Xr gdb 1 . .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GNU -.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru Set to not build contributed GNU software as a part of the base system. This option can be useful if the system built must not contain any code covered by the GNU Public License due to legal reasons. @@ -799,47 +711,38 @@ When set, it enforces these options: .Va WITHOUT_GNU_SUPPORT .El .It Va WITHOUT_GNUCXX -.\" from FreeBSD: head/tools/build/options/WITHOUT_GNUCXX 255321 2013-09-06 20:08:03Z theraven Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. .It Va WITH_GNUCXX -.\" from FreeBSD: head/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven Build the GNU C++ stack (g++, libstdc++). This is the default on platforms where gcc is the system compiler. .Pp This is a default setting on mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GNU_DIFF -.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_DIFF 307674 2016-10-20 14:48:57Z emaste Set to not build GNU .Xr diff 1 and .Xr diff3 1 . .It Va WITHOUT_GNU_GREP -.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP 307674 2016-10-20 14:48:57Z emaste Set to not build GNU .Xr grep 1 . .It Va WITHOUT_GNU_GREP_COMPAT -.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT 273421 2014-10-21 20:44:33Z emaste Set this option to omit the gnu extensions to grep from being included in BSD grep. .It Va WITHOUT_GNU_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without optional GNU support. .It Va WITHOUT_GPIO -.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIO 228081 2011-11-28 17:54:34Z dim Set to not build .Xr gpioctl 8 as part of the base system. .It Va WITHOUT_GPL_DTC -.\" from FreeBSD: head/tools/build/options/WITHOUT_GPL_DTC 313169 2017-02-03 19:09:46Z wblock Set to build the BSD licensed version of the device tree compiler rather than the GPLed one from elinux.org. .It Va WITHOUT_GROFF -.\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs Set to not build .Xr groff 1 and @@ -847,27 +750,20 @@ and You should consider installing the textproc/groff port to not break .Xr man 1 . .It Va WITHOUT_GSSAPI -.\" from FreeBSD: head/tools/build/options/WITHOUT_GSSAPI 174548 2007-12-12 16:39:32Z ru Set to not build libgssapi. .It Va WITHOUT_HAST -.\" from FreeBSD: head/tools/build/options/WITHOUT_HAST 277725 2015-01-26 06:27:07Z ngie Set to not build .Xr hastd 8 and related utilities. .It Va WITH_HESIOD -.\" from FreeBSD: head/tools/build/options/WITH_HESIOD 156932 2006-03-21 07:50:50Z ru Set to build Hesiod support. .It Va WITHOUT_HTML -.\" from FreeBSD: head/tools/build/options/WITHOUT_HTML 156932 2006-03-21 07:50:50Z ru Set to not build HTML docs. .It Va WITHOUT_HYPERV -.\" from FreeBSD: head/tools/build/options/WITHOUT_HYPERV 271493 2014-09-13 02:15:31Z delphij Set to not build or install HyperV utilities. .It Va WITHOUT_ICONV -.\" from FreeBSD: head/tools/build/options/WITHOUT_ICONV 254919 2013-08-26 17:15:56Z antoine Set to not build iconv as part of libc. .It Va WITHOUT_INCLUDES -.\" from FreeBSD: head/tools/build/options/WITHOUT_INCLUDES 275138 2014-11-26 20:43:09Z gjb Set to not install header files. This option used to be spelled .Va NO_INCS . @@ -875,7 +771,6 @@ This option used to be spelled The option does not work for build targets. .Ef .It Va WITHOUT_INET -.\" from FreeBSD: head/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz Set to not build programs and libraries related to IPv4 networking. When set, it enforces these options: .Pp @@ -884,7 +779,6 @@ When set, it enforces these options: .Va WITHOUT_INET_SUPPORT .El .It Va WITHOUT_INET6 -.\" from FreeBSD: head/tools/build/options/WITHOUT_INET6 156932 2006-03-21 07:50:50Z ru Set to not build programs and libraries related to IPv6 networking. When set, it enforces these options: @@ -894,17 +788,13 @@ When set, it enforces these options: .Va WITHOUT_INET6_SUPPORT .El .It Va WITHOUT_INET6_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build libraries, programs, and kernel modules without IPv6 support. .It Va WITHOUT_INETD -.\" from FreeBSD: head/tools/build/options/WITHOUT_INETD 278192 2015-02-04 10:19:32Z ngie Set to not build .Xr inetd 8 . .It Va WITHOUT_INET_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz Set to build libraries, programs, and kernel modules without IPv4 support. .It Va WITHOUT_INSTALLLIB -.\" from FreeBSD: head/tools/build/options/WITHOUT_INSTALLLIB 313172 2017-02-03 19:21:28Z wblock Set this to not install optional libraries. For example, when creating a .Xr nanobsd 8 @@ -913,7 +803,6 @@ image. The option does not work for build targets. .Ef .It Va WITH_INSTALL_AS_USER -.\" from FreeBSD: head/tools/build/options/WITH_INSTALL_AS_USER 313169 2017-02-03 19:09:46Z wblock Set to make install targets succeed for non-root users by installing files with owner and group attributes set to that of the user running the @@ -923,13 +812,10 @@ The user still must set the .Va DESTDIR variable to point to a directory where the user has write permissions. .It Va WITHOUT_IPFILTER -.\" from FreeBSD: head/tools/build/options/WITHOUT_IPFILTER 156932 2006-03-21 07:50:50Z ru Set to not build IP Filter package. .It Va WITHOUT_IPFW -.\" from FreeBSD: head/tools/build/options/WITHOUT_IPFW 183242 2008-09-21 22:02:26Z sam Set to not build IPFW tools. .It Va WITHOUT_IPSEC_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_IPSEC_SUPPORT 315765 2017-03-23 02:13:59Z ngie Set to not build the kernel with .Xr ipsec 4 support. @@ -938,22 +824,18 @@ This option is needed for and .Xr tcpmd5 4 . .It Va WITHOUT_ISCSI -.\" from FreeBSD: head/tools/build/options/WITHOUT_ISCSI 277675 2015-01-25 04:20:11Z ngie Set to not build .Xr iscid 8 and related utilities. .It Va WITHOUT_JAIL -.\" from FreeBSD: head/tools/build/options/WITHOUT_JAIL 249966 2013-04-27 04:09:09Z eadler Set to not build tools for the support of jails; e.g., .Xr jail 8 . .It Va WITHOUT_KDUMP -.\" from FreeBSD: head/tools/build/options/WITHOUT_KDUMP 240690 2012-09-19 11:38:37Z zeising Set to not build .Xr kdump 1 and .Xr truss 1 . .It Va WITHOUT_KERBEROS -.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS 313169 2017-02-03 19:09:46Z wblock Set this to not build Kerberos 5 (KTH Heimdal). When set, it enforces these options: .Pp @@ -971,7 +853,6 @@ When set, these options are also in effe is set explicitly) .El .It Va WITHOUT_KERBEROS_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS_SUPPORT 251794 2013-06-15 20:29:07Z eadler Set to build some programs without Kerberos support, like .Xr ssh 1 , .Xr telnet 1 , @@ -979,13 +860,11 @@ Set to build some programs without Kerbe and .Xr telnetd 8 . .It Va WITHOUT_KERNEL_SYMBOLS -.\" from FreeBSD: head/tools/build/options/WITHOUT_KERNEL_SYMBOLS 222189 2011-05-22 18:23:17Z imp Set to not install kernel symbol files. .Bf -symbolic This option is recommended for those people who have small root partitions. .Ef .It Va WITHOUT_KVM -.\" from FreeBSD: head/tools/build/options/WITHOUT_KVM 174550 2007-12-12 16:43:17Z ru Set to not build the .Nm libkvm library as a part of the base system. @@ -999,12 +878,10 @@ When set, it enforces these options: .Va WITHOUT_KVM_SUPPORT .El .It Va WITHOUT_KVM_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_KVM_SUPPORT 170644 2007-06-13 02:08:04Z sepotvin Set to build some programs without optional .Nm libkvm support. .It Va WITHOUT_LDNS -.\" from FreeBSD: head/tools/build/options/WITHOUT_LDNS 255591 2013-09-15 13:11:13Z des Setting this variable will prevent the LDNS library from being built. When set, it enforces these options: .Pp @@ -1015,27 +892,22 @@ When set, it enforces these options: .Va WITHOUT_UNBOUND .El .It Va WITHOUT_LDNS_UTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_LDNS_UTILS 255850 2013-09-24 14:33:31Z des Setting this variable will prevent building the LDNS utilities .Xr drill 1 and .Xr host 1 . .It Va WITHOUT_LEGACY_CONSOLE -.\" from FreeBSD: head/tools/build/options/WITHOUT_LEGACY_CONSOLE 296264 2016-03-01 11:36:10Z trasz Set to not build programs that support a legacy PC console; e.g., .Xr kbdcontrol 1 and .Xr vidcontrol 1 . .It Va WITHOUT_LIB32 -.\" from FreeBSD: head/tools/build/options/WITHOUT_LIB32 274664 2014-11-18 17:06:48Z imp On 64-bit platforms, set to not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. .It Va WITHOUT_LIBCPLUSPLUS -.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBCPLUSPLUS 246262 2013-02-02 22:42:46Z dim Set to avoid building libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD -.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm Set to not build the .Nm libpthread providing library, @@ -1047,17 +919,14 @@ When set, it enforces these options: .Va WITHOUT_LIBTHR .El .It Va WITH_LIBSOFT -.\" from FreeBSD: head/tools/build/options/WITH_LIBSOFT 300325 2016-05-20 19:23:07Z bdrewery On armv6 only, set to enable soft float ABI compatibility libraries. This option is for transitioning to the new hard float ABI. .It Va WITHOUT_LIBTHR -.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBTHR 156932 2006-03-21 07:50:50Z ru Set to not build the .Nm libthr (1:1 threading) library. .It Va WITHOUT_LLD -.\" from FreeBSD: head/tools/build/options/WITHOUT_LLD 309124 2016-11-24 22:54:55Z dim Set to not build LLVM's lld linker. .Pp This is a default setting on @@ -1069,25 +938,21 @@ When set, it enforces these options: .Va WITHOUT_LLD_IS_LD .El .It Va WITH_LLD -.\" from FreeBSD: head/tools/build/options/WITH_LLD 309124 2016-11-24 22:54:55Z dim Set to build LLVM's lld linker. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. .It Va WITHOUT_LLDB -.\" from FreeBSD: head/tools/build/options/WITHOUT_LLDB 289275 2015-10-14 00:23:31Z emaste Set to not build the LLDB debugger. .Pp This is a default setting on arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLDB -.\" from FreeBSD: head/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste Set to build the LLDB debugger. .Pp This is a default setting on amd64/amd64 and arm64/aarch64. .It Va WITHOUT_LLD_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_LLD_BOOTSTRAP 316647 2017-04-09 01:35:19Z emaste Set to not build the LLD linker during the bootstrap phase of the build. To be able to build the system, either Binutils or LLD bootstrap must be @@ -1096,19 +961,16 @@ enabled unless an alternate linker is pr This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITH_LLD_BOOTSTRAP 316647 2017-04-09 01:35:19Z emaste Set to build the LLD linker during the bootstrap phase of the build. .Pp This is a default setting on arm64/aarch64. .It Va WITHOUT_LLD_IS_LD -.\" from FreeBSD: head/tools/build/options/WITHOUT_LLD_IS_LD 312855 2017-01-27 01:59:12Z emaste Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLD_IS_LD -.\" from FreeBSD: head/tools/build/options/WITH_LLD_IS_LD 312855 2017-01-27 01:59:12Z emaste Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp This is a default setting on @@ -1122,41 +984,33 @@ When set, these options are also in effe is set explicitly) .El .It Va WITHOUT_LLVM_LIBUNWIND -.\" from FreeBSD: head/tools/build/options/WITHOUT_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp This is a default setting on arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLVM_LIBUNWIND -.\" from FreeBSD: head/tools/build/options/WITH_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp This is a default setting on amd64/amd64, arm64/aarch64 and i386/i386. .It Va WITHOUT_LOCALES -.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru Set to not build localization files; see .Xr locale 1 . .It Va WITHOUT_LOCATE -.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCATE 183242 2008-09-21 22:02:26Z sam Set to not build .Xr locate 1 and related programs. .It Va WITHOUT_LPR -.\" from FreeBSD: head/tools/build/options/WITHOUT_LPR 156932 2006-03-21 07:50:50Z ru Set to not build .Xr lpr 1 and related programs. .It Va WITHOUT_LS_COLORS -.\" from FreeBSD: head/tools/build/options/WITHOUT_LS_COLORS 235660 2012-05-19 20:05:27Z marcel Set to build .Xr ls 1 without support for colors to distinguish file types. .It Va WITHOUT_LZMA_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_LZMA_SUPPORT 245171 2013-01-08 18:37:12Z obrien Set to build some programs without optional lzma compression support. .It Va WITHOUT_MAIL -.\" from FreeBSD: head/tools/build/options/WITHOUT_MAIL 183242 2008-09-21 22:02:26Z sam Set to not build any mail support (MUA or MTA). When set, it enforces these options: .Pp @@ -1169,17 +1023,14 @@ When set, it enforces these options: .Va WITHOUT_SENDMAIL .El .It Va WITHOUT_MAILWRAPPER -.\" from FreeBSD: head/tools/build/options/WITHOUT_MAILWRAPPER 156932 2006-03-21 07:50:50Z ru Set to not build the .Xr mailwrapper 8 MTA selector. .It Va WITHOUT_MAKE -.\" from FreeBSD: head/tools/build/options/WITHOUT_MAKE 183242 2008-09-21 22:02:26Z sam Set to not install .Xr make 1 and related support files. .It Va WITHOUT_MAN -.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN 156932 2006-03-21 07:50:50Z ru Set to not build manual pages. When set, these options are also in effect: .Pp @@ -1190,11 +1041,9 @@ When set, these options are also in effe is set explicitly) .El .It Va WITHOUT_MANCOMPRESS -.\" from FreeBSD: head/tools/build/options/WITHOUT_MANCOMPRESS 266752 2014-05-27 15:52:27Z gjb Set to not to install compressed man pages. Only the uncompressed versions will be installed. .It Va WITHOUT_MAN_UTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim Set to not build utilities for manual pages, .Xr apropos 1 , .Xr catman 1 , @@ -1204,7 +1053,6 @@ Set to not build utilities for manual pa .Xr manctl 8 , and related support files. .It Va WITH_META_MODE -.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 313169 2017-02-03 19:09:46Z wblock Create .Xr make 1 meta files when building, which can provide a reliable incremental build when @@ -1261,19 +1109,15 @@ This must be set in the environment, mak not .Pa /etc/src.conf . .It Va WITH_NAND -.\" from FreeBSD: head/tools/build/options/WITH_NAND 235537 2012-05-17 10:11:18Z gber Set to build the NAND Flash components. .It Va WITHOUT_NDIS -.\" from FreeBSD: head/tools/build/options/WITHOUT_NDIS 183242 2008-09-21 22:02:26Z sam Set to not build programs and libraries related to NDIS emulation support. .It Va WITHOUT_NETCAT -.\" from FreeBSD: head/tools/build/options/WITHOUT_NETCAT 156932 2006-03-21 07:50:50Z ru Set to not build .Xr nc 1 utility. .It Va WITHOUT_NETGRAPH -.\" from FreeBSD: head/tools/build/options/WITHOUT_NETGRAPH 183242 2008-09-21 22:02:26Z sam Set to not build applications to support .Xr netgraph 4 . When set, it enforces these options: @@ -1287,10 +1131,8 @@ When set, it enforces these options: .Va WITHOUT_NETGRAPH_SUPPORT .El .It Va WITHOUT_NETGRAPH_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_NETGRAPH_SUPPORT 183305 2008-09-23 16:11:15Z sam Set to build libraries, programs, and kernel modules without netgraph support. .It Va WITHOUT_NIS -.\" from FreeBSD: head/tools/build/options/WITHOUT_NIS 156932 2006-03-21 07:50:50Z ru Set to not build .Xr NIS 8 support and related programs. @@ -1300,14 +1142,11 @@ and remove .Sq nis entries. .It Va WITHOUT_NLS -.\" from FreeBSD: head/tools/build/options/WITHOUT_NLS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalogs. .It Va WITHOUT_NLS_CATALOGS -.\" from FreeBSD: head/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalog support for .Xr csh 1 . .It Va WITHOUT_NS_CACHING -.\" from FreeBSD: head/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru Set to disable name caching in the .Pa nsswitch subsystem. @@ -1315,23 +1154,18 @@ The generic caching daemon, .Xr nscd 8 , will not be built either if this option is set. .It Va WITHOUT_NTP -.\" from FreeBSD: head/tools/build/options/WITHOUT_NTP 183242 2008-09-21 22:02:26Z sam Set to not build .Xr ntpd 8 and related programs. .It Va WITH_OFED -.\" from FreeBSD: head/tools/build/options/WITH_OFED 228081 2011-11-28 17:54:34Z dim Set to build the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack. .It Va WITH_OPENLDAP -.\" from FreeBSD: head/tools/build/options/WITH_OPENLDAP 264902 2014-04-24 23:17:31Z imp Enable building openldap support for kerberos. .It Va WITHOUT_OPENSSH -.\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSH. .It Va WITHOUT_OPENSSL -.\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSL. When set, it enforces these options: .Pp @@ -1353,7 +1187,6 @@ When set, these options are also in effe is set explicitly) .El .It Va WITHOUT_PAM -.\" from FreeBSD: head/tools/build/options/WITHOUT_PAM 174550 2007-12-12 16:43:17Z ru Set to not build PAM library and modules. .Bf -symbolic This option is deprecated and does nothing. @@ -1365,18 +1198,15 @@ When set, it enforces these options: .Va WITHOUT_PAM_SUPPORT .El .It Va WITHOUT_PAM_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_PAM_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without PAM support, particularly .Xr ftpd 8 and .Xr ppp 8 . .It Va WITHOUT_PC_SYSINSTALL -.\" from FreeBSD: head/tools/build/options/WITHOUT_PC_SYSINSTALL 245606 2013-01-18 15:57:09Z eadler Set to not build .Xr pc-sysinstall 8 and related programs. .It Va WITHOUT_PF -.\" from FreeBSD: head/tools/build/options/WITHOUT_PF 156932 2006-03-21 07:50:50Z ru Set to not build PF firewall package. When set, it enforces these options: .Pp @@ -1385,41 +1215,33 @@ When set, it enforces these options: .Va WITHOUT_AUTHPF .El .It Va WITHOUT_PKGBOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_PKGBOOTSTRAP 258924 2013-12-04 15:58:42Z bdrewery Set to not build .Xr pkg 7 bootstrap tool. .It Va WITHOUT_PMC -.\" from FreeBSD: head/tools/build/options/WITHOUT_PMC 183242 2008-09-21 22:02:26Z sam Set to not build .Xr pmccontrol 8 and related programs. .It Va WITHOUT_PORTSNAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_PORTSNAP 183242 2008-09-21 22:02:26Z sam Set to not build or install .Xr portsnap 8 and related files. .It Va WITHOUT_PPP -.\" from FreeBSD: head/tools/build/options/WITHOUT_PPP 183242 2008-09-21 22:02:26Z sam Set to not build .Xr ppp 8 and related programs. .It Va WITHOUT_PROFILE -.\" from FreeBSD: head/tools/build/options/WITHOUT_PROFILE 228196 2011-12-02 09:09:54Z fjoe Set to avoid compiling profiled libraries. .It Va WITHOUT_QUOTAS -.\" from FreeBSD: head/tools/build/options/WITHOUT_QUOTAS 296264 2016-03-01 11:36:10Z trasz Set to not build .Xr quota 1 and related programs. .It Va WITHOUT_RADIUS_SUPPORT *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 11 17:13:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC07ED3ACCB; Tue, 11 Apr 2017 17:13:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADD0ADA8; Tue, 11 Apr 2017 17:13:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BHDu2n049059; Tue, 11 Apr 2017 17:13:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BHDuAQ049058; Tue, 11 Apr 2017 17:13:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704111713.v3BHDuAQ049058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 11 Apr 2017 17:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316708 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 17:13:58 -0000 Author: markj Date: Tue Apr 11 17:13:56 2017 New Revision: 316708 URL: https://svnweb.freebsd.org/changeset/base/316708 Log: MFC r315289: When draining a callout, don't clear CALLOUT_ACTIVE while it is running. Modified: stable/11/sys/kern/kern_timeout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_timeout.c ============================================================================== --- stable/11/sys/kern/kern_timeout.c Tue Apr 11 17:06:52 2017 (r316707) +++ stable/11/sys/kern/kern_timeout.c Tue Apr 11 17:13:56 2017 (r316708) @@ -1254,9 +1254,12 @@ again: if (cc_exec_curr(cc, direct) == c) { /* * Succeed we to stop it or not, we must clear the - * active flag - this is what API users expect. + * active flag - this is what API users expect. If we're + * draining and the callout is currently executing, first wait + * until it finishes. */ - c->c_flags &= ~CALLOUT_ACTIVE; + if ((flags & CS_DRAIN) == 0) + c->c_flags &= ~CALLOUT_ACTIVE; if ((flags & CS_DRAIN) != 0) { /* @@ -1315,6 +1318,7 @@ again: PICKUP_GIANT(); CC_LOCK(cc); } + c->c_flags &= ~CALLOUT_ACTIVE; } else if (use_lock && !cc_exec_cancel(cc, direct) && (drain == NULL)) { From owner-svn-src-all@freebsd.org Tue Apr 11 17:15:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14E7BD3AD43; Tue, 11 Apr 2017 17:15:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DACC5EF8; Tue, 11 Apr 2017 17:15:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BHFeoG049182; Tue, 11 Apr 2017 17:15:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BHFeHq049181; Tue, 11 Apr 2017 17:15:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704111715.v3BHFeHq049181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 11 Apr 2017 17:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316709 - stable/11/sys/geom/mirror X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 17:15:41 -0000 Author: markj Date: Tue Apr 11 17:15:39 2017 New Revision: 316709 URL: https://svnweb.freebsd.org/changeset/base/316709 Log: MFC r316175: Avoid sleeping when the mirror I/O queue is non-empty. Modified: stable/11/sys/geom/mirror/g_mirror.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/11/sys/geom/mirror/g_mirror.c Tue Apr 11 17:13:56 2017 (r316708) +++ stable/11/sys/geom/mirror/g_mirror.c Tue Apr 11 17:15:39 2017 (r316709) @@ -1894,6 +1894,10 @@ g_mirror_worker(void *arg) kproc_exit(0); } mtx_lock(&sc->sc_queue_mtx); + if (bioq_first(&sc->sc_queue) != NULL) { + mtx_unlock(&sc->sc_queue_mtx); + continue; + } } sx_xunlock(&sc->sc_lock); /* From owner-svn-src-all@freebsd.org Tue Apr 11 17:16:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC967D3AE16; Tue, 11 Apr 2017 17:16:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE66E1150; Tue, 11 Apr 2017 17:16:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BHGFVQ049261; Tue, 11 Apr 2017 17:16:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BHGFdI049260; Tue, 11 Apr 2017 17:16:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704111716.v3BHGFdI049260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 11 Apr 2017 17:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316710 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 17:16:17 -0000 Author: markj Date: Tue Apr 11 17:16:15 2017 New Revision: 316710 URL: https://svnweb.freebsd.org/changeset/base/316710 Log: MFC r316036: Typo. Modified: stable/11/share/man/man4/rights.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/rights.4 ============================================================================== --- stable/11/share/man/man4/rights.4 Tue Apr 11 17:15:39 2017 (r316709) +++ stable/11/share/man/man4/rights.4 Tue Apr 11 17:16:15 2017 (r316710) @@ -212,7 +212,7 @@ with the .Dv O_EXEC flag; .Dv CAP_READ -is also be required. +is also required. .It Dv CAP_FLOCK Permit .Xr flock 2 , From owner-svn-src-all@freebsd.org Tue Apr 11 17:17:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44E35D3AEAB; Tue, 11 Apr 2017 17:17:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 168A612F9; Tue, 11 Apr 2017 17:17:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BHH55s049344; Tue, 11 Apr 2017 17:17:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BHH5VB049343; Tue, 11 Apr 2017 17:17:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704111717.v3BHH5VB049343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 11 Apr 2017 17:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316711 - stable/11/sys/geom/mirror X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 17:17:06 -0000 Author: markj Date: Tue Apr 11 17:17:05 2017 New Revision: 316711 URL: https://svnweb.freebsd.org/changeset/base/316711 Log: MFC r316032: Refine r301173 a bit. Modified: stable/11/sys/geom/mirror/g_mirror.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/11/sys/geom/mirror/g_mirror.c Tue Apr 11 17:16:15 2017 (r316710) +++ stable/11/sys/geom/mirror/g_mirror.c Tue Apr 11 17:17:05 2017 (r316711) @@ -3011,7 +3011,7 @@ g_mirror_destroy(struct g_mirror_softc * g_topology_assert_not(); sx_assert(&sc->sc_lock, SX_XLOCKED); - if (sc->sc_provider_open != 0 || SCHEDULER_STOPPED()) { + if (sc->sc_provider_open != 0) { switch (how) { case G_MIRROR_DESTROY_SOFT: G_MIRROR_DEBUG(1, @@ -3330,6 +3330,9 @@ g_mirror_shutdown_post_sync(void *arg, i struct g_mirror_softc *sc; int error; + if (panicstr != NULL) + return; + mp = arg; g_topology_lock(); g_mirror_shutdown = 1; From owner-svn-src-all@freebsd.org Tue Apr 11 17:28:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D41A0D39596; Tue, 11 Apr 2017 17:28:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A31CC1D37; Tue, 11 Apr 2017 17:28:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BHSNhf053580; Tue, 11 Apr 2017 17:28:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BHSNbM053579; Tue, 11 Apr 2017 17:28:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704111728.v3BHSNbM053579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 11 Apr 2017 17:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316712 - stable/11/sys/cddl/dev/dtrace X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 17:28:24 -0000 Author: markj Date: Tue Apr 11 17:28:23 2017 New Revision: 316712 URL: https://svnweb.freebsd.org/changeset/base/316712 Log: MFC r315208: Fix a backwards comparison in the code to dump a DTrace debug buffer. Modified: stable/11/sys/cddl/dev/dtrace/dtrace_debug.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/dev/dtrace/dtrace_debug.c ============================================================================== --- stable/11/sys/cddl/dev/dtrace/dtrace_debug.c Tue Apr 11 17:17:05 2017 (r316711) +++ stable/11/sys/cddl/dev/dtrace/dtrace_debug.c Tue Apr 11 17:28:23 2017 (r316712) @@ -106,7 +106,7 @@ dtrace_debug_output(void) for (p = d->first; p < d->next; p++) *p1++ = *p; - } else if (d->next > d->first) { + } else if (d->first > d->next) { char *p1 = dtrace_debug_bufr; count = (uintptr_t) d->last - (uintptr_t) d->first; From owner-svn-src-all@freebsd.org Tue Apr 11 17:36:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C0AD39B07; Tue, 11 Apr 2017 17:36:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53B345E7; Tue, 11 Apr 2017 17:36:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BHaK5n057566; Tue, 11 Apr 2017 17:36:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BHaJqA057557; Tue, 11 Apr 2017 17:36:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704111736.v3BHaJqA057557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 11 Apr 2017 17:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316713 - in stable/11/lib: libproc librtld_db X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 17:36:21 -0000 Author: markj Date: Tue Apr 11 17:36:19 2017 New Revision: 316713 URL: https://svnweb.freebsd.org/changeset/base/316713 Log: MFC r309591: Fix style bugs and remove trailing whitespace in libproc and librtld_db. Modified: stable/11/lib/libproc/_libproc.h stable/11/lib/libproc/libproc.h stable/11/lib/libproc/proc_bkpt.c stable/11/lib/libproc/proc_create.c stable/11/lib/libproc/proc_regs.c stable/11/lib/libproc/proc_rtld.c stable/11/lib/libproc/proc_util.c stable/11/lib/librtld_db/rtld_db.c stable/11/lib/librtld_db/rtld_db.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libproc/_libproc.h ============================================================================== --- stable/11/lib/libproc/_libproc.h Tue Apr 11 17:28:23 2017 (r316712) +++ stable/11/lib/libproc/_libproc.h Tue Apr 11 17:36:19 2017 (r316713) @@ -26,27 +26,27 @@ * $FreeBSD$ */ -#include -#include +#ifndef __LIBPROC_H_ +#define __LIBPROC_H_ + #include -#include #include + #include #include "libproc.h" struct proc_handle { pid_t pid; /* Process ID. */ - int kq; /* Kernel event queue ID. */ int flags; /* Process flags. */ int status; /* Process status (PS_*). */ int wstat; /* Process wait status. */ rd_agent_t *rdap; /* librtld_db agent */ - rd_loadobj_t *rdobjs; - size_t rdobjsz; - size_t nobjs; - struct lwpstatus lwps; - rd_loadobj_t *rdexec; /* rdobj index of program executable. */ + rd_loadobj_t *rdobjs; /* Array of loaded objects. */ + size_t rdobjsz; /* Array size. */ + size_t nobjs; /* Num. objects currently loaded. */ + rd_loadobj_t *rdexec; /* rdobj for program executable. */ + struct lwpstatus lwps; /* Process status. */ char execname[MAXPATHLEN]; /* Path to program executable. */ }; @@ -57,3 +57,5 @@ struct proc_handle { #define DPRINTF(...) do { } while (0) #define DPRINTFX(...) do { } while (0) #endif + +#endif /* __LIBPROC_H_ */ Modified: stable/11/lib/libproc/libproc.h ============================================================================== --- stable/11/lib/libproc/libproc.h Tue Apr 11 17:28:23 2017 (r316712) +++ stable/11/lib/libproc/libproc.h Tue Apr 11 17:36:19 2017 (r316713) @@ -154,4 +154,4 @@ int proc_regset(struct proc_handle *, pr __END_DECLS -#endif /* !_LIBPROC_H_ */ +#endif /* _LIBPROC_H_ */ Modified: stable/11/lib/libproc/proc_bkpt.c ============================================================================== --- stable/11/lib/libproc/proc_bkpt.c Tue Apr 11 17:28:23 2017 (r316712) +++ stable/11/lib/libproc/proc_bkpt.c Tue Apr 11 17:36:19 2017 (r316713) @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * 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 Foundation. + * + * 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. + */ #include __FBSDID("$FreeBSD$"); @@ -33,13 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include + #include "_libproc.h" #if defined(__aarch64__) @@ -121,8 +121,8 @@ proc_bkptset(struct proc_handle *phdl, u piod.piod_addr = &paddr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { - DPRINTF("ERROR: couldn't read instruction at address 0x%" - PRIuPTR, address); + DPRINTF("ERROR: couldn't read instruction at address 0x%jx", + (uintmax_t)address); ret = -1; goto done; } @@ -137,8 +137,8 @@ proc_bkptset(struct proc_handle *phdl, u piod.piod_addr = &paddr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { - DPRINTF("ERROR: couldn't write instruction at address 0x%" - PRIuPTR, address); + DPRINTF("ERROR: couldn't write instruction at address 0x%jx", + (uintmax_t)address); ret = -1; goto done; } @@ -184,15 +184,15 @@ proc_bkptdel(struct proc_handle *phdl, u piod.piod_addr = &paddr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { - DPRINTF("ERROR: couldn't write instruction at address 0x%" - PRIuPTR, address); + DPRINTF("ERROR: couldn't write instruction at address 0x%jx", + (uintmax_t)address); ret = -1; } if (stopped) /* Restart the process if we had to stop it. */ proc_continue(phdl); - + return (ret); } Modified: stable/11/lib/libproc/proc_create.c ============================================================================== --- stable/11/lib/libproc/proc_create.c Tue Apr 11 17:28:23 2017 (r316712) +++ stable/11/lib/libproc/proc_create.c Tue Apr 11 17:36:19 2017 (r316713) @@ -22,10 +22,11 @@ * 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$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include Modified: stable/11/lib/libproc/proc_regs.c ============================================================================== --- stable/11/lib/libproc/proc_regs.c Tue Apr 11 17:28:23 2017 (r316712) +++ stable/11/lib/libproc/proc_regs.c Tue Apr 11 17:36:19 2017 (r316713) @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * 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 Foundation. + * + * 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. + */ #include __FBSDID("$FreeBSD$"); @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include "_libproc.h" int Modified: stable/11/lib/libproc/proc_rtld.c ============================================================================== --- stable/11/lib/libproc/proc_rtld.c Tue Apr 11 17:28:23 2017 (r316712) +++ stable/11/lib/libproc/proc_rtld.c Tue Apr 11 17:36:19 2017 (r316713) @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * 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 Foundation. + * + * 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. + */ #include __FBSDID("$FreeBSD$"); @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include "libproc.h" + #include "_libproc.h" static int Modified: stable/11/lib/libproc/proc_util.c ============================================================================== --- stable/11/lib/libproc/proc_util.c Tue Apr 11 17:28:23 2017 (r316712) +++ stable/11/lib/libproc/proc_util.c Tue Apr 11 17:36:19 2017 (r316713) @@ -2,7 +2,7 @@ * Copyright (c) 2010 The FreeBSD Foundation * Copyright (c) 2008 John Birrell (jb@freebsd.org) * All rights reserved. - * + * * Portions of this software were developed by Rui Paulo under sponsorship * from the FreeBSD Foundation. * @@ -26,18 +26,21 @@ * 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$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include + #include #include #include #include #include + #include "_libproc.h" int @@ -58,13 +61,15 @@ proc_clearflags(struct proc_handle *phdl int proc_continue(struct proc_handle *phdl) { - int pending = 0; + int pending; if (phdl == NULL) return (-1); if (phdl->status == PS_STOP && WSTOPSIG(phdl->wstat) != SIGTRAP) pending = WSTOPSIG(phdl->wstat); + else + pending = 0; if (ptrace(PT_CONTINUE, phdl->pid, (caddr_t)(uintptr_t)1, pending) != 0) return (-1); @@ -104,7 +109,7 @@ proc_getflags(struct proc_handle *phdl) if (phdl == NULL) return (-1); - return(phdl->flags); + return (phdl->flags); } int Modified: stable/11/lib/librtld_db/rtld_db.c ============================================================================== --- stable/11/lib/librtld_db/rtld_db.c Tue Apr 11 17:28:23 2017 (r316712) +++ stable/11/lib/librtld_db/rtld_db.c Tue Apr 11 17:36:19 2017 (r316713) @@ -1,36 +1,36 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * 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 Foundation. + * + * 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. */ #include __FBSDID("$FreeBSD$"); -#include -#include +#include +#include #include #include @@ -152,7 +152,7 @@ rd_loadobj_iter(rd_agent_t *rdap, rl_ite DPRINTF("%s\n", __func__); - if ((kves = kinfo_getvmmap(proc_getpid(rdap->rda_php), &cnt)) == NULL) { + if ((kves = kinfo_getvmmap(proc_getpid(rdap->rda_php), &cnt)) == NULL) { warn("ERROR: kinfo_getvmmap() failed"); return (RD_ERR); } Modified: stable/11/lib/librtld_db/rtld_db.h ============================================================================== --- stable/11/lib/librtld_db/rtld_db.h Tue Apr 11 17:28:23 2017 (r316712) +++ stable/11/lib/librtld_db/rtld_db.h Tue Apr 11 17:36:19 2017 (r316713) @@ -1,33 +1,33 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * 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 Foundation. + * + * 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$ - */ + */ #ifndef _RTLD_DB_H_ #define _RTLD_DB_H_ From owner-svn-src-all@freebsd.org Tue Apr 11 18:16:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86C14D3A971; Tue, 11 Apr 2017 18:16:56 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward2p.cmail.yandex.net (forward2p.cmail.yandex.net [IPv6:2a02:6b8:0:1465::12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 263CF122; Tue, 11 Apr 2017 18:16:55 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [IPv6:2a02:6b8:0:801::ab]) by forward2p.cmail.yandex.net (Yandex) with ESMTP id B99BD20FAD; Tue, 11 Apr 2017 21:16:42 +0300 (MSK) Received: from smtp1j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1j.mail.yandex.net (Yandex) with ESMTP id BF0DA3C807F1; Tue, 11 Apr 2017 21:16:40 +0300 (MSK) Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dXWgLJ60xq-GdJmCRwC; Tue, 11 Apr 2017 21:16:39 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1491934599; bh=P+tVge53SkqWA0resiUVCJtwc1k1iIeH7WW3yI2TRvM=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=mtDMKgtYarHxJj1cUzpfhFxrSuFuqTVQw7a+NJBnFSmqw8240HgvPpnDNuKpO+2Ot tDQWcTrFWtCmyr0M1Qi529+VhAQDOtiqOIU+/S5HDs2lxVMMHwcB8cXLonPUDz793U OPMyUMmaF4crkZWmdfoyKS/X6wwbOhTt2xFjTK3w= Authentication-Results: smtp1j.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: svn commit: r316699 - head/sys/net To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704111651.v3BGpZi9075424@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: Date: Tue, 11 Apr 2017 21:15:26 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <201704111651.v3BGpZi9075424@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="q7enxoxO3R9ralDvMPPHsDLWwrGP6tsB7" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 18:16:56 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --q7enxoxO3R9ralDvMPPHsDLWwrGP6tsB7 Content-Type: multipart/mixed; boundary="VmNqvIwPW5XB04HhqASNk2ljKML4Gnv4p"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r316699 - head/sys/net References: <201704111651.v3BGpZi9075424@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201704111651.v3BGpZi9075424@pdx.rh.CN85.dnsmgr.net> --VmNqvIwPW5XB04HhqASNk2ljKML4Gnv4p Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11.04.2017 19:51, Rodney W. Grimes wrote: >> Modified: head/sys/net/if_gre.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/net/if_gre.c Tue Apr 11 08:29:12 2017 (r316698) >> +++ head/sys/net/if_gre.c Tue Apr 11 08:56:18 2017 (r316699) >> @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> =20 >> -#define GREMTU 1500 >> +#define GREMTU 1476 >=20 > I would of thought that this was > #define GREMTU ETHERMTU > and now should probably be: > #define GREMTU ETHERMTU - gre_hlen;=20 > Or what ever the approprite sizeof(foo) is; I just returned back constants that were here :) The man page says: "The MTU of gre interfaces is set to 1476 by default, to match the value used by Cisco routers." > Isn't this arguably wrong in the face of JumboFrames? > I don't see why it may be wrong for jumbo frames. The default MTU value used by any interfaces is ETHERMTU, if you know that your NIC supports jumbo frames, you will configure specific MTU value. If you want 9k MTU on gre(4), you should configure it. >> static const char grename[] =3D "gre"; >> static MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation")= ; >> static VNET_DEFINE(struct mtx, gre_mtx); >> @@ -173,7 +173,7 @@ gre_clone_create(struct if_clone *ifc, i >> GRE2IFP(sc)->if_softc =3D sc; >> if_initname(GRE2IFP(sc), grename, unit); >> =20 >> - GRE2IFP(sc)->if_mtu =3D sc->gre_mtu =3D GREMTU; >> + GRE2IFP(sc)->if_mtu =3D GREMTU; >> GRE2IFP(sc)->if_flags =3D IFF_POINTOPOINT|IFF_MULTICAST; >> GRE2IFP(sc)->if_output =3D gre_output; >> GRE2IFP(sc)->if_ioctl =3D gre_ioctl; >> @@ -231,7 +231,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, >> /* XXX: */ >> if (ifr->ifr_mtu < 576) >=20 > This is another magic constant that should be in a #define. It was here too. I think it is something from the past and can be removed= =2E =46rom RFC791: "It is recommended that hosts only send datagrams larger than 576 octets". >> return (EINVAL); >> - break; >> + ifp->if_mtu =3D ifr->ifr_mtu; >> + return (0); >> case SIOCSIFADDR: >> ifp->if_flags |=3D IFF_UP; >> case SIOCSIFFLAGS: >> @@ -255,12 +256,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, >> } >> error =3D 0; >> switch (cmd) { >> - case SIOCSIFMTU: >> - GRE_WLOCK(sc); >> - sc->gre_mtu =3D ifr->ifr_mtu; >> - gre_updatehdr(sc); >> - GRE_WUNLOCK(sc); >> - goto end; >> case SIOCSIFPHYADDR: >> #ifdef INET6 >> case SIOCSIFPHYADDR_IN6: >> @@ -549,7 +544,6 @@ gre_updatehdr(struct gre_softc *sc) >> } else >> sc->gre_oseq =3D 0; >> gh->gre_flags =3D htons(flags); >> - GRE2IFP(sc)->if_mtu =3D sc->gre_mtu - sc->gre_hlen; >> } >> =20 >> static void >> >> Modified: head/sys/net/if_gre.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/net/if_gre.h Tue Apr 11 08:29:12 2017 (r316698) >> +++ head/sys/net/if_gre.h Tue Apr 11 08:56:18 2017 (r316699) >> @@ -69,7 +69,6 @@ struct gre_softc { >> uint32_t gre_oseq; >> uint32_t gre_key; >> uint32_t gre_options; >> - uint32_t gre_mtu; >> u_int gre_fibnum; >> u_int gre_hlen; /* header size */ >> union { >> >> Modified: head/sys/net/if_me.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/net/if_me.c Tue Apr 11 08:29:12 2017 (r316698) >> +++ head/sys/net/if_me.c Tue Apr 11 08:56:18 2017 (r316699) >> @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> =20 >> -#define MEMTU 1500 >> +#define MEMTU (1500 - sizeof(struct mobhdr)) >=20 > 1500 -> ETHERMTU? Feel free to fix this. Many pseudo interfaces has similar MTU limitations= =2E --=20 WBR, Andrey V. Elsukov --VmNqvIwPW5XB04HhqASNk2ljKML4Gnv4p-- --q7enxoxO3R9ralDvMPPHsDLWwrGP6tsB7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAljtHT4ACgkQAcXqBBDI oXoJ3Qf/YsC3Y5+ViZTmCbjs8iNY1b1S91ECVIbNGPrPNIJwQS55dU/46tPzaUzw 55aVCd7zcb+6c98wEInEd3vR69ExXTReT6dfbaoQOxKOjRfVKtxsYFuuFSj9Nhhi moqVlPEODEkJxHOl/+hdHXMUaI1K39rhClZLEfSgnU95ruw2RcNluYF65YUz49Wp H8r+1bpIuHDj/BHPLcKX/M7aDqYJ1jXO+Oggx8zkJQAmLQzpiaIuL06YPTf9AKoC NphIX5NFDJsI3YeD6oF3addW8TZ3AfNwTkToBJvTmh9muiUpiGwULNO6cTlSvwGd GEMNCUJvcV+5xDQEa9wpNqqvqklgYw== =mJxp -----END PGP SIGNATURE----- --q7enxoxO3R9ralDvMPPHsDLWwrGP6tsB7-- From owner-svn-src-all@freebsd.org Tue Apr 11 18:48:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 546D5D3A8F9; Tue, 11 Apr 2017 18:48:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3DECD1B; Tue, 11 Apr 2017 18:48:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BImIjI086926; Tue, 11 Apr 2017 18:48:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BImHfN086920; Tue, 11 Apr 2017 18:48:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704111848.v3BImHfN086920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 11 Apr 2017 18:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316714 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 18:48:19 -0000 Author: markj Date: Tue Apr 11 18:48:17 2017 New Revision: 316714 URL: https://svnweb.freebsd.org/changeset/base/316714 Log: MFC r306829, r310286, r311695: Lock the ND prefix list and add refcounting for prefixes. Modified: stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet6/in6.c stable/11/sys/netinet6/in6_ifattach.c stable/11/sys/netinet6/nd6.c stable/11/sys/netinet6/nd6.h stable/11/sys/netinet6/nd6_rtr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Tue Apr 11 17:36:19 2017 (r316713) +++ stable/11/sys/netinet/sctp_output.c Tue Apr 11 18:48:17 2017 (r316714) @@ -13775,6 +13775,7 @@ sctp_v6src_match_nexthop(struct sockaddr return (0); /* get prefix entry of address */ + ND6_RLOCK(); LIST_FOREACH(pfx, &MODULE_GLOBAL(nd_prefix), ndpr_entry) { if (pfx->ndpr_stateflags & NDPRF_DETACHED) continue; @@ -13784,6 +13785,7 @@ sctp_v6src_match_nexthop(struct sockaddr } /* no prefix entry in the prefix list */ if (pfx == NULL) { + ND6_RUNLOCK(); SCTPDBG(SCTP_DEBUG_OUTPUT2, "No prefix entry for "); SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, (struct sockaddr *)src6); return (0); @@ -13805,9 +13807,11 @@ sctp_v6src_match_nexthop(struct sockaddr if (sctp_cmpaddr((struct sockaddr *)&gw6, ro->ro_rt->rt_gateway)) { ND6_RUNLOCK(); SCTPDBG(SCTP_DEBUG_OUTPUT2, "pfxrouter is installed\n"); + ND6_RUNLOCK(); return (1); } } + ND6_RUNLOCK(); SCTPDBG(SCTP_DEBUG_OUTPUT2, "pfxrouter is not installed\n"); return (0); } Modified: stable/11/sys/netinet6/in6.c ============================================================================== --- stable/11/sys/netinet6/in6.c Tue Apr 11 17:36:19 2017 (r316713) +++ stable/11/sys/netinet6/in6.c Tue Apr 11 18:48:17 2017 (r316714) @@ -647,6 +647,7 @@ in6_control(struct socket *so, u_long cm } } } + nd6_prefix_rele(pr); /* * this might affect the status of autoconfigured addresses, @@ -694,8 +695,12 @@ aifaddr_out: */ pr = ia->ia6_ndpr; in6_purgeaddr(&ia->ia_ifa); - if (pr && pr->ndpr_addrcnt == 0) - prelist_remove(pr); + if (pr != NULL && pr->ndpr_addrcnt == 0) { + ND6_WLOCK(); + nd6_prefix_unlink(pr, NULL); + ND6_WUNLOCK(); + nd6_prefix_del(pr); + } EVENTHANDLER_INVOKE(ifaddr_event, ifp); break; } Modified: stable/11/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/11/sys/netinet6/in6_ifattach.c Tue Apr 11 17:36:19 2017 (r316713) +++ stable/11/sys/netinet6/in6_ifattach.c Tue Apr 11 18:48:17 2017 (r316714) @@ -453,6 +453,7 @@ in6_ifattach_linklocal(struct ifnet *ifp struct in6_ifaddr *ia; struct in6_aliasreq ifra; struct nd_prefixctl pr0; + struct nd_prefix *pr; int error; /* @@ -535,10 +536,11 @@ in6_ifattach_linklocal(struct ifnet *ifp * address, and then reconfigure another one, the prefix is still * valid with referring to the old link-local address. */ - if (nd6_prefix_lookup(&pr0) == NULL) { + if ((pr = nd6_prefix_lookup(&pr0)) == NULL) { if ((error = nd6_prelist_add(&pr0, NULL, NULL)) != 0) return (error); - } + } else + nd6_prefix_rele(pr); return 0; } @@ -778,15 +780,6 @@ _in6_ifdetach(struct ifnet *ifp, int pur return; /* - * Remove neighbor management table. - * Enabling the nd6_purge will panic on vmove for interfaces on VNET - * teardown as the IPv6 layer is cleaned up already and the locks - * are destroyed. - */ - if (purgeulp) - nd6_purge(ifp); - - /* * nuke any of IPv6 addresses we have * XXX: all addresses should be already removed */ @@ -804,12 +797,10 @@ _in6_ifdetach(struct ifnet *ifp, int pur in6_purgemaddrs(ifp); /* - * remove neighbor management table. we call it twice just to make - * sure we nuke everything. maybe we need just one call. - * XXX: since the first call did not release addresses, some prefixes - * might remain. We should call nd6_purge() again to release the - * prefixes after removing all addresses above. - * (Or can we just delay calling nd6_purge until at this point?) + * Remove neighbor management table. + * Enabling the nd6_purge will panic on vmove for interfaces on VNET + * teardown as the IPv6 layer is cleaned up already and the locks + * are destroyed. */ if (purgeulp) nd6_purge(ifp); Modified: stable/11/sys/netinet6/nd6.c ============================================================================== --- stable/11/sys/netinet6/nd6.c Tue Apr 11 17:36:19 2017 (r316713) +++ stable/11/sys/netinet6/nd6.c Tue Apr 11 18:48:17 2017 (r316714) @@ -38,8 +38,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -47,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -118,6 +119,8 @@ static eventhandler_tag lle_event_eh, if VNET_DEFINE(struct nd_drhead, nd_defrouter); VNET_DEFINE(struct nd_prhead, nd_prefix); VNET_DEFINE(struct rwlock, nd6_lock); +VNET_DEFINE(uint64_t, nd6_list_genid); +VNET_DEFINE(struct mtx, nd6_onlink_mtx); VNET_DEFINE(int, nd6_recalc_reachtm_interval) = ND6_RECALC_REACHTM_INTERVAL; #define V_nd6_recalc_reachtm_interval VNET(nd6_recalc_reachtm_interval) @@ -209,11 +212,10 @@ void nd6_init(void) { - rw_init(&V_nd6_lock, "nd6"); + mtx_init(&V_nd6_onlink_mtx, "nd6 onlink", NULL, MTX_DEF); + rw_init(&V_nd6_lock, "nd6 list"); LIST_INIT(&V_nd_prefix); - - /* initialization of the default router list */ TAILQ_INIT(&V_nd_defrouter); /* Start timers. */ @@ -245,6 +247,7 @@ nd6_destroy() EVENTHANDLER_DEREGISTER(iflladdr_event, iflladdr_event_eh); } rw_destroy(&V_nd6_lock); + mtx_destroy(&V_nd6_onlink_mtx); } #endif @@ -903,13 +906,15 @@ nd6_timer(void *arg) { CURVNET_SET((struct vnet *) arg); struct nd_drhead drq; + struct nd_prhead prl; struct nd_defrouter *dr, *ndr; struct nd_prefix *pr, *npr; struct in6_ifaddr *ia6, *nia6; + uint64_t genid; TAILQ_INIT(&drq); + LIST_INIT(&prl); - /* expire default router list */ ND6_WLOCK(); TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) if (dr->expire && dr->expire < time_uptime) @@ -1016,22 +1021,46 @@ nd6_timer(void *arg) } } - /* expire prefix list */ + ND6_WLOCK(); +restart: LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, npr) { /* - * check prefix lifetime. - * since pltime is just for autoconf, pltime processing for - * prefix is not necessary. + * Expire prefixes. Since the pltime is only used for + * autoconfigured addresses, pltime processing for prefixes is + * not necessary. + * + * Only unlink after all derived addresses have expired. This + * may not occur until two hours after the prefix has expired + * per RFC 4862. If the prefix expires before its derived + * addresses, mark it off-link. This will be done automatically + * after unlinking if no address references remain. */ - if (pr->ndpr_vltime != ND6_INFINITE_LIFETIME && - time_uptime - pr->ndpr_lastupdate > pr->ndpr_vltime) { + if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME || + time_uptime - pr->ndpr_lastupdate <= pr->ndpr_vltime) + continue; - /* - * address expiration and prefix expiration are - * separate. NEVER perform in6_purgeaddr here. - */ - prelist_remove(pr); + if (pr->ndpr_addrcnt == 0) { + nd6_prefix_unlink(pr, &prl); + continue; } + if ((pr->ndpr_stateflags & NDPRF_ONLINK) != 0) { + genid = V_nd6_list_genid; + nd6_prefix_ref(pr); + ND6_WUNLOCK(); + ND6_ONLINK_LOCK(); + (void)nd6_prefix_offlink(pr); + ND6_ONLINK_UNLOCK(); + ND6_WLOCK(); + nd6_prefix_rele(pr); + if (genid != V_nd6_list_genid) + goto restart; + } + } + ND6_WUNLOCK(); + + while ((pr = LIST_FIRST(&prl)) != NULL) { + LIST_REMOVE(pr, ndpr_entry); + nd6_prefix_del(pr); } callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, @@ -1118,10 +1147,12 @@ void nd6_purge(struct ifnet *ifp) { struct nd_drhead drq; + struct nd_prhead prl; struct nd_defrouter *dr, *ndr; struct nd_prefix *pr, *npr; TAILQ_INIT(&drq); + LIST_INIT(&prl); /* * Nuke default router list entries toward ifp. @@ -1136,33 +1167,31 @@ nd6_purge(struct ifnet *ifp) if (dr->ifp == ifp) defrouter_unlink(dr, &drq); } - TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { if (!dr->installed) continue; if (dr->ifp == ifp) defrouter_unlink(dr, &drq); } + + /* + * Remove prefixes on ifp. We should have already removed addresses on + * this interface, so no addresses should be referencing these prefixes. + */ + LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, npr) { + if (pr->ndpr_ifp == ifp) + nd6_prefix_unlink(pr, &prl); + } ND6_WUNLOCK(); + /* Delete the unlinked router and prefix objects. */ while ((dr = TAILQ_FIRST(&drq)) != NULL) { TAILQ_REMOVE(&drq, dr, dr_entry); defrouter_del(dr); } - - /* Nuke prefix list entries toward ifp */ - LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, npr) { - if (pr->ndpr_ifp == ifp) { - /* - * Because if_detach() does *not* release prefixes - * while purging addresses the reference count will - * still be above zero. We therefore reset it to - * make sure that the prefix really gets purged. - */ - pr->ndpr_addrcnt = 0; - - prelist_remove(pr); - } + while ((pr = LIST_FIRST(&prl)) != NULL) { + LIST_REMOVE(pr, ndpr_entry); + nd6_prefix_del(pr); } /* cancel default outgoing interface setting */ @@ -1228,7 +1257,8 @@ nd6_is_new_addr_neighbor(const struct so struct rt_addrinfo info; struct sockaddr_in6 rt_key; const struct sockaddr *dst6; - int fibnum; + uint64_t genid; + int error, fibnum; /* * A link-local address is always a neighbor. @@ -1266,19 +1296,29 @@ nd6_is_new_addr_neighbor(const struct so * If the address matches one of our on-link prefixes, it should be a * neighbor. */ + ND6_RLOCK(); +restart: LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { if (pr->ndpr_ifp != ifp) continue; - if (!(pr->ndpr_stateflags & NDPRF_ONLINK)) { - + if ((pr->ndpr_stateflags & NDPRF_ONLINK) == 0) { /* Always use the default FIB here. */ dst6 = (const struct sockaddr *)&pr->ndpr_prefix; + genid = V_nd6_list_genid; + ND6_RUNLOCK(); + /* Restore length field before retrying lookup */ rt_key.sin6_len = sizeof(rt_key); - if (rib_lookup_info(fibnum, dst6, 0, 0, &info) != 0) + error = rib_lookup_info(fibnum, dst6, 0, 0, &info); + + ND6_RLOCK(); + if (genid != V_nd6_list_genid) + goto restart; + if (error != 0) continue; + /* * This is the case where multiple interfaces * have the same prefix, but only one is installed @@ -1290,14 +1330,17 @@ nd6_is_new_addr_neighbor(const struct so * differ. */ if (!IN6_ARE_ADDR_EQUAL(&pr->ndpr_prefix.sin6_addr, - &rt_key.sin6_addr)) + &rt_key.sin6_addr)) continue; } if (IN6_ARE_MASKED_ADDR_EQUAL(&pr->ndpr_prefix.sin6_addr, - &addr->sin6_addr, &pr->ndpr_mask)) + &addr->sin6_addr, &pr->ndpr_mask)) { + ND6_RUNLOCK(); return (1); + } } + ND6_RUNLOCK(); /* * If the address is assigned on the node of the other side of @@ -1728,15 +1771,22 @@ nd6_ioctl(u_long cmd, caddr_t data, stru case SIOCSPFXFLUSH_IN6: { /* flush all the prefix advertised by routers */ + struct in6_ifaddr *ia, *ia_next; struct nd_prefix *pr, *next; + struct nd_prhead prl; - LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, next) { - struct in6_ifaddr *ia, *ia_next; + LIST_INIT(&prl); + ND6_WLOCK(); + LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, next) { if (IN6_IS_ADDR_LINKLOCAL(&pr->ndpr_prefix.sin6_addr)) continue; /* XXX */ + nd6_prefix_unlink(pr, &prl); + } + ND6_WUNLOCK(); - /* do we really have to remove addresses as well? */ + while ((pr = LIST_FIRST(&prl)) != NULL) { + LIST_REMOVE(pr, ndpr_entry); /* XXXRW: in6_ifaddrhead locking. */ TAILQ_FOREACH_SAFE(ia, &V_in6_ifaddrhead, ia_link, ia_next) { @@ -1746,7 +1796,7 @@ nd6_ioctl(u_long cmd, caddr_t data, stru if (ia->ia6_ndpr == pr) in6_purgeaddr(&ia->ia_ifa); } - prelist_remove(pr); + nd6_prefix_del(pr); } break; } @@ -2690,9 +2740,10 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) ip6_sprintf(ip6buf, &pfr->router->rtaddr)); error = SYSCTL_OUT(req, &s6, sizeof(s6)); if (error != 0) - break; + goto out; } } +out: ND6_RUNLOCK(); return (error); } Modified: stable/11/sys/netinet6/nd6.h ============================================================================== --- stable/11/sys/netinet6/nd6.h Tue Apr 11 17:36:19 2017 (r316713) +++ stable/11/sys/netinet6/nd6.h Tue Apr 11 18:48:17 2017 (r316714) @@ -256,7 +256,7 @@ struct nd_prefixctl { struct prf_ra ndpr_flags; }; - +LIST_HEAD(nd_prhead, nd_prefix); struct nd_prefix { struct ifnet *ndpr_ifp; LIST_ENTRY(nd_prefix) ndpr_entry; @@ -276,6 +276,7 @@ struct nd_prefix { LIST_HEAD(pr_rtrhead, nd_pfxrouter) ndpr_advrtrs; u_char ndpr_plen; int ndpr_addrcnt; /* count of derived addresses */ + volatile u_int ndpr_refcnt; }; #define ndpr_raf ndpr_flags @@ -314,8 +315,6 @@ struct nd_pfxrouter { struct nd_defrouter *router; }; -LIST_HEAD(nd_prhead, nd_prefix); - #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_IP6NDP); #endif @@ -346,17 +345,30 @@ VNET_DECLARE(int, nd6_onlink_ns_rfc4861) /* Lock for the prefix and default router lists. */ VNET_DECLARE(struct rwlock, nd6_lock); +VNET_DECLARE(uint64_t, nd6_list_genid); #define V_nd6_lock VNET(nd6_lock) +#define V_nd6_list_genid VNET(nd6_list_genid) #define ND6_RLOCK() rw_rlock(&V_nd6_lock) #define ND6_RUNLOCK() rw_runlock(&V_nd6_lock) #define ND6_WLOCK() rw_wlock(&V_nd6_lock) #define ND6_WUNLOCK() rw_wunlock(&V_nd6_lock) +#define ND6_TRY_UPGRADE() rw_try_upgrade(&V_nd6_lock) #define ND6_WLOCK_ASSERT() rw_assert(&V_nd6_lock, RA_WLOCKED) #define ND6_RLOCK_ASSERT() rw_assert(&V_nd6_lock, RA_RLOCKED) #define ND6_LOCK_ASSERT() rw_assert(&V_nd6_lock, RA_LOCKED) #define ND6_UNLOCK_ASSERT() rw_assert(&V_nd6_lock, RA_UNLOCKED) +/* Mutex for prefix onlink/offlink transitions. */ +VNET_DECLARE(struct mtx, nd6_onlink_mtx); +#define V_nd6_onlink_mtx VNET(nd6_onlink_mtx) + +#define ND6_ONLINK_LOCK() mtx_lock(&V_nd6_onlink_mtx) +#define ND6_ONLINK_TRYLOCK() mtx_trylock(&V_nd6_onlink_mtx) +#define ND6_ONLINK_UNLOCK() mtx_unlock(&V_nd6_onlink_mtx) +#define ND6_ONLINK_LOCK_ASSERT() mtx_assert(&V_nd6_onlink_mtx, MA_OWNED) +#define ND6_ONLINK_UNLOCK_ASSERT() mtx_assert(&V_nd6_onlink_mtx, MA_NOTOWNED) + #define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0) /* nd6_rtr.c */ @@ -463,9 +475,14 @@ void defrouter_rele(struct nd_defrouter bool defrouter_remove(struct in6_addr *, struct ifnet *); void defrouter_unlink(struct nd_defrouter *, struct nd_drhead *); void defrouter_del(struct nd_defrouter *); -void prelist_remove(struct nd_prefix *); int nd6_prelist_add(struct nd_prefixctl *, struct nd_defrouter *, - struct nd_prefix **); + struct nd_prefix **); +void nd6_prefix_unlink(struct nd_prefix *, struct nd_prhead *); +void nd6_prefix_del(struct nd_prefix *); +void nd6_prefix_ref(struct nd_prefix *); +void nd6_prefix_rele(struct nd_prefix *); +int nd6_prefix_onlink(struct nd_prefix *); +int nd6_prefix_offlink(struct nd_prefix *); void pfxlist_onlink_check(void); struct nd_defrouter *defrouter_lookup(struct in6_addr *, struct ifnet *); struct nd_defrouter *defrouter_lookup_locked(struct in6_addr *, struct ifnet *); Modified: stable/11/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/11/sys/netinet6/nd6_rtr.c Tue Apr 11 17:36:19 2017 (r316713) +++ stable/11/sys/netinet6/nd6_rtr.c Tue Apr 11 18:48:17 2017 (r316714) @@ -87,9 +87,6 @@ static int in6_init_prefix_ltimes(struct static void in6_init_address_ltimes(struct nd_prefix *, struct in6_addrlifetime *); -static int nd6_prefix_onlink(struct nd_prefix *); -static int nd6_prefix_offlink(struct nd_prefix *); - static int rt6_deleteroute(const struct rtentry *, void *); VNET_DECLARE(int, nd6_recalc_reachtm_interval); @@ -661,6 +658,7 @@ defrouter_unlink(struct nd_defrouter *dr ND6_WLOCK_ASSERT(); TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); + V_nd6_list_genid++; if (drq != NULL) TAILQ_INSERT_TAIL(drq, dr, dr_entry); } @@ -670,6 +668,7 @@ defrouter_del(struct nd_defrouter *dr) { struct nd_defrouter *deldr = NULL; struct nd_prefix *pr; + struct nd_pfxrouter *pfxrtr; ND6_UNLOCK_ASSERT(); @@ -688,11 +687,13 @@ defrouter_del(struct nd_defrouter *dr) /* * Also delete all the pointers to the router in each prefix lists. */ + ND6_WLOCK(); LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { - struct nd_pfxrouter *pfxrtr; if ((pfxrtr = pfxrtr_lookup(pr, dr)) != NULL) pfxrtr_del(pfxrtr); } + ND6_WUNLOCK(); + pfxlist_onlink_check(); /* @@ -852,14 +853,18 @@ static struct nd_defrouter * defrtrlist_update(struct nd_defrouter *new) { struct nd_defrouter *dr, *n; + uint64_t genid; int oldpref; + bool writelocked; if (new->rtlifetime == 0) { defrouter_remove(&new->rtaddr, new->ifp); return (NULL); } - ND6_WLOCK(); + ND6_RLOCK(); + writelocked = false; +restart: dr = defrouter_lookup_locked(&new->rtaddr, new->ifp); if (dr != NULL) { oldpref = rtpref(dr); @@ -875,10 +880,32 @@ defrtrlist_update(struct nd_defrouter *n * router is still installed in the kernel. */ if (dr->installed && rtpref(new) == oldpref) { - ND6_WUNLOCK(); + if (writelocked) + ND6_WUNLOCK(); + else + ND6_RUNLOCK(); return (dr); } + } + /* + * The router needs to be reinserted into the default router + * list, so upgrade to a write lock. If that fails and the list + * has potentially changed while the lock was dropped, we'll + * redo the lookup with the write lock held. + */ + if (!writelocked) { + writelocked = true; + if (!ND6_TRY_UPGRADE()) { + genid = V_nd6_list_genid; + ND6_RUNLOCK(); + ND6_WLOCK(); + if (genid != V_nd6_list_genid) + goto restart; + } + } + + if (dr != NULL) { /* * The preferred router may have changed, so relocate this * router. @@ -912,6 +939,7 @@ defrtrlist_update(struct nd_defrouter *n TAILQ_INSERT_BEFORE(dr, n, dr_entry); else TAILQ_INSERT_TAIL(&V_nd_defrouter, n, dr_entry); + V_nd6_list_genid++; ND6_WUNLOCK(); defrouter_select(); @@ -924,11 +952,12 @@ pfxrtr_lookup(struct nd_prefix *pr, stru { struct nd_pfxrouter *search; + ND6_LOCK_ASSERT(); + LIST_FOREACH(search, &pr->ndpr_advrtrs, pfr_entry) { if (search->router == dr) break; } - return (search); } @@ -936,55 +965,110 @@ static void pfxrtr_add(struct nd_prefix *pr, struct nd_defrouter *dr) { struct nd_pfxrouter *new; + bool update; + + ND6_UNLOCK_ASSERT(); + + ND6_RLOCK(); + if (pfxrtr_lookup(pr, dr) != NULL) { + ND6_RUNLOCK(); + return; + } + ND6_RUNLOCK(); new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO); if (new == NULL) return; - new->router = dr; defrouter_ref(dr); + new->router = dr; - LIST_INSERT_HEAD(&pr->ndpr_advrtrs, new, pfr_entry); + ND6_WLOCK(); + if (pfxrtr_lookup(pr, dr) == NULL) { + LIST_INSERT_HEAD(&pr->ndpr_advrtrs, new, pfr_entry); + update = true; + } else { + /* We lost a race to add the reference. */ + defrouter_rele(dr); + free(new, M_IP6NDP); + update = false; + } + ND6_WUNLOCK(); - pfxlist_onlink_check(); + if (update) + pfxlist_onlink_check(); } static void pfxrtr_del(struct nd_pfxrouter *pfr) { + ND6_WLOCK_ASSERT(); + LIST_REMOVE(pfr, pfr_entry); defrouter_rele(pfr->router); free(pfr, M_IP6NDP); } -struct nd_prefix * -nd6_prefix_lookup(struct nd_prefixctl *key) +static struct nd_prefix * +nd6_prefix_lookup_locked(struct nd_prefixctl *key) { struct nd_prefix *search; + ND6_LOCK_ASSERT(); + LIST_FOREACH(search, &V_nd_prefix, ndpr_entry) { if (key->ndpr_ifp == search->ndpr_ifp && key->ndpr_plen == search->ndpr_plen && in6_are_prefix_equal(&key->ndpr_prefix.sin6_addr, &search->ndpr_prefix.sin6_addr, key->ndpr_plen)) { + nd6_prefix_ref(search); break; } } + return (search); +} +struct nd_prefix * +nd6_prefix_lookup(struct nd_prefixctl *key) +{ + struct nd_prefix *search; + + ND6_RLOCK(); + search = nd6_prefix_lookup_locked(key); + ND6_RUNLOCK(); return (search); } +void +nd6_prefix_ref(struct nd_prefix *pr) +{ + + refcount_acquire(&pr->ndpr_refcnt); +} + +void +nd6_prefix_rele(struct nd_prefix *pr) +{ + + if (refcount_release(&pr->ndpr_refcnt)) { + KASSERT(LIST_EMPTY(&pr->ndpr_advrtrs), + ("prefix %p has advertising routers", pr)); + free(pr, M_IP6NDP); + } +} + int nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr, struct nd_prefix **newp) { - struct nd_prefix *new = NULL; - int error = 0; + struct nd_prefix *new; char ip6buf[INET6_ADDRSTRLEN]; + int error; new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO); if (new == NULL) return (ENOMEM); + refcount_init(&new->ndpr_refcnt, newp != NULL ? 2 : 1); new->ndpr_ifp = pr->ndpr_ifp; new->ndpr_prefix = pr->ndpr_prefix; new->ndpr_plen = pr->ndpr_plen; @@ -1003,20 +1087,22 @@ nd6_prelist_add(struct nd_prefixctl *pr, /* make prefix in the canonical form */ IN6_MASK_ADDR(&new->ndpr_prefix.sin6_addr, &new->ndpr_mask); - /* link ndpr_entry to nd_prefix list */ + ND6_WLOCK(); LIST_INSERT_HEAD(&V_nd_prefix, new, ndpr_entry); + V_nd6_list_genid++; + ND6_WUNLOCK(); /* ND_OPT_PI_FLAG_ONLINK processing */ if (new->ndpr_raf_onlink) { - int e; - - if ((e = nd6_prefix_onlink(new)) != 0) { + ND6_ONLINK_LOCK(); + if ((error = nd6_prefix_onlink(new)) != 0) { nd6log((LOG_ERR, "nd6_prelist_add: failed to make " "the prefix %s/%d on-link on %s (errno=%d)\n", ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), - pr->ndpr_plen, if_name(pr->ndpr_ifp), e)); + pr->ndpr_plen, if_name(pr->ndpr_ifp), error)); /* proceed anyway. XXX: is it correct? */ } + ND6_ONLINK_UNLOCK(); } if (dr != NULL) @@ -1026,51 +1112,67 @@ nd6_prelist_add(struct nd_prefixctl *pr, return (0); } +/* + * Remove a prefix from the prefix list and optionally stash it in a + * caller-provided list. + * + * The ND6 lock must be held. + */ void -prelist_remove(struct nd_prefix *pr) +nd6_prefix_unlink(struct nd_prefix *pr, struct nd_prhead *list) +{ + + ND6_WLOCK_ASSERT(); + + LIST_REMOVE(pr, ndpr_entry); + V_nd6_list_genid++; + if (list != NULL) + LIST_INSERT_HEAD(list, pr, ndpr_entry); +} + +/* + * Free an unlinked prefix, first marking it off-link if necessary. + */ +void +nd6_prefix_del(struct nd_prefix *pr) { struct nd_pfxrouter *pfr, *next; int e; char ip6buf[INET6_ADDRSTRLEN]; - /* make sure to invalidate the prefix until it is really freed. */ - pr->ndpr_vltime = 0; - pr->ndpr_pltime = 0; + KASSERT(pr->ndpr_addrcnt == 0, + ("prefix %p has referencing addresses", pr)); + ND6_UNLOCK_ASSERT(); /* * Though these flags are now meaningless, we'd rather keep the value * of pr->ndpr_raf_onlink and pr->ndpr_raf_auto not to confuse users * when executing "ndp -p". */ - - if ((pr->ndpr_stateflags & NDPRF_ONLINK) != 0 && - (e = nd6_prefix_offlink(pr)) != 0) { - nd6log((LOG_ERR, "prelist_remove: failed to make %s/%d offlink " - "on %s, errno=%d\n", - ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), - pr->ndpr_plen, if_name(pr->ndpr_ifp), e)); - /* what should we do? */ + if ((pr->ndpr_stateflags & NDPRF_ONLINK) != 0) { + ND6_ONLINK_LOCK(); + if ((e = nd6_prefix_offlink(pr)) != 0) { + nd6log((LOG_ERR, + "nd6_prefix_del: failed to make %s/%d offlink " + "on %s, errno=%d\n", + ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), + pr->ndpr_plen, if_name(pr->ndpr_ifp), e)); + /* what should we do? */ + } + ND6_ONLINK_UNLOCK(); } - if (pr->ndpr_addrcnt > 0) - return; /* notice here? */ - - /* unlink ndpr_entry from nd_prefix list */ - LIST_REMOVE(pr, ndpr_entry); - - /* free list of routers that advertised the prefix */ - LIST_FOREACH_SAFE(pfr, &pr->ndpr_advrtrs, pfr_entry, next) { + /* Release references to routers that have advertised this prefix. */ + ND6_WLOCK(); + LIST_FOREACH_SAFE(pfr, &pr->ndpr_advrtrs, pfr_entry, next) pfxrtr_del(pfr); - } - free(pr, M_IP6NDP); + ND6_WUNLOCK(); + + nd6_prefix_rele(pr); pfxlist_onlink_check(); } -/* - * dr - may be NULL - */ - static int prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, struct mbuf *m, int mcast) @@ -1120,21 +1222,22 @@ prelist_update(struct nd_prefixctl *new, if (new->ndpr_raf_onlink && (pr->ndpr_stateflags & NDPRF_ONLINK) == 0) { - int e; - - if ((e = nd6_prefix_onlink(pr)) != 0) { + ND6_ONLINK_LOCK(); + if ((error = nd6_prefix_onlink(pr)) != 0) { nd6log((LOG_ERR, "prelist_update: failed to make " "the prefix %s/%d on-link on %s " "(errno=%d)\n", ip6_sprintf(ip6buf, - &pr->ndpr_prefix.sin6_addr), - pr->ndpr_plen, if_name(pr->ndpr_ifp), e)); + &pr->ndpr_prefix.sin6_addr), + pr->ndpr_plen, if_name(pr->ndpr_ifp), + error)); /* proceed anyway. XXX: is it correct? */ } + ND6_ONLINK_UNLOCK(); } - if (dr && pfxrtr_lookup(pr, dr) == NULL) + if (dr != NULL) pfxrtr_add(pr, dr); } else { if (new->ndpr_vltime == 0) @@ -1393,8 +1496,10 @@ prelist_update(struct nd_prefixctl *new, } } - end: - return error; +end: + if (pr != NULL) + nd6_prefix_rele(pr); + return (error); } /* @@ -1409,6 +1514,8 @@ find_pfxlist_reachable_router(struct nd_ struct llentry *ln; int canreach; + ND6_LOCK_ASSERT(); + LIST_FOREACH(pfxrtr, &pr->ndpr_advrtrs, pfr_entry) { IF_AFDATA_RLOCK(pfxrtr->router->ifp); ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, pfxrtr->router->ifp); @@ -1444,6 +1551,11 @@ pfxlist_onlink_check(void) struct nd_defrouter *dr; struct nd_pfxrouter *pfxrtr = NULL; struct rm_priotracker in6_ifa_tracker; + uint64_t genid; + uint32_t flags; + + ND6_ONLINK_LOCK(); + ND6_RLOCK(); /* * Check if there is a prefix that has a reachable advertising @@ -1459,7 +1571,6 @@ pfxlist_onlink_check(void) * that does not advertise any prefixes. */ if (pr == NULL) { - ND6_RLOCK(); TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { struct nd_prefix *pr0; @@ -1470,7 +1581,6 @@ pfxlist_onlink_check(void) if (pfxrtr != NULL) break; } - ND6_RUNLOCK(); } if (pr != NULL || (!TAILQ_EMPTY(&V_nd_defrouter) && pfxrtr == NULL)) { /* @@ -1515,6 +1625,7 @@ pfxlist_onlink_check(void) * interfaces. Such cases will be handled in nd6_prefix_onlink, * so we don't have to care about them. */ +restart: LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { char ip6buf[INET6_ADDRSTRLEN]; int e; @@ -1524,21 +1635,20 @@ pfxlist_onlink_check(void) pr->ndpr_raf_auto == 0) continue; - if ((pr->ndpr_stateflags & NDPRF_DETACHED) != 0 && - (pr->ndpr_stateflags & NDPRF_ONLINK) != 0) { - if ((e = nd6_prefix_offlink(pr)) != 0) { + flags = pr->ndpr_stateflags & (NDPRF_DETACHED | NDPRF_ONLINK); + if (flags == 0 || flags == (NDPRF_DETACHED | NDPRF_ONLINK)) { + genid = V_nd6_list_genid; + ND6_RUNLOCK(); + if ((flags & NDPRF_ONLINK) != 0 && + (e = nd6_prefix_offlink(pr)) != 0) { nd6log((LOG_ERR, "pfxlist_onlink_check: failed to " "make %s/%d offlink, errno=%d\n", ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, e)); - } - } - if ((pr->ndpr_stateflags & NDPRF_DETACHED) == 0 && - (pr->ndpr_stateflags & NDPRF_ONLINK) == 0 && - pr->ndpr_raf_onlink) { - if ((e = nd6_prefix_onlink(pr)) != 0) { + } else if ((flags & NDPRF_ONLINK) == 0 && + (e = nd6_prefix_onlink(pr)) != 0) { nd6log((LOG_ERR, "pfxlist_onlink_check: failed to " "make %s/%d onlink, errno=%d\n", @@ -1546,6 +1656,9 @@ pfxlist_onlink_check(void) &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, e)); } + ND6_RLOCK(); + if (genid != V_nd6_list_genid) + goto restart; } } @@ -1606,6 +1719,8 @@ pfxlist_onlink_check(void) } } IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); + ND6_RUNLOCK(); + ND6_ONLINK_UNLOCK(); } static int @@ -1686,23 +1801,20 @@ nd6_prefix_onlink_rtrequest(struct nd_pr return (a_failure); } -static int +int nd6_prefix_onlink(struct nd_prefix *pr) { struct ifaddr *ifa; struct ifnet *ifp = pr->ndpr_ifp; struct nd_prefix *opr; - int error = 0; char ip6buf[INET6_ADDRSTRLEN]; + int error; - /* sanity check */ - if ((pr->ndpr_stateflags & NDPRF_ONLINK) != 0) { - nd6log((LOG_ERR, - "nd6_prefix_onlink: %s/%d is already on-link\n", - ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 11 18:49:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27A3CD3A9FA; Tue, 11 Apr 2017 18:49:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12B931039; Tue, 11 Apr 2017 18:49:58 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3BInv62075893; Tue, 11 Apr 2017 11:49:57 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3BInuuB075892; Tue, 11 Apr 2017 11:49:56 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316699 - head/sys/net In-Reply-To: To: "Andrey V. Elsukov" Date: Tue, 11 Apr 2017 11:49:56 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 18:49:59 -0000 [ Charset UTF-8 unsupported, converting... ] > On 11.04.2017 19:51, Rodney W. Grimes wrote: > >> Modified: head/sys/net/if_gre.c > >> ============================================================================== > >> --- head/sys/net/if_gre.c Tue Apr 11 08:29:12 2017 (r316698) > >> +++ head/sys/net/if_gre.c Tue Apr 11 08:56:18 2017 (r316699) > >> @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); > >> #include > >> #include > >> > >> -#define GREMTU 1500 > >> +#define GREMTU 1476 > > > > I would of thought that this was > > #define GREMTU ETHERMTU > > and now should probably be: > > #define GREMTU ETHERMTU - gre_hlen; > > Or what ever the approprite sizeof(foo) is; > > I just returned back constants that were here :) Can we try to improve on this, or maybe just ignore it? > The man page says: > "The MTU of gre interfaces is set to 1476 by default, to match the > value used by Cisco routers." That might need some clean up too? > > Isn't this arguably wrong in the face of JumboFrames? > > > > I don't see why it may be wrong for jumbo frames. The default MTU value > used by any interfaces is ETHERMTU, if you know that your NIC supports > jumbo frames, you will configure specific MTU value. > If you want 9k MTU on gre(4), you should configure it. I may some day want to #define ETHERMTU 9000 and just have all the right magic happen, wouldnt that be nice? > >> static const char grename[] = "gre"; > >> static MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation"); > >> static VNET_DEFINE(struct mtx, gre_mtx); > >> @@ -173,7 +173,7 @@ gre_clone_create(struct if_clone *ifc, i > >> GRE2IFP(sc)->if_softc = sc; > >> if_initname(GRE2IFP(sc), grename, unit); > >> > >> - GRE2IFP(sc)->if_mtu = sc->gre_mtu = GREMTU; > >> + GRE2IFP(sc)->if_mtu = GREMTU; > >> GRE2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST; > >> GRE2IFP(sc)->if_output = gre_output; > >> GRE2IFP(sc)->if_ioctl = gre_ioctl; > >> @@ -231,7 +231,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, > >> /* XXX: */ > >> if (ifr->ifr_mtu < 576) > > > > This is another magic constant that should be in a #define. > > It was here too. I think it is something from the past and can be removed. > > From RFC791: "It is recommended that hosts only send datagrams larger > than 576 octets". No, I doubt we want to remove that, it is also part of ipv6 documentation, and iirc part of some BCP's. You really dont want to be running on the internet with MTU < 576. It use to be 296 in the days when we had SLIP. > > >> return (EINVAL); > >> - break; > >> + ifp->if_mtu = ifr->ifr_mtu; > >> + return (0); > >> case SIOCSIFADDR: > >> ifp->if_flags |= IFF_UP; > >> case SIOCSIFFLAGS: > >> @@ -255,12 +256,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, > >> } > >> error = 0; > >> switch (cmd) { > >> - case SIOCSIFMTU: > >> - GRE_WLOCK(sc); > >> - sc->gre_mtu = ifr->ifr_mtu; > >> - gre_updatehdr(sc); > >> - GRE_WUNLOCK(sc); > >> - goto end; > >> case SIOCSIFPHYADDR: > >> #ifdef INET6 > >> case SIOCSIFPHYADDR_IN6: > >> @@ -549,7 +544,6 @@ gre_updatehdr(struct gre_softc *sc) > >> } else > >> sc->gre_oseq = 0; > >> gh->gre_flags = htons(flags); > >> - GRE2IFP(sc)->if_mtu = sc->gre_mtu - sc->gre_hlen; > >> } > >> > >> static void > >> > >> Modified: head/sys/net/if_gre.h > >> ============================================================================== > >> --- head/sys/net/if_gre.h Tue Apr 11 08:29:12 2017 (r316698) > >> +++ head/sys/net/if_gre.h Tue Apr 11 08:56:18 2017 (r316699) > >> @@ -69,7 +69,6 @@ struct gre_softc { > >> uint32_t gre_oseq; > >> uint32_t gre_key; > >> uint32_t gre_options; > >> - uint32_t gre_mtu; > >> u_int gre_fibnum; > >> u_int gre_hlen; /* header size */ > >> union { > >> > >> Modified: head/sys/net/if_me.c > >> ============================================================================== > >> --- head/sys/net/if_me.c Tue Apr 11 08:29:12 2017 (r316698) > >> +++ head/sys/net/if_me.c Tue Apr 11 08:56:18 2017 (r316699) > >> @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); > >> #include > >> #include > >> > >> -#define MEMTU 1500 > >> +#define MEMTU (1500 - sizeof(struct mobhdr)) > > > > 1500 -> ETHERMTU? > > Feel free to fix this. Many pseudo interfaces has similar MTU limitations. > > -- > WBR, Andrey V. Elsukov > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Apr 11 19:00:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A68DD3AE4F; Tue, 11 Apr 2017 19:00:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23A3519FD; Tue, 11 Apr 2017 19:00:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 2B76510A7DB; Tue, 11 Apr 2017 15:00:40 -0400 (EDT) From: John Baldwin To: Patrick Kelsey Cc: Jung-uk Kim , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r316648 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/include cddl/dev/dtrace/aarch64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/arm cddl/dev/dtrace/i386 cddl/dev/dtrace... Date: Tue, 11 Apr 2017 11:51:33 -0700 Message-ID: <3414873.bffRg8lynz@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201704090200.v39203Vf072867@repo.freebsd.org> <2086739.zQDsh9Zz6K@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 11 Apr 2017 15:00:40 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 19:00:41 -0000 On Tuesday, April 11, 2017 02:21:05 AM Patrick Kelsey wrote: > On Tue, Apr 11, 2017 at 1:24 AM, John Baldwin wrote: > > > Either that, or I relax the goal of purging it entirely and put the > > compat > > > shim in current also to sidestep the port-patching issue. > > > > Well, I'd like to not have it live around forever, but we could add the > > compat shim to HEAD in the short term (also makes MFC slightly simpler as > > you just group the two commits together when you MFC). Once the port is > > patched with the updated FreeBSD_version we can remove the shim from HEAD. > > > > > So far it doesn't look like patching ports will be much of an issue. I > extracted sources for all ports that contained INSTALL_KLD in their > Makefile and grepped them for smp_no_rendevous - the only ports turned up > that way are emulators/virtualbox-ose-additions and > emulators/virtualbox-ose-kmod. One set of patches will serve both, and > I've sent them off to the maintainers. Yes, I can't think of any other ports that would use these. Thanks! -- John Baldwin From owner-svn-src-all@freebsd.org Tue Apr 11 19:03:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38F27D3A01A; Tue, 11 Apr 2017 19:03:38 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5p.cmail.yandex.net (forward5p.cmail.yandex.net [IPv6:2a02:6b8:0:1465::15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD60C1EE2; Tue, 11 Apr 2017 19:03:37 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [77.88.29.85]) by forward5p.cmail.yandex.net (Yandex) with ESMTP id 7919720EAB; Tue, 11 Apr 2017 22:03:34 +0300 (MSK) Received: from smtp2p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2p.mail.yandex.net (Yandex) with ESMTP id BCA301A80060; Tue, 11 Apr 2017 22:03:32 +0300 (MSK) Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Fqf15KSlEL-3VJuc0Z2; Tue, 11 Apr 2017 22:03:31 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1491937411; bh=CaWKc1Bv8rgwrOmZ5g+94RKwe8KX3YSLPiQYAjWs7Dg=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=eSYr8KpaqsZumaaen+GR2a4QGUr8DjsiVSerHqDunKLA0lsFalBRXVV6rKXgThSIT QLRKyKKfUh6O47x3A36cmy0fcZWSy4NC4Hkf5p2okYzqAPUc7LGaNBWt+CVPowvY5i SrTKnFgab93QblZhlpolKXgSPcMgMYhDwGtS2RjY= Authentication-Results: smtp2p.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: svn commit: r316699 - head/sys/net To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: <7b4a8622-d7cc-a597-846e-0bdf5519a5d7@yandex.ru> Date: Tue, 11 Apr 2017 22:02:23 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BtcLklFV8pe6eumSxBQguHsfFS5qDn0Tg" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 19:03:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BtcLklFV8pe6eumSxBQguHsfFS5qDn0Tg Content-Type: multipart/mixed; boundary="FrwCIHriBBhRQ12cpNfdJBv4Esigd5Qx9"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <7b4a8622-d7cc-a597-846e-0bdf5519a5d7@yandex.ru> Subject: Re: svn commit: r316699 - head/sys/net References: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> --FrwCIHriBBhRQ12cpNfdJBv4Esigd5Qx9 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11.04.2017 21:49, Rodney W. Grimes wrote: >>>> -#define GREMTU 1500 >>>> +#define GREMTU 1476 >>> >>> I would of thought that this was >>> #define GREMTU ETHERMTU >>> and now should probably be: >>> #define GREMTU ETHERMTU - gre_hlen;=20 >>> Or what ever the approprite sizeof(foo) is; >> >> I just returned back constants that were here :) >=20 > Can we try to improve on this, or maybe just ignore it? There are a lot of things that we need and can improve, but usually we choose the most interested or important. >=20 >> The man page says: >> "The MTU of gre interfaces is set to 1476 by default, to match the >> value used by Cisco routers." >=20 > That might need some clean up too? >=20 >>> Isn't this arguably wrong in the face of JumboFrames? >>> >> >> I don't see why it may be wrong for jumbo frames. The default MTU valu= e >> used by any interfaces is ETHERMTU, if you know that your NIC supports= >> jumbo frames, you will configure specific MTU value. >> If you want 9k MTU on gre(4), you should configure it. >=20 > I may some day want to #define ETHERMTU 9000 and just have all the righ= t > magic happen, wouldnt that be nice? It would be nice. >>>> static const char grename[] =3D "gre"; >>>> static MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation= "); >>>> static VNET_DEFINE(struct mtx, gre_mtx); >>>> @@ -173,7 +173,7 @@ gre_clone_create(struct if_clone *ifc, i >>>> GRE2IFP(sc)->if_softc =3D sc; >>>> if_initname(GRE2IFP(sc), grename, unit); >>>> =20 >>>> - GRE2IFP(sc)->if_mtu =3D sc->gre_mtu =3D GREMTU; >>>> + GRE2IFP(sc)->if_mtu =3D GREMTU; >>>> GRE2IFP(sc)->if_flags =3D IFF_POINTOPOINT|IFF_MULTICAST; >>>> GRE2IFP(sc)->if_output =3D gre_output; >>>> GRE2IFP(sc)->if_ioctl =3D gre_ioctl; >>>> @@ -231,7 +231,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, >>>> /* XXX: */ >>>> if (ifr->ifr_mtu < 576) >>> >>> This is another magic constant that should be in a #define. >> >> It was here too. I think it is something from the past and can be remo= ved. >> >> From RFC791: "It is recommended that hosts only send datagrams larger >> than 576 octets". >=20 > No, I doubt we want to remove that, it is also part of ipv6 documentati= on, > and iirc part of some BCP's. You really dont want to be running on the= > internet with MTU < 576. It use to be 296 in the days when we had SLIP= =2E Why not? We have many things that allow foot shooting. =3D=3D=3D=3D=3D=3D >>>> --- head/sys/net/if_me.c Tue Apr 11 08:29:12 2017 (r316698) >>>> +++ head/sys/net/if_me.c Tue Apr 11 08:56:18 2017 (r316699) >>>> @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); >>>> #include >>>> #include >>>> =20 >>>> -#define MEMTU 1500 >>>> +#define MEMTU (1500 - sizeof(struct mobhdr)) >>> >>> 1500 -> ETHERMTU? >> >> Feel free to fix this. Many pseudo interfaces has similar MTU limitati= ons. --=20 WBR, Andrey V. Elsukov --FrwCIHriBBhRQ12cpNfdJBv4Esigd5Qx9-- --BtcLklFV8pe6eumSxBQguHsfFS5qDn0Tg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAljtKD8ACgkQAcXqBBDI oXp5nwf9FMYpUVQwnMCo4aKesU47c2l8jRCrU5rczAWNvVmW0AyUp5lNjn+IG9ya zd9NiHXs+RDwVF1h/cbIel7t3Qg6m293aJyLeoVxCBjknuNb+iTU+o5fRUQ1lfAR nXw2LIzLOBFaedxnJapYD8a2wHP5bWav/1zD1n+S+JLnLjUn/VeGrrrC9xmFyjCm n/p5FZJowQe4DhQm50xnCLgcWqr6cYMhe9WSChvCXmqLRPm7eZRylXHWKlPC4JLS MG2S3bEEzDp3lJaSQUw3lTPCO0trkG3fMrjvPUZHrUkVSfCSEmL7aPlzYvCurKsm 3hHINip2g4uA4of4i2jbwJDM/NKgrA== =TIIx -----END PGP SIGNATURE----- --BtcLklFV8pe6eumSxBQguHsfFS5qDn0Tg-- From owner-svn-src-all@freebsd.org Tue Apr 11 19:05:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20435D3A09E; Tue, 11 Apr 2017 19:05:23 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5CE9B5; Tue, 11 Apr 2017 19:05:22 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cy16I-000NuO-1A; Tue, 11 Apr 2017 22:05:14 +0300 Date: Tue, 11 Apr 2017 22:05:13 +0300 From: Slawa Olhovchenkov To: rgrimes@freebsd.org Cc: "Andrey V. Elsukov" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r316699 - head/sys/net Message-ID: <20170411190513.GE20974@zxy.spb.ru> References: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704111849.v3BInuuB075892@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 19:05:23 -0000 On Tue, Apr 11, 2017 at 11:49:56AM -0700, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > On 11.04.2017 19:51, Rodney W. Grimes wrote: > > >> Modified: head/sys/net/if_gre.c > > >> ============================================================================== > > >> --- head/sys/net/if_gre.c Tue Apr 11 08:29:12 2017 (r316698) > > >> +++ head/sys/net/if_gre.c Tue Apr 11 08:56:18 2017 (r316699) > > >> @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); > > >> #include > > >> #include > > >> > > >> -#define GREMTU 1500 > > >> +#define GREMTU 1476 > > > > > > I would of thought that this was > > > #define GREMTU ETHERMTU > > > and now should probably be: > > > #define GREMTU ETHERMTU - gre_hlen; > > > Or what ever the approprite sizeof(foo) is; > > > > I just returned back constants that were here :) > > Can we try to improve on this, or maybe just ignore it? > > > The man page says: > > "The MTU of gre interfaces is set to 1476 by default, to match the > > value used by Cisco routers." > > That might need some clean up too? > > > > Isn't this arguably wrong in the face of JumboFrames? > > > > > > > I don't see why it may be wrong for jumbo frames. The default MTU value > > used by any interfaces is ETHERMTU, if you know that your NIC supports > > jumbo frames, you will configure specific MTU value. > > If you want 9k MTU on gre(4), you should configure it. > > I may some day want to #define ETHERMTU 9000 and just have all the right > magic happen, wouldnt that be nice? Not before 2038. From owner-svn-src-all@freebsd.org Tue Apr 11 19:20:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41108D3A756; Tue, 11 Apr 2017 19:20:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBDE2CBD; Tue, 11 Apr 2017 19:20:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BJKLH9099586; Tue, 11 Apr 2017 19:20:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BJKKA0099584; Tue, 11 Apr 2017 19:20:20 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704111920.v3BJKKA0099584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 11 Apr 2017 19:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316715 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 19:20:22 -0000 Author: ae Date: Tue Apr 11 19:20:20 2017 New Revision: 316715 URL: https://svnweb.freebsd.org/changeset/base/316715 Log: Make sysctl identifiers for direct netisr queue unique. Introduce IPCTL_INTRDQMAXLEN and IPCTL_INTRDQDROPS macros for this purpose. Reviewed by: gnn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10358 Modified: head/sys/netinet/in.h head/sys/netinet/ip_input.c Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Tue Apr 11 18:48:17 2017 (r316714) +++ head/sys/netinet/in.h Tue Apr 11 19:20:20 2017 (r316715) @@ -633,6 +633,8 @@ int getsourcefilter(int, uint32_t, struc #define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */ /* 15, unused, was: IPCTL_KEEPFAITH */ #define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */ +#define IPCTL_INTRDQMAXLEN 17 /* max length of direct netisr queue */ +#define IPCTL_INTRDQDROPS 18 /* number of direct netisr q drops */ #endif /* __BSD_VISIBLE */ Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Tue Apr 11 18:48:17 2017 (r316714) +++ head/sys/netinet/ip_input.c Tue Apr 11 19:20:20 2017 (r316715) @@ -266,9 +266,9 @@ sysctl_netinet_intr_direct_queue_maxlen( return (EINVAL); return (netisr_setqlimit(&ip_direct_nh, qlimit)); } -SYSCTL_PROC(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_direct_queue_maxlen, - CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet_intr_direct_queue_maxlen, "I", - "Maximum size of the IP direct input queue"); +SYSCTL_PROC(_net_inet_ip, IPCTL_INTRDQMAXLEN, intr_direct_queue_maxlen, + CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet_intr_direct_queue_maxlen, + "I", "Maximum size of the IP direct input queue"); static int sysctl_netinet_intr_direct_queue_drops(SYSCTL_HANDLER_ARGS) @@ -287,7 +287,7 @@ sysctl_netinet_intr_direct_queue_drops(S return (0); } -SYSCTL_PROC(_net_inet_ip, IPCTL_INTRQDROPS, intr_direct_queue_drops, +SYSCTL_PROC(_net_inet_ip, IPCTL_INTRDQDROPS, intr_direct_queue_drops, CTLTYPE_INT|CTLFLAG_RD, 0, 0, sysctl_netinet_intr_direct_queue_drops, "I", "Number of packets dropped from the IP direct input queue"); #endif /* RSS */ From owner-svn-src-all@freebsd.org Tue Apr 11 19:23:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9408ED3A9CE; Tue, 11 Apr 2017 19:23:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63D5517E; Tue, 11 Apr 2017 19:23:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BJNPDW003458; Tue, 11 Apr 2017 19:23:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BJNPJG003457; Tue, 11 Apr 2017 19:23:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704111923.v3BJNPJG003457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 11 Apr 2017 19:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316716 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 19:23:26 -0000 Author: ae Date: Tue Apr 11 19:23:25 2017 New Revision: 316716 URL: https://svnweb.freebsd.org/changeset/base/316716 Log: Inherit IPv6 checksum offloading flags to vlan interfaces. if_vlan(4) interfaces inherit IPv4 checksum offloading flags from the parent when VLAN_HWCSUM and VLAN_HWTAGGING flags are present on the parent interface. Do the same for IPv6 checksum offloading flags. Reported by: Harry Schmalzbauer Reviewed by: np, gnn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10356 Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Apr 11 19:20:20 2017 (r316715) +++ head/sys/net/if_vlan.c Tue Apr 11 19:23:25 2017 (r316716) @@ -1555,13 +1555,16 @@ vlan_capabilities(struct ifvlan *ifv) * offloading requires hardware VLAN tagging. */ if (p->if_capabilities & IFCAP_VLAN_HWCSUM) - ifp->if_capabilities = p->if_capabilities & IFCAP_HWCSUM; + ifp->if_capabilities = + p->if_capabilities & (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6); if (p->if_capenable & IFCAP_VLAN_HWCSUM && p->if_capenable & IFCAP_VLAN_HWTAGGING) { - ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM; + ifp->if_capenable = + p->if_capenable & (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6); ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP | - CSUM_UDP | CSUM_SCTP); + CSUM_UDP | CSUM_SCTP | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | + CSUM_SCTP_IPV6); } else { ifp->if_capenable = 0; ifp->if_hwassist = 0; From owner-svn-src-all@freebsd.org Tue Apr 11 20:28:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD779D3AEE9; Tue, 11 Apr 2017 20:28:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AFA9986; Tue, 11 Apr 2017 20:28:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BKSFdo028475; Tue, 11 Apr 2017 20:28:15 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BKSFTZ028474; Tue, 11 Apr 2017 20:28:15 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704112028.v3BKSFTZ028474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 11 Apr 2017 20:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316717 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 20:28:16 -0000 Author: rmacklem Date: Tue Apr 11 20:28:15 2017 New Revision: 316717 URL: https://svnweb.freebsd.org/changeset/base/316717 Log: During a server crash recovery, fix the NFSv4.1 client for a NFSERR_BADSESSION during recovery. If the NFSv4.1 client gets a NFSv4.1 NFSERR_BADSESSION reply to an Open/Lock operation while recovering from the server crash/reboot, allow the opens to be retained for a subsequent recovery attempt. Since NFSv4.1 servers should only reply NFSERR_BADSESSION after a crash/reboot that has lost state, this case should almost never happen. However, for the AmazonEFS file service, this has been observed when the client does a fresh TCP connection for RPCs. Reported by: cperciva Tested by: cperciva PR: 216088 MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue Apr 11 19:23:25 2017 (r316716) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Apr 11 20:28:15 2017 (r316717) @@ -1981,7 +1981,7 @@ nfscl_recover(struct nfsclclient *clp, s op = LIST_FIRST(&owp->nfsow_open); while (op != NULL) { nop = LIST_NEXT(op, nfso_list); - if (error != NFSERR_NOGRACE) { + if (error != NFSERR_NOGRACE && error != NFSERR_BADSESSION) { /* Search for a delegation to reclaim with the open */ TAILQ_FOREACH(dp, &clp->nfsc_deleg, nfsdl_list) { if (!(dp->nfsdl_flags & NFSCLDL_NEEDRECLAIM)) @@ -2050,11 +2050,10 @@ nfscl_recover(struct nfsclclient *clp, s len = NFS64BITSSET; else len = lop->nfslo_end - lop->nfslo_first; - if (error != NFSERR_NOGRACE) - error = nfscl_trylock(nmp, NULL, - op->nfso_fh, op->nfso_fhlen, lp, - firstlock, 1, lop->nfslo_first, len, - lop->nfslo_type, tcred, p); + error = nfscl_trylock(nmp, NULL, + op->nfso_fh, op->nfso_fhlen, lp, + firstlock, 1, lop->nfslo_first, len, + lop->nfslo_type, tcred, p); if (error != 0) nfscl_freelock(lop, 0); else @@ -2066,10 +2065,10 @@ nfscl_recover(struct nfsclclient *clp, s nfscl_freelockowner(lp, 0); lp = nlp; } - } else { - nfscl_freeopen(op, 0); } } + if (error != 0 && error != NFSERR_BADSESSION) + nfscl_freeopen(op, 0); op = nop; } owp = nowp; @@ -2100,7 +2099,7 @@ nfscl_recover(struct nfsclclient *clp, s nfscl_lockinit(&nowp->nfsow_rwlock); } nop = NULL; - if (error != NFSERR_NOGRACE) { + if (error != NFSERR_NOGRACE && error != NFSERR_BADSESSION) { MALLOC(nop, struct nfsclopen *, sizeof (struct nfsclopen) + dp->nfsdl_fhlen - 1, M_NFSCLOPEN, M_WAITOK); nop->nfso_own = nowp; From owner-svn-src-all@freebsd.org Tue Apr 11 21:55:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A05D3A9BF; Tue, 11 Apr 2017 21:55:41 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E502EDD8; Tue, 11 Apr 2017 21:55:40 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BLtenj065824; Tue, 11 Apr 2017 21:55:40 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BLtepk065823; Tue, 11 Apr 2017 21:55:40 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201704112155.v3BLtepk065823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Tue, 11 Apr 2017 21:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316718 - head/sbin/mksnap_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 21:55:41 -0000 Author: sobomax Date: Tue Apr 11 21:55:39 2017 New Revision: 316718 URL: https://svnweb.freebsd.org/changeset/base/316718 Log: Work around an issue with mksnap_ffs not working in chroot'ed environment. The problem is that the statfs(2) system call used to determine the relevant mount point returns path within real root in the f_mntonname, causing nmount(2) system call to fail with ENOENT. Use a bit of heuristics to skip over few starting path elements when it happens until we hit an actual mount point. For this to work properly the whole mount should be accessible within the chroot, it's going to still fail if chroot only has access to a part of the mounted fs. Reviewed by: mckusick Approved by: mckusick MFC after: 2 weeks Modified: head/sbin/mksnap_ffs/mksnap_ffs.c Modified: head/sbin/mksnap_ffs/mksnap_ffs.c ============================================================================== --- head/sbin/mksnap_ffs/mksnap_ffs.c Tue Apr 11 20:28:15 2017 (r316717) +++ head/sbin/mksnap_ffs/mksnap_ffs.c Tue Apr 11 21:55:39 2017 (r316718) @@ -58,6 +58,33 @@ usage(void) errx(EX_USAGE, "usage: mksnap_ffs snapshot_name"); } +static int +isdir(const char *path) +{ + struct stat stbuf; + + if (stat(path, &stbuf) < 0) + return (-1); + if (!S_ISDIR(stbuf.st_mode)) + return (0); + return (1); +} + +static int +issamefs(const char *path, struct statfs *stfsp) +{ + struct statfs stfsbuf; + + if (isdir(path) != 1) + return (-1); + if (statfs(path, &stfsbuf) < 0) + return (-1); + if ((stfsbuf.f_fsid.val[0] != stfsp->f_fsid.val[0]) || + (stfsbuf.f_fsid.val[1] != stfsp->f_fsid.val[1])) + return (0); + return (1); +} + int main(int argc, char **argv) { @@ -96,16 +123,33 @@ main(int argc, char **argv) } if (statfs(path, &stfsbuf) < 0) err(1, "%s", path); - if (stat(path, &stbuf) < 0) + switch (isdir(path)) { + case -1: err(1, "%s", path); - if (!S_ISDIR(stbuf.st_mode)) + case 0: errx(1, "%s: Not a directory", path); + default: + break; + } if (access(path, W_OK) < 0) err(1, "Lack write permission in %s", path); if ((stbuf.st_mode & S_ISTXT) && stbuf.st_uid != getuid()) errx(1, "Lack write permission in %s: Sticky bit set", path); /* + * Work around an issue when mksnap_ffs is started in chroot'ed + * environment and f_mntonname contains absolute path within + * real root. + */ + for (cp = stfsbuf.f_mntonname; issamefs(cp, &stfsbuf) != 1; + cp = strchrnul(cp + 1, '/')) { + if (cp[0] == '\0') + errx(1, "%s: Not a mount point", stfsbuf.f_mntonname); + } + if (cp != stfsbuf.f_mntonname) + strlcpy(stfsbuf.f_mntonname, cp, sizeof(stfsbuf.f_mntonname)); + + /* * Having verified access to the directory in which the * snapshot is to be built, proceed with creating it. */ From owner-svn-src-all@freebsd.org Tue Apr 11 22:47:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D3DDD3AA91; Tue, 11 Apr 2017 22:47:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F0B9F9C; Tue, 11 Apr 2017 22:47:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3BMl2hV086169; Tue, 11 Apr 2017 22:47:02 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3BMl2L7086168; Tue, 11 Apr 2017 22:47:02 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704112247.v3BMl2L7086168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 11 Apr 2017 22:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316719 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 22:47:03 -0000 Author: rmacklem Date: Tue Apr 11 22:47:02 2017 New Revision: 316719 URL: https://svnweb.freebsd.org/changeset/base/316719 Log: Don't throw away Open state when a NFSv4.1 client recovery fails. If the ExchangeID/CreateSession operations done by an NFSv4.1 client after the server crashes/reboots fails, it is possible that some process/thread is waiting for an open_owner lock. If the client state is free'd, this can cause a crash. This would not normally happen, but has been observed on a mount of the AmazonEFS service. Reported by: cperciva Tested by: cperciva PR: 216086 MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue Apr 11 21:55:39 2017 (r316718) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Apr 11 22:47:02 2017 (r316719) @@ -1934,10 +1934,9 @@ nfscl_recover(struct nfsclclient *clp, s error == NFSERR_BADSESSION || error == NFSERR_STALEDONTRECOVER) && --trycnt > 0); if (error) { - nfscl_cleanclient(clp); NFSLOCKCLSTATE(); - clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID | - NFSCLFLAGS_RECOVER | NFSCLFLAGS_RECVRINPROG); + clp->nfsc_flags &= ~(NFSCLFLAGS_RECOVER | + NFSCLFLAGS_RECVRINPROG); wakeup(&clp->nfsc_flags); nfsv4_unlock(&clp->nfsc_lock, 0); NFSUNLOCKCLSTATE(); @@ -2254,13 +2253,8 @@ nfscl_hasexpired(struct nfsclclient *clp error == NFSERR_BADSESSION || error == NFSERR_STALEDONTRECOVER) && --trycnt > 0); if (error) { - /* - * Clear out any state. - */ - nfscl_cleanclient(clp); NFSLOCKCLSTATE(); - clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID | - NFSCLFLAGS_RECOVER); + clp->nfsc_flags &= ~NFSCLFLAGS_RECOVER; } else { /* * Expire the state for the client. From owner-svn-src-all@freebsd.org Wed Apr 12 00:52:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EF30D374AD; Wed, 12 Apr 2017 00:52:11 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F81980; Wed, 12 Apr 2017 00:52:10 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3C0qAYA038405; Wed, 12 Apr 2017 00:52:10 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3C0qABq038403; Wed, 12 Apr 2017 00:52:10 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201704120052.v3C0qABq038403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 12 Apr 2017 00:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316720 - head/sys/dev/qlnx/qlnxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 00:52:11 -0000 Author: davidcs Date: Wed Apr 12 00:52:09 2017 New Revision: 316720 URL: https://svnweb.freebsd.org/changeset/base/316720 Log: Fix defects reported by Coverity 1. Deadcode in ecore_init_cache_line_size(), qlnx_ioctl() and qlnx_clean_filters() 2. ARRAY_VS_SINGLETON issue in qlnx_remove_all_mcast_mac() and qlnx_update_rx_prod() MFC after:5 days Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h head/sys/dev/qlnx/qlnxe/qlnx_os.c Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/bcm_osal.h Tue Apr 11 22:47:02 2017 (r316719) +++ head/sys/dev/qlnx/qlnxe/bcm_osal.h Wed Apr 12 00:52:09 2017 (r316720) @@ -144,7 +144,14 @@ rounddown_pow_of_two(unsigned long x) #define OSAL_CPU_TO_LE16(val) htole16(val) #define OSAL_LE16_TO_CPU(val) le16toh(val) -#define OSAL_CACHE_LINE_SIZE CACHE_LINE_SIZE +static __inline uint32_t +qlnx_get_cache_line_size(void) +{ + return (CACHE_LINE_SIZE); +} + +#define OSAL_CACHE_LINE_SIZE qlnx_get_cache_line_size() + #define OSAL_BE32 uint32_t #define dma_addr_t bus_addr_t #define osal_size_t size_t Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Tue Apr 11 22:47:02 2017 (r316719) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Wed Apr 12 00:52:09 2017 (r316720) @@ -2167,9 +2167,6 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd } QLNX_UNLOCK(ha); - - if (ret) - ret = EINVAL; } break; @@ -5910,25 +5907,26 @@ qlnx_update_rx_prod(struct ecore_hwfn *p uint16_t bd_prod; uint16_t cqe_prod; - struct eth_rx_prod_data rx_prods = {0}; + union { + struct eth_rx_prod_data rx_prod_data; + uint32_t data32; + } rx_prods; bd_prod = ecore_chain_get_prod_idx(&rxq->rx_bd_ring); cqe_prod = ecore_chain_get_prod_idx(&rxq->rx_comp_ring); /* Update producers */ - rx_prods.bd_prod = htole16(bd_prod); - rx_prods.cqe_prod = htole16(cqe_prod); + rx_prods.rx_prod_data.bd_prod = htole16(bd_prod); + rx_prods.rx_prod_data.cqe_prod = htole16(cqe_prod); /* Make sure that the BD and SGE data is updated before updating the * producers since FW might read the BD/SGE right after the producer * is updated. */ wmb(); - //bus_barrier(ha->pci_reg, 0, 0, BUS_SPACE_BARRIER_READ); - //bus_barrier(ha->pci_dbells, 0, 0, BUS_SPACE_BARRIER_READ); internal_ram_wr(p_hwfn, rxq->hw_rxq_prod_addr, - sizeof(rx_prods), (u32 *)&rx_prods); + sizeof(rx_prods), &rx_prods.data32); /* mmiowb is needed to synchronize doorbell writes from more than one * processor. It guarantees that the write arrives to the device before @@ -6342,9 +6340,8 @@ qlnx_remove_all_mcast_mac(qlnx_host_t *h ha->mcast[i].addr[2] || ha->mcast[i].addr[3] || ha->mcast[i].addr[4] || ha->mcast[i].addr[5]) { - memcpy(&mcast->mac[0], &ha->mcast[i].addr[0], ETH_ALEN); + memcpy(&mcast->mac[i], &ha->mcast[i].addr[0], ETH_ALEN); mcast->num_mc_addrs++; - mcast++; } } mcast = &ha->ecore_mcast; @@ -6363,7 +6360,7 @@ qlnx_clean_filters(qlnx_host_t *ha) int rc = 0; /* Remove all unicast macs */ - qlnx_remove_all_ucast_mac(ha); + rc = qlnx_remove_all_ucast_mac(ha); if (rc) return rc; From owner-svn-src-all@freebsd.org Wed Apr 12 01:15:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9870AD37B6E; Wed, 12 Apr 2017 01:15:34 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65BBFD74; Wed, 12 Apr 2017 01:15:34 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3C1FXFx047748; Wed, 12 Apr 2017 01:15:33 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3C1FXP1047747; Wed, 12 Apr 2017 01:15:33 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201704120115.v3C1FXP1047747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 12 Apr 2017 01:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316721 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 01:15:34 -0000 Author: kevlo Date: Wed Apr 12 01:15:33 2017 New Revision: 316721 URL: https://svnweb.freebsd.org/changeset/base/316721 Log: Most wireless drivers don't support altq(4). Modified: head/share/man/man4/altq.4 Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Wed Apr 12 00:52:09 2017 (r316720) +++ head/share/man/man4/altq.4 Wed Apr 12 01:15:33 2017 (r316721) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 2015 +.Dd April 12, 2017 .Dt ALTQ 4 .Os .Sh NAME @@ -130,7 +130,6 @@ They have been applied to the following .Xr alc 4 , .Xr ale 4 , .Xr an 4 , -.Xr ath 4 , .Xr aue 4 , .Xr axe 4 , .Xr bce 4 , @@ -150,8 +149,6 @@ They have been applied to the following .Xr gem 4 , .Xr hme 4 , .Xr igb 4 , -.Xr ipw 4 , -.Xr iwi 4 , .Xr ixgbe 4 , .Xr jme 4 , .Xr le 4 , @@ -162,10 +159,8 @@ They have been applied to the following .Xr nge 4 , .Xr npe 4 , .Xr qlxgb 4 , -.Xr ral 4 , .Xr re 4 , .Xr rl 4 , -.Xr rum 4 , .Xr sf 4 , .Xr sge 4 , .Xr sis 4 , @@ -175,11 +170,9 @@ They have been applied to the following .Xr ti 4 , .Xr txp 4 , .Xr udav 4 , -.Xr ural 4 , .Xr vge 4 , .Xr vr 4 , .Xr vte 4 , -.Xr wi 4 , and .Xr xl 4 . .Pp From owner-svn-src-all@freebsd.org Wed Apr 12 06:24:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BBBAD3A29D; Wed, 12 Apr 2017 06:24:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D39FCD0A; Wed, 12 Apr 2017 06:24:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3C6Oao7074312; Wed, 12 Apr 2017 06:24:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3C6OalX074307; Wed, 12 Apr 2017 06:24:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201704120624.v3C6OalX074307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 12 Apr 2017 06:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r316722 - in releng: 10.3 10.3/contrib/ntp 10.3/contrib/ntp/adjtimed 10.3/contrib/ntp/clockstuff 10.3/contrib/ntp/html 10.3/contrib/ntp/include 10.3/contrib/ntp/include/isc 10.3/contrib... X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 06:24:38 -0000 Author: delphij Date: Wed Apr 12 06:24:35 2017 New Revision: 316722 URL: https://svnweb.freebsd.org/changeset/base/316722 Log: Fix multiple vulnerabilities of ntp. [SA-17:03] Xen migration enhancements. [EN-17:05] Approved by: so Deleted: releng/10.3/contrib/ntp/compile releng/10.3/contrib/ntp/config.guess releng/10.3/contrib/ntp/config.sub releng/10.3/contrib/ntp/depcomp releng/10.3/contrib/ntp/install-sh releng/10.3/contrib/ntp/ltmain.sh releng/10.3/contrib/ntp/missing releng/10.3/contrib/ntp/sntp/compile releng/10.3/contrib/ntp/sntp/config.guess releng/10.3/contrib/ntp/sntp/config.sub releng/10.3/contrib/ntp/sntp/depcomp releng/10.3/contrib/ntp/sntp/install-sh releng/10.3/contrib/ntp/sntp/ltmain.sh releng/10.3/contrib/ntp/sntp/missing releng/10.3/contrib/ntp/ylwrap releng/11.0/contrib/ntp/compile releng/11.0/contrib/ntp/config.guess releng/11.0/contrib/ntp/config.sub releng/11.0/contrib/ntp/depcomp releng/11.0/contrib/ntp/install-sh releng/11.0/contrib/ntp/ltmain.sh releng/11.0/contrib/ntp/missing releng/11.0/contrib/ntp/sntp/compile releng/11.0/contrib/ntp/sntp/config.guess releng/11.0/contrib/ntp/sntp/config.sub releng/11.0/contrib/ntp/sntp/depcomp releng/11.0/contrib/ntp/sntp/install-sh releng/11.0/contrib/ntp/sntp/ltmain.sh releng/11.0/contrib/ntp/sntp/missing releng/11.0/contrib/ntp/tests/ releng/11.0/contrib/ntp/ylwrap Modified: releng/10.3/UPDATING releng/10.3/contrib/ntp/COPYRIGHT releng/10.3/contrib/ntp/ChangeLog releng/10.3/contrib/ntp/CommitLog releng/10.3/contrib/ntp/Makefile.in releng/10.3/contrib/ntp/NEWS releng/10.3/contrib/ntp/aclocal.m4 releng/10.3/contrib/ntp/adjtimed/Makefile.am releng/10.3/contrib/ntp/adjtimed/Makefile.in releng/10.3/contrib/ntp/clockstuff/Makefile.am releng/10.3/contrib/ntp/clockstuff/Makefile.in releng/10.3/contrib/ntp/config.h.in releng/10.3/contrib/ntp/configure releng/10.3/contrib/ntp/configure.ac releng/10.3/contrib/ntp/html/copyright.html releng/10.3/contrib/ntp/include/Makefile.in releng/10.3/contrib/ntp/include/isc/Makefile.in releng/10.3/contrib/ntp/include/libssl_compat.h releng/10.3/contrib/ntp/include/ntp_crypto.h releng/10.3/contrib/ntp/include/ntp_fp.h releng/10.3/contrib/ntp/include/ntp_md5.h releng/10.3/contrib/ntp/include/ntp_stdlib.h releng/10.3/contrib/ntp/include/ntpd.h releng/10.3/contrib/ntp/include/ssl_applink.c releng/10.3/contrib/ntp/kernel/Makefile.in releng/10.3/contrib/ntp/kernel/sys/Makefile.in releng/10.3/contrib/ntp/lib/isc/inet_pton.c releng/10.3/contrib/ntp/libntp/Makefile.am releng/10.3/contrib/ntp/libntp/Makefile.in releng/10.3/contrib/ntp/libntp/a_md5encrypt.c releng/10.3/contrib/ntp/libntp/audio.c releng/10.3/contrib/ntp/libntp/authkeys.c releng/10.3/contrib/ntp/libntp/emalloc.c releng/10.3/contrib/ntp/libntp/libssl_compat.c releng/10.3/contrib/ntp/libntp/ntp_intres.c releng/10.3/contrib/ntp/libntp/recvbuff.c releng/10.3/contrib/ntp/libntp/ssl_init.c releng/10.3/contrib/ntp/libntp/statestr.c releng/10.3/contrib/ntp/libntp/work_fork.c releng/10.3/contrib/ntp/libparse/Makefile.am releng/10.3/contrib/ntp/libparse/Makefile.in releng/10.3/contrib/ntp/libparse/clk_trimtsip.c releng/10.3/contrib/ntp/libparse/gpstolfp.c releng/10.3/contrib/ntp/ntpd/Makefile.am releng/10.3/contrib/ntp/ntpd/Makefile.in releng/10.3/contrib/ntp/ntpd/invoke-ntp.conf.texi releng/10.3/contrib/ntp/ntpd/invoke-ntp.keys.texi releng/10.3/contrib/ntp/ntpd/invoke-ntpd.texi releng/10.3/contrib/ntp/ntpd/ntp.conf.5man releng/10.3/contrib/ntp/ntpd/ntp.conf.5mdoc releng/10.3/contrib/ntp/ntpd/ntp.conf.html releng/10.3/contrib/ntp/ntpd/ntp.conf.man.in releng/10.3/contrib/ntp/ntpd/ntp.conf.mdoc.in releng/10.3/contrib/ntp/ntpd/ntp.keys.5man releng/10.3/contrib/ntp/ntpd/ntp.keys.5mdoc releng/10.3/contrib/ntp/ntpd/ntp.keys.html releng/10.3/contrib/ntp/ntpd/ntp.keys.man.in releng/10.3/contrib/ntp/ntpd/ntp.keys.mdoc.in releng/10.3/contrib/ntp/ntpd/ntp_config.c releng/10.3/contrib/ntp/ntpd/ntp_control.c releng/10.3/contrib/ntp/ntpd/ntp_crypto.c releng/10.3/contrib/ntp/ntpd/ntp_io.c releng/10.3/contrib/ntp/ntpd/ntp_loopfilter.c releng/10.3/contrib/ntp/ntpd/ntp_parser.c releng/10.3/contrib/ntp/ntpd/ntp_parser.h releng/10.3/contrib/ntp/ntpd/ntp_peer.c releng/10.3/contrib/ntp/ntpd/ntp_proto.c releng/10.3/contrib/ntp/ntpd/ntp_restrict.c releng/10.3/contrib/ntp/ntpd/ntp_scanner.c releng/10.3/contrib/ntp/ntpd/ntpd-opts.c releng/10.3/contrib/ntp/ntpd/ntpd-opts.h releng/10.3/contrib/ntp/ntpd/ntpd.1ntpdman releng/10.3/contrib/ntp/ntpd/ntpd.1ntpdmdoc releng/10.3/contrib/ntp/ntpd/ntpd.c releng/10.3/contrib/ntp/ntpd/ntpd.html releng/10.3/contrib/ntp/ntpd/ntpd.man.in releng/10.3/contrib/ntp/ntpd/ntpd.mdoc.in releng/10.3/contrib/ntp/ntpd/refclock_datum.c releng/10.3/contrib/ntp/ntpd/refclock_gpsdjson.c releng/10.3/contrib/ntp/ntpd/refclock_jjy.c releng/10.3/contrib/ntp/ntpd/refclock_mx4200.c releng/10.3/contrib/ntp/ntpd/refclock_nmea.c releng/10.3/contrib/ntp/ntpd/refclock_oncore.c releng/10.3/contrib/ntp/ntpd/refclock_parse.c releng/10.3/contrib/ntp/ntpdate/Makefile.am releng/10.3/contrib/ntp/ntpdate/Makefile.in releng/10.3/contrib/ntp/ntpdate/ntpdate.c releng/10.3/contrib/ntp/ntpdc/Makefile.am releng/10.3/contrib/ntp/ntpdc/Makefile.in releng/10.3/contrib/ntp/ntpdc/invoke-ntpdc.texi releng/10.3/contrib/ntp/ntpdc/ntpdc-opts.c releng/10.3/contrib/ntp/ntpdc/ntpdc-opts.h releng/10.3/contrib/ntp/ntpdc/ntpdc.1ntpdcman releng/10.3/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc releng/10.3/contrib/ntp/ntpdc/ntpdc.c releng/10.3/contrib/ntp/ntpdc/ntpdc.html releng/10.3/contrib/ntp/ntpdc/ntpdc.man.in releng/10.3/contrib/ntp/ntpdc/ntpdc.mdoc.in releng/10.3/contrib/ntp/ntpdc/ntpdc_ops.c releng/10.3/contrib/ntp/ntpq/Makefile.am releng/10.3/contrib/ntp/ntpq/Makefile.in releng/10.3/contrib/ntp/ntpq/invoke-ntpq.texi releng/10.3/contrib/ntp/ntpq/libntpq.c releng/10.3/contrib/ntp/ntpq/ntpq-opts.c releng/10.3/contrib/ntp/ntpq/ntpq-opts.h releng/10.3/contrib/ntp/ntpq/ntpq-subs.c releng/10.3/contrib/ntp/ntpq/ntpq.1ntpqman releng/10.3/contrib/ntp/ntpq/ntpq.1ntpqmdoc releng/10.3/contrib/ntp/ntpq/ntpq.c releng/10.3/contrib/ntp/ntpq/ntpq.html releng/10.3/contrib/ntp/ntpq/ntpq.man.in releng/10.3/contrib/ntp/ntpq/ntpq.mdoc.in releng/10.3/contrib/ntp/ntpsnmpd/Makefile.am releng/10.3/contrib/ntp/ntpsnmpd/Makefile.in releng/10.3/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi releng/10.3/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c releng/10.3/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h releng/10.3/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman releng/10.3/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc releng/10.3/contrib/ntp/ntpsnmpd/ntpsnmpd.html releng/10.3/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in releng/10.3/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in releng/10.3/contrib/ntp/packageinfo.sh releng/10.3/contrib/ntp/parseutil/Makefile.am releng/10.3/contrib/ntp/parseutil/Makefile.in releng/10.3/contrib/ntp/scripts/Makefile.in releng/10.3/contrib/ntp/scripts/build/Makefile.in releng/10.3/contrib/ntp/scripts/calc_tickadj/Makefile.in releng/10.3/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman releng/10.3/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc releng/10.3/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html releng/10.3/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in releng/10.3/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in releng/10.3/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi releng/10.3/contrib/ntp/scripts/invoke-plot_summary.texi releng/10.3/contrib/ntp/scripts/invoke-summary.texi releng/10.3/contrib/ntp/scripts/lib/Makefile.in releng/10.3/contrib/ntp/scripts/ntp-wait/Makefile.in releng/10.3/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi releng/10.3/contrib/ntp/scripts/ntp-wait/ntp-wait-opts releng/10.3/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman releng/10.3/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc releng/10.3/contrib/ntp/scripts/ntp-wait/ntp-wait.html releng/10.3/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in releng/10.3/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in releng/10.3/contrib/ntp/scripts/ntpsweep/Makefile.in releng/10.3/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi releng/10.3/contrib/ntp/scripts/ntpsweep/ntpsweep-opts releng/10.3/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman releng/10.3/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc releng/10.3/contrib/ntp/scripts/ntpsweep/ntpsweep.html releng/10.3/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in releng/10.3/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in releng/10.3/contrib/ntp/scripts/ntptrace/Makefile.in releng/10.3/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi releng/10.3/contrib/ntp/scripts/ntptrace/ntptrace-opts releng/10.3/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman releng/10.3/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc releng/10.3/contrib/ntp/scripts/ntptrace/ntptrace.html releng/10.3/contrib/ntp/scripts/ntptrace/ntptrace.man.in releng/10.3/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in releng/10.3/contrib/ntp/scripts/plot_summary-opts releng/10.3/contrib/ntp/scripts/plot_summary.1plot_summaryman releng/10.3/contrib/ntp/scripts/plot_summary.1plot_summarymdoc releng/10.3/contrib/ntp/scripts/plot_summary.html releng/10.3/contrib/ntp/scripts/plot_summary.man.in releng/10.3/contrib/ntp/scripts/plot_summary.mdoc.in releng/10.3/contrib/ntp/scripts/summary-opts releng/10.3/contrib/ntp/scripts/summary.1summaryman releng/10.3/contrib/ntp/scripts/summary.1summarymdoc releng/10.3/contrib/ntp/scripts/summary.html releng/10.3/contrib/ntp/scripts/summary.man.in releng/10.3/contrib/ntp/scripts/summary.mdoc.in releng/10.3/contrib/ntp/scripts/update-leap/Makefile.in releng/10.3/contrib/ntp/scripts/update-leap/invoke-update-leap.texi releng/10.3/contrib/ntp/scripts/update-leap/update-leap-opts releng/10.3/contrib/ntp/scripts/update-leap/update-leap.1update-leapman releng/10.3/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc releng/10.3/contrib/ntp/scripts/update-leap/update-leap.html releng/10.3/contrib/ntp/scripts/update-leap/update-leap.man.in releng/10.3/contrib/ntp/scripts/update-leap/update-leap.mdoc.in releng/10.3/contrib/ntp/sntp/COPYRIGHT releng/10.3/contrib/ntp/sntp/Makefile.am releng/10.3/contrib/ntp/sntp/Makefile.in releng/10.3/contrib/ntp/sntp/aclocal.m4 releng/10.3/contrib/ntp/sntp/config.h.in releng/10.3/contrib/ntp/sntp/configure releng/10.3/contrib/ntp/sntp/configure.ac releng/10.3/contrib/ntp/sntp/crypto.c releng/10.3/contrib/ntp/sntp/include/Makefile.in releng/10.3/contrib/ntp/sntp/include/copyright.def releng/10.3/contrib/ntp/sntp/include/version.def releng/10.3/contrib/ntp/sntp/include/version.texi releng/10.3/contrib/ntp/sntp/invoke-sntp.texi releng/10.3/contrib/ntp/sntp/kod_management.c releng/10.3/contrib/ntp/sntp/libevent/Makefile.am releng/10.3/contrib/ntp/sntp/libevent/Makefile.in releng/10.3/contrib/ntp/sntp/libevent/build-aux/compile releng/10.3/contrib/ntp/sntp/libevent/build-aux/config.guess releng/10.3/contrib/ntp/sntp/libevent/build-aux/config.sub releng/10.3/contrib/ntp/sntp/libevent/build-aux/depcomp releng/10.3/contrib/ntp/sntp/libevent/build-aux/install-sh releng/10.3/contrib/ntp/sntp/libevent/build-aux/ltmain.sh releng/10.3/contrib/ntp/sntp/libevent/build-aux/missing releng/10.3/contrib/ntp/sntp/libevent/build-aux/ylwrap releng/10.3/contrib/ntp/sntp/libevent/config.h.in releng/10.3/contrib/ntp/sntp/libevent/configure releng/10.3/contrib/ntp/sntp/libevent/configure.ac releng/10.3/contrib/ntp/sntp/libevent/m4/libtool.m4 releng/10.3/contrib/ntp/sntp/libevent/m4/ltoptions.m4 releng/10.3/contrib/ntp/sntp/libevent/m4/ltsugar.m4 releng/10.3/contrib/ntp/sntp/libevent/m4/ltversion.m4 releng/10.3/contrib/ntp/sntp/libevent/m4/lt~obsolete.m4 releng/10.3/contrib/ntp/sntp/libevent/test/regress_ssl.c releng/10.3/contrib/ntp/sntp/libopts/Makefile.am releng/10.3/contrib/ntp/sntp/libopts/Makefile.in releng/10.3/contrib/ntp/sntp/m4/libtool.m4 releng/10.3/contrib/ntp/sntp/m4/ltoptions.m4 releng/10.3/contrib/ntp/sntp/m4/ltsugar.m4 releng/10.3/contrib/ntp/sntp/m4/ltversion.m4 releng/10.3/contrib/ntp/sntp/m4/lt~obsolete.m4 releng/10.3/contrib/ntp/sntp/m4/ntp_compiler.m4 releng/10.3/contrib/ntp/sntp/m4/ntp_libevent.m4 releng/10.3/contrib/ntp/sntp/m4/ntp_libntp.m4 releng/10.3/contrib/ntp/sntp/m4/ntp_openssl.m4 releng/10.3/contrib/ntp/sntp/m4/ntp_prog_cc.m4 releng/10.3/contrib/ntp/sntp/m4/version.m4 releng/10.3/contrib/ntp/sntp/scm-rev releng/10.3/contrib/ntp/sntp/scripts/Makefile.am releng/10.3/contrib/ntp/sntp/scripts/Makefile.in releng/10.3/contrib/ntp/sntp/sntp-opts.c releng/10.3/contrib/ntp/sntp/sntp-opts.h releng/10.3/contrib/ntp/sntp/sntp.1sntpman releng/10.3/contrib/ntp/sntp/sntp.1sntpmdoc releng/10.3/contrib/ntp/sntp/sntp.html releng/10.3/contrib/ntp/sntp/sntp.man.in releng/10.3/contrib/ntp/sntp/sntp.mdoc.in releng/10.3/contrib/ntp/sntp/tests/Makefile.am releng/10.3/contrib/ntp/sntp/tests/Makefile.in releng/10.3/contrib/ntp/sntp/unity/Makefile.am releng/10.3/contrib/ntp/sntp/unity/Makefile.in releng/10.3/contrib/ntp/sntp/version.c releng/10.3/contrib/ntp/util/Makefile.am releng/10.3/contrib/ntp/util/Makefile.in releng/10.3/contrib/ntp/util/invoke-ntp-keygen.texi releng/10.3/contrib/ntp/util/ntp-keygen-opts.c releng/10.3/contrib/ntp/util/ntp-keygen-opts.h releng/10.3/contrib/ntp/util/ntp-keygen.1ntp-keygenman releng/10.3/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc releng/10.3/contrib/ntp/util/ntp-keygen.c releng/10.3/contrib/ntp/util/ntp-keygen.html releng/10.3/contrib/ntp/util/ntp-keygen.man.in releng/10.3/contrib/ntp/util/ntp-keygen.mdoc.in releng/10.3/sys/conf/newvers.sh releng/10.3/sys/dev/xen/blkfront/blkfront.c releng/10.3/sys/dev/xen/control/control.c releng/10.3/sys/dev/xen/netfront/netfront.c releng/10.3/sys/xen/xen-os.h releng/10.3/sys/xen/xenbus/xenbusb.c releng/10.3/sys/xen/xenstore/xenstore.c releng/10.3/sys/xen/xenstore/xenstorevar.h releng/10.3/usr.sbin/ntp/config.h releng/10.3/usr.sbin/ntp/doc/ntp-keygen.8 releng/10.3/usr.sbin/ntp/doc/ntp.conf.5 releng/10.3/usr.sbin/ntp/doc/ntp.keys.5 releng/10.3/usr.sbin/ntp/doc/ntpd.8 releng/10.3/usr.sbin/ntp/doc/ntpdc.8 releng/10.3/usr.sbin/ntp/doc/ntpq.8 releng/10.3/usr.sbin/ntp/doc/sntp.8 releng/10.3/usr.sbin/ntp/scripts/mkver releng/11.0/UPDATING releng/11.0/contrib/ntp/COPYRIGHT releng/11.0/contrib/ntp/ChangeLog releng/11.0/contrib/ntp/CommitLog releng/11.0/contrib/ntp/Makefile.in releng/11.0/contrib/ntp/NEWS releng/11.0/contrib/ntp/aclocal.m4 releng/11.0/contrib/ntp/adjtimed/Makefile.am releng/11.0/contrib/ntp/adjtimed/Makefile.in releng/11.0/contrib/ntp/clockstuff/Makefile.am releng/11.0/contrib/ntp/clockstuff/Makefile.in releng/11.0/contrib/ntp/config.h.in releng/11.0/contrib/ntp/configure releng/11.0/contrib/ntp/configure.ac releng/11.0/contrib/ntp/html/copyright.html releng/11.0/contrib/ntp/include/Makefile.in releng/11.0/contrib/ntp/include/isc/Makefile.in releng/11.0/contrib/ntp/include/libssl_compat.h releng/11.0/contrib/ntp/include/ntp_crypto.h releng/11.0/contrib/ntp/include/ntp_fp.h releng/11.0/contrib/ntp/include/ntp_md5.h releng/11.0/contrib/ntp/include/ntp_stdlib.h releng/11.0/contrib/ntp/include/ntpd.h releng/11.0/contrib/ntp/include/ssl_applink.c releng/11.0/contrib/ntp/kernel/Makefile.in releng/11.0/contrib/ntp/kernel/sys/Makefile.in releng/11.0/contrib/ntp/lib/isc/inet_pton.c releng/11.0/contrib/ntp/libntp/Makefile.am releng/11.0/contrib/ntp/libntp/Makefile.in releng/11.0/contrib/ntp/libntp/a_md5encrypt.c releng/11.0/contrib/ntp/libntp/audio.c releng/11.0/contrib/ntp/libntp/authkeys.c releng/11.0/contrib/ntp/libntp/emalloc.c releng/11.0/contrib/ntp/libntp/libssl_compat.c releng/11.0/contrib/ntp/libntp/ntp_intres.c releng/11.0/contrib/ntp/libntp/recvbuff.c releng/11.0/contrib/ntp/libntp/ssl_init.c releng/11.0/contrib/ntp/libntp/statestr.c releng/11.0/contrib/ntp/libntp/work_fork.c releng/11.0/contrib/ntp/libparse/Makefile.am releng/11.0/contrib/ntp/libparse/Makefile.in releng/11.0/contrib/ntp/libparse/clk_trimtsip.c releng/11.0/contrib/ntp/libparse/gpstolfp.c releng/11.0/contrib/ntp/ntpd/Makefile.am releng/11.0/contrib/ntp/ntpd/Makefile.in releng/11.0/contrib/ntp/ntpd/invoke-ntp.conf.texi releng/11.0/contrib/ntp/ntpd/invoke-ntp.keys.texi releng/11.0/contrib/ntp/ntpd/invoke-ntpd.texi releng/11.0/contrib/ntp/ntpd/ntp.conf.5man releng/11.0/contrib/ntp/ntpd/ntp.conf.5mdoc releng/11.0/contrib/ntp/ntpd/ntp.conf.html releng/11.0/contrib/ntp/ntpd/ntp.conf.man.in releng/11.0/contrib/ntp/ntpd/ntp.conf.mdoc.in releng/11.0/contrib/ntp/ntpd/ntp.keys.5man releng/11.0/contrib/ntp/ntpd/ntp.keys.5mdoc releng/11.0/contrib/ntp/ntpd/ntp.keys.html releng/11.0/contrib/ntp/ntpd/ntp.keys.man.in releng/11.0/contrib/ntp/ntpd/ntp.keys.mdoc.in releng/11.0/contrib/ntp/ntpd/ntp_config.c releng/11.0/contrib/ntp/ntpd/ntp_control.c releng/11.0/contrib/ntp/ntpd/ntp_crypto.c releng/11.0/contrib/ntp/ntpd/ntp_io.c releng/11.0/contrib/ntp/ntpd/ntp_loopfilter.c releng/11.0/contrib/ntp/ntpd/ntp_parser.c releng/11.0/contrib/ntp/ntpd/ntp_parser.h releng/11.0/contrib/ntp/ntpd/ntp_peer.c releng/11.0/contrib/ntp/ntpd/ntp_proto.c releng/11.0/contrib/ntp/ntpd/ntp_restrict.c releng/11.0/contrib/ntp/ntpd/ntp_scanner.c releng/11.0/contrib/ntp/ntpd/ntpd-opts.c releng/11.0/contrib/ntp/ntpd/ntpd-opts.h releng/11.0/contrib/ntp/ntpd/ntpd.1ntpdman releng/11.0/contrib/ntp/ntpd/ntpd.1ntpdmdoc releng/11.0/contrib/ntp/ntpd/ntpd.c releng/11.0/contrib/ntp/ntpd/ntpd.html releng/11.0/contrib/ntp/ntpd/ntpd.man.in releng/11.0/contrib/ntp/ntpd/ntpd.mdoc.in releng/11.0/contrib/ntp/ntpd/refclock_datum.c releng/11.0/contrib/ntp/ntpd/refclock_gpsdjson.c releng/11.0/contrib/ntp/ntpd/refclock_jjy.c releng/11.0/contrib/ntp/ntpd/refclock_mx4200.c releng/11.0/contrib/ntp/ntpd/refclock_nmea.c releng/11.0/contrib/ntp/ntpd/refclock_oncore.c releng/11.0/contrib/ntp/ntpd/refclock_parse.c releng/11.0/contrib/ntp/ntpdate/Makefile.am releng/11.0/contrib/ntp/ntpdate/Makefile.in releng/11.0/contrib/ntp/ntpdate/ntpdate.c releng/11.0/contrib/ntp/ntpdc/Makefile.am releng/11.0/contrib/ntp/ntpdc/Makefile.in releng/11.0/contrib/ntp/ntpdc/invoke-ntpdc.texi releng/11.0/contrib/ntp/ntpdc/ntpdc-opts.c releng/11.0/contrib/ntp/ntpdc/ntpdc-opts.h releng/11.0/contrib/ntp/ntpdc/ntpdc.1ntpdcman releng/11.0/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc releng/11.0/contrib/ntp/ntpdc/ntpdc.c releng/11.0/contrib/ntp/ntpdc/ntpdc.html releng/11.0/contrib/ntp/ntpdc/ntpdc.man.in releng/11.0/contrib/ntp/ntpdc/ntpdc.mdoc.in releng/11.0/contrib/ntp/ntpdc/ntpdc_ops.c releng/11.0/contrib/ntp/ntpq/Makefile.am releng/11.0/contrib/ntp/ntpq/Makefile.in releng/11.0/contrib/ntp/ntpq/invoke-ntpq.texi releng/11.0/contrib/ntp/ntpq/libntpq.c releng/11.0/contrib/ntp/ntpq/ntpq-opts.c releng/11.0/contrib/ntp/ntpq/ntpq-opts.h releng/11.0/contrib/ntp/ntpq/ntpq-subs.c releng/11.0/contrib/ntp/ntpq/ntpq.1ntpqman releng/11.0/contrib/ntp/ntpq/ntpq.1ntpqmdoc releng/11.0/contrib/ntp/ntpq/ntpq.c releng/11.0/contrib/ntp/ntpq/ntpq.html releng/11.0/contrib/ntp/ntpq/ntpq.man.in releng/11.0/contrib/ntp/ntpq/ntpq.mdoc.in releng/11.0/contrib/ntp/ntpsnmpd/Makefile.am releng/11.0/contrib/ntp/ntpsnmpd/Makefile.in releng/11.0/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi releng/11.0/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c releng/11.0/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h releng/11.0/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman releng/11.0/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc releng/11.0/contrib/ntp/ntpsnmpd/ntpsnmpd.html releng/11.0/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in releng/11.0/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in releng/11.0/contrib/ntp/packageinfo.sh releng/11.0/contrib/ntp/parseutil/Makefile.am releng/11.0/contrib/ntp/parseutil/Makefile.in releng/11.0/contrib/ntp/scripts/Makefile.in releng/11.0/contrib/ntp/scripts/build/Makefile.in releng/11.0/contrib/ntp/scripts/calc_tickadj/Makefile.in releng/11.0/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman releng/11.0/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc releng/11.0/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html releng/11.0/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in releng/11.0/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in releng/11.0/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi releng/11.0/contrib/ntp/scripts/invoke-plot_summary.texi releng/11.0/contrib/ntp/scripts/invoke-summary.texi releng/11.0/contrib/ntp/scripts/lib/Makefile.in releng/11.0/contrib/ntp/scripts/ntp-wait/Makefile.in releng/11.0/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi releng/11.0/contrib/ntp/scripts/ntp-wait/ntp-wait-opts releng/11.0/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman releng/11.0/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc releng/11.0/contrib/ntp/scripts/ntp-wait/ntp-wait.html releng/11.0/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in releng/11.0/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in releng/11.0/contrib/ntp/scripts/ntpsweep/Makefile.in releng/11.0/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi releng/11.0/contrib/ntp/scripts/ntpsweep/ntpsweep-opts releng/11.0/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman releng/11.0/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc releng/11.0/contrib/ntp/scripts/ntpsweep/ntpsweep.html releng/11.0/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in releng/11.0/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in releng/11.0/contrib/ntp/scripts/ntptrace/Makefile.in releng/11.0/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi releng/11.0/contrib/ntp/scripts/ntptrace/ntptrace-opts releng/11.0/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman releng/11.0/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc releng/11.0/contrib/ntp/scripts/ntptrace/ntptrace.html releng/11.0/contrib/ntp/scripts/ntptrace/ntptrace.man.in releng/11.0/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in releng/11.0/contrib/ntp/scripts/plot_summary-opts releng/11.0/contrib/ntp/scripts/plot_summary.1plot_summaryman releng/11.0/contrib/ntp/scripts/plot_summary.1plot_summarymdoc releng/11.0/contrib/ntp/scripts/plot_summary.html releng/11.0/contrib/ntp/scripts/plot_summary.man.in releng/11.0/contrib/ntp/scripts/plot_summary.mdoc.in releng/11.0/contrib/ntp/scripts/summary-opts releng/11.0/contrib/ntp/scripts/summary.1summaryman releng/11.0/contrib/ntp/scripts/summary.1summarymdoc releng/11.0/contrib/ntp/scripts/summary.html releng/11.0/contrib/ntp/scripts/summary.man.in releng/11.0/contrib/ntp/scripts/summary.mdoc.in releng/11.0/contrib/ntp/scripts/update-leap/Makefile.in releng/11.0/contrib/ntp/scripts/update-leap/invoke-update-leap.texi releng/11.0/contrib/ntp/scripts/update-leap/update-leap-opts releng/11.0/contrib/ntp/scripts/update-leap/update-leap.1update-leapman releng/11.0/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc releng/11.0/contrib/ntp/scripts/update-leap/update-leap.html releng/11.0/contrib/ntp/scripts/update-leap/update-leap.man.in releng/11.0/contrib/ntp/scripts/update-leap/update-leap.mdoc.in releng/11.0/contrib/ntp/sntp/COPYRIGHT releng/11.0/contrib/ntp/sntp/Makefile.am releng/11.0/contrib/ntp/sntp/Makefile.in releng/11.0/contrib/ntp/sntp/aclocal.m4 releng/11.0/contrib/ntp/sntp/config.h.in releng/11.0/contrib/ntp/sntp/configure releng/11.0/contrib/ntp/sntp/configure.ac releng/11.0/contrib/ntp/sntp/crypto.c releng/11.0/contrib/ntp/sntp/include/Makefile.in releng/11.0/contrib/ntp/sntp/include/copyright.def releng/11.0/contrib/ntp/sntp/include/version.def releng/11.0/contrib/ntp/sntp/include/version.texi releng/11.0/contrib/ntp/sntp/invoke-sntp.texi releng/11.0/contrib/ntp/sntp/kod_management.c releng/11.0/contrib/ntp/sntp/libevent/Makefile.am releng/11.0/contrib/ntp/sntp/libevent/Makefile.in releng/11.0/contrib/ntp/sntp/libevent/build-aux/compile releng/11.0/contrib/ntp/sntp/libevent/build-aux/config.guess releng/11.0/contrib/ntp/sntp/libevent/build-aux/config.sub releng/11.0/contrib/ntp/sntp/libevent/build-aux/depcomp releng/11.0/contrib/ntp/sntp/libevent/build-aux/install-sh releng/11.0/contrib/ntp/sntp/libevent/build-aux/ltmain.sh releng/11.0/contrib/ntp/sntp/libevent/build-aux/missing releng/11.0/contrib/ntp/sntp/libevent/build-aux/ylwrap releng/11.0/contrib/ntp/sntp/libevent/config.h.in releng/11.0/contrib/ntp/sntp/libevent/configure releng/11.0/contrib/ntp/sntp/libevent/configure.ac releng/11.0/contrib/ntp/sntp/libevent/m4/libtool.m4 releng/11.0/contrib/ntp/sntp/libevent/m4/ltoptions.m4 releng/11.0/contrib/ntp/sntp/libevent/m4/ltsugar.m4 releng/11.0/contrib/ntp/sntp/libevent/m4/ltversion.m4 releng/11.0/contrib/ntp/sntp/libevent/m4/lt~obsolete.m4 releng/11.0/contrib/ntp/sntp/libevent/test/regress_ssl.c releng/11.0/contrib/ntp/sntp/libopts/Makefile.am releng/11.0/contrib/ntp/sntp/libopts/Makefile.in releng/11.0/contrib/ntp/sntp/m4/libtool.m4 releng/11.0/contrib/ntp/sntp/m4/ltoptions.m4 releng/11.0/contrib/ntp/sntp/m4/ltsugar.m4 releng/11.0/contrib/ntp/sntp/m4/ltversion.m4 releng/11.0/contrib/ntp/sntp/m4/lt~obsolete.m4 releng/11.0/contrib/ntp/sntp/m4/ntp_compiler.m4 releng/11.0/contrib/ntp/sntp/m4/ntp_libevent.m4 releng/11.0/contrib/ntp/sntp/m4/ntp_libntp.m4 releng/11.0/contrib/ntp/sntp/m4/ntp_openssl.m4 releng/11.0/contrib/ntp/sntp/m4/ntp_prog_cc.m4 releng/11.0/contrib/ntp/sntp/m4/version.m4 releng/11.0/contrib/ntp/sntp/scm-rev releng/11.0/contrib/ntp/sntp/scripts/Makefile.am releng/11.0/contrib/ntp/sntp/scripts/Makefile.in releng/11.0/contrib/ntp/sntp/sntp-opts.c releng/11.0/contrib/ntp/sntp/sntp-opts.h releng/11.0/contrib/ntp/sntp/sntp.1sntpman releng/11.0/contrib/ntp/sntp/sntp.1sntpmdoc releng/11.0/contrib/ntp/sntp/sntp.html releng/11.0/contrib/ntp/sntp/sntp.man.in releng/11.0/contrib/ntp/sntp/sntp.mdoc.in releng/11.0/contrib/ntp/sntp/tests/Makefile.am releng/11.0/contrib/ntp/sntp/tests/Makefile.in releng/11.0/contrib/ntp/sntp/unity/Makefile.am releng/11.0/contrib/ntp/sntp/unity/Makefile.in releng/11.0/contrib/ntp/sntp/version.c releng/11.0/contrib/ntp/util/Makefile.am releng/11.0/contrib/ntp/util/Makefile.in releng/11.0/contrib/ntp/util/invoke-ntp-keygen.texi releng/11.0/contrib/ntp/util/ntp-keygen-opts.c releng/11.0/contrib/ntp/util/ntp-keygen-opts.h releng/11.0/contrib/ntp/util/ntp-keygen.1ntp-keygenman releng/11.0/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc releng/11.0/contrib/ntp/util/ntp-keygen.c releng/11.0/contrib/ntp/util/ntp-keygen.html releng/11.0/contrib/ntp/util/ntp-keygen.man.in releng/11.0/contrib/ntp/util/ntp-keygen.mdoc.in releng/11.0/sys/conf/newvers.sh releng/11.0/sys/dev/xen/blkfront/blkfront.c releng/11.0/sys/dev/xen/control/control.c releng/11.0/sys/dev/xen/netfront/netfront.c releng/11.0/sys/dev/xen/timer/timer.c releng/11.0/sys/dev/xen/xenstore/xenstore.c releng/11.0/sys/xen/xen-os.h releng/11.0/sys/xen/xenbus/xenbusb.c releng/11.0/sys/xen/xenstore/xenstorevar.h releng/11.0/usr.sbin/ntp/config.h releng/11.0/usr.sbin/ntp/doc/ntp-keygen.8 releng/11.0/usr.sbin/ntp/doc/ntp.conf.5 releng/11.0/usr.sbin/ntp/doc/ntp.keys.5 releng/11.0/usr.sbin/ntp/doc/ntpd.8 releng/11.0/usr.sbin/ntp/doc/ntpdc.8 releng/11.0/usr.sbin/ntp/doc/ntpq.8 releng/11.0/usr.sbin/ntp/doc/sntp.8 releng/11.0/usr.sbin/ntp/scripts/mkver Modified: releng/10.3/UPDATING ============================================================================== --- releng/10.3/UPDATING Wed Apr 12 01:15:33 2017 (r316721) +++ releng/10.3/UPDATING Wed Apr 12 06:24:35 2017 (r316722) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20170412 p18 FreeBSD-SA-17:03.ntp + FreeBSD-EN-17:05.xen + + Fix multiple vulnerabilities of ntp. [SA-17:03] + + Xen migration enhancements. [EN-17:05] + 20170223 p17 FreeBSD-SA-17:02.openssl Fix OpenSSL RC4_MD5 cipher vulnerability. Modified: releng/10.3/contrib/ntp/COPYRIGHT ============================================================================== --- releng/10.3/contrib/ntp/COPYRIGHT Wed Apr 12 01:15:33 2017 (r316721) +++ releng/10.3/contrib/ntp/COPYRIGHT Wed Apr 12 06:24:35 2017 (r316722) @@ -4,7 +4,7 @@ This file is automatically generated fro jpg "Clone me," says Dolly sheepishly. - Last update: 17-Jan-2015 00:16 UTC + Last update: 2-Jan-2017 11:58 UTC _________________________________________________________________ The following copyright notice applies to all files collectively @@ -33,7 +33,7 @@ This file is automatically generated fro Burnicki is: *********************************************************************** * * -* Copyright (c) Network Time Foundation 2011-2015 * +* Copyright (c) Network Time Foundation 2011-2017 * * * * All Rights Reserved * * * Modified: releng/10.3/contrib/ntp/ChangeLog ============================================================================== --- releng/10.3/contrib/ntp/ChangeLog Wed Apr 12 01:15:33 2017 (r316721) +++ releng/10.3/contrib/ntp/ChangeLog Wed Apr 12 06:24:35 2017 (r316722) @@ -1,6 +1,77 @@ --- +(4.2.8p10-win-beta1) 2017/03/21 Released by Harlan Stenn +(4.2.8p10) + +* [Sec 3389] NTP-01-016: Denial of Service via Malformed Config + (Pentest report 01.2017) +* [Sec 3388] NTP-01-014: Buffer Overflow in DPTS Clock + (Pentest report 01.2017) +* [Sec 3387] NTP-01-012: Authenticated DoS via Malicious Config Option + (Pentest report 01.2017) +* [Sec 3386] NTP-01-011: ntpq_stripquotes() returns incorrect Value + (Pentest report 01.2017) +* [Sec 3385] NTP-01-010: ereallocarray()/eallocarray() underused. HStenn +* [Sec 3384] NTP-01-009: Privileged execution of User Library code + (Pentest report 01.2017) +* [Sec 3383] NTP-01-008: Stack Buffer Overflow from Command Line + (Pentest report 01.2017) +* [Sec 3382] NTP-01-007: Data Structure terminated insufficiently + (Pentest report 01.2017) +* [Sec 3380] NTP-01-005: Off-by-one in Oncore GPS Receiver + (Pentest report 01.2017) +* [Sec 3379] NTP-01-004: Potential Overflows in ctl_put() functions + (Pentest report 01.2017) +* [Sec 3378] NTP-01-003: Improper use of snprintf() in mx4200_send() + (Pentest report 01.2017) +* [Sec 3377] NTP-01-002: Buffer Overflow in ntpq when fetching reslist + (Pentest report 01.2017) +* [Bug 3363] Support for openssl-1.1.0 without compatibility modes + - rework of patch set from . +* [Bug 3356] Bugfix 3072 breaks multicastclient +* [Bug 3216] libntp audio ioctl() args incorrectly cast to int + on 4.4BSD-Lite derived platforms + - original patch by Majdi S. Abbas +* [Bug 3215] 'make distcheck' fails with new BK repo format +* [Bug 3173] forking async worker: interrupted pipe I/O + - initial patch by Christos Zoulas +* [Bug 3139] (...) time_pps_create: Exec format error + - move loader API from 'inline' to proper source + - augment pathless dlls with absolute path to NTPD + - use 'msyslog()' instead of 'printf() 'for reporting trouble +* [Bug 3107] Incorrect Logic for Peer Event Limiting + - applied patch by Matthew Van Gundy +* [Bug 3065] Quiet warnings on NetBSD + - applied some of the patches provided by Havard. Not all of them + still match the current code base, and I did not touch libopt. +* [Bug 3062] Change the process name of forked DNS worker + - applied patch by Reinhard Max. See bugzilla for limitations. +* [Bug 2923] Trap Configuration Fail + - fixed dependency inversion from [Bug 2837] +* [Bug 2896] Nothing happens if minsane < maxclock < minclock + - produce ERROR log message about dysfunctional daemon. +* [Bug 2851] allow -4/-6 on restrict line with mask + - applied patch by Miroslav Lichvar for ntp4.2.6 compat +* [Bug 2645] out-of-bound pointers in ctl_putsys and decode_bitflags + - Fixed these and some more locations of this pattern. + Probably din't get them all, though. +* Update copyright year. +* bk-7 trigger updates + +--- +(4.2.8p9-win) 2017/02/01 Released by Harlan Stenn + +* [Bug 3144] NTP does not build without openSSL. + - added missed changeset for automatic openssl lib detection + - fixed some minor warning issues +* [Bug 3095] More compatibility with openssl 1.1. +* configure.ac cleanup. stenn@ntp.org +* openssl configure cleanup. stenn@ntp.org + +--- (4.2.8p9) 2016/11/21 Released by Harlan Stenn -(4.2.8p9) 2016/MM/DD Released by Harlan Stenn * [Sec 3119] Trap crash * [Sec 3118] Mode 6 information disclosure and DDoS vector Modified: releng/10.3/contrib/ntp/CommitLog ============================================================================== --- releng/10.3/contrib/ntp/CommitLog Wed Apr 12 01:15:33 2017 (r316721) +++ releng/10.3/contrib/ntp/CommitLog Wed Apr 12 06:24:35 2017 (r316722) @@ -1,3 +1,441 @@ +ChangeSet@1.3729, 2017-02-01 07:39:35-05:00, stenn@deacon.udel.edu + NTP_4_2_8P9_WIN + TAG: NTP_4_2_8P9_WIN + + ChangeLog@1.1857 +3 -0 + NTP_4_2_8P9_WIN + + ntpd/invoke-ntp.conf.texi@1.204 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/invoke-ntp.keys.texi@1.193 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/invoke-ntpd.texi@1.509 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.5man@1.238 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.5mdoc@1.238 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.html@1.188 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.man.in@1.238 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntp.conf.mdoc.in@1.238 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.5man@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.5mdoc@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.html@1.189 +1 -1 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.man.in@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntp.keys.mdoc.in@1.227 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntpd-opts.c@1.531 +245 -245 + NTP_4_2_8P9_WIN + + ntpd/ntpd-opts.h@1.530 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntpd.1ntpdman@1.338 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntpd.1ntpdmdoc@1.338 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntpd.html@1.182 +2 -2 + NTP_4_2_8P9_WIN + + ntpd/ntpd.man.in@1.338 +3 -3 + NTP_4_2_8P9_WIN + + ntpd/ntpd.mdoc.in@1.338 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/invoke-ntpdc.texi@1.506 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc-opts.c@1.524 +107 -107 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc-opts.h@1.523 +3 -3 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.1ntpdcman@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.1ntpdcmdoc@1.337 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.html@1.350 +2 -2 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.man.in@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpdc/ntpdc.mdoc.in@1.337 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/invoke-ntpq.texi@1.514 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/ntpq-opts.c@1.531 +114 -114 + NTP_4_2_8P9_WIN + + ntpq/ntpq-opts.h@1.529 +3 -3 + NTP_4_2_8P9_WIN + + ntpq/ntpq.1ntpqman@1.342 +3 -3 + NTP_4_2_8P9_WIN + + ntpq/ntpq.1ntpqmdoc@1.342 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/ntpq.html@1.179 +2 -2 + NTP_4_2_8P9_WIN + + ntpq/ntpq.man.in@1.342 +3 -3 + NTP_4_2_8P9_WIN + + ntpq/ntpq.mdoc.in@1.342 +2 -2 + NTP_4_2_8P9_WIN + + ntpsnmpd/invoke-ntpsnmpd.texi@1.508 +11 -10 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd-opts.c@1.526 +68 -68 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd-opts.h@1.525 +3 -3 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.337 +2 -2 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.html@1.177 +1 -1 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.man.in@1.337 +3 -3 + NTP_4_2_8P9_WIN + + ntpsnmpd/ntpsnmpd.mdoc.in@1.337 +2 -2 + NTP_4_2_8P9_WIN + + packageinfo.sh@1.534 +1 -1 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.98 +3 -3 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.99 +2 -2 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.html@1.100 +1 -1 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.man.in@1.97 +3 -3 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.99 +2 -2 + NTP_4_2_8P9_WIN + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.102 +1 -1 + NTP_4_2_8P9_WIN + + scripts/invoke-plot_summary.texi@1.120 +2 -2 + NTP_4_2_8P9_WIN + + scripts/invoke-summary.texi@1.119 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/invoke-ntp-wait.texi@1.329 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait-opts@1.65 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.326 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.327 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.html@1.346 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.man.in@1.326 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntp-wait/ntp-wait.mdoc.in@1.327 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/invoke-ntpsweep.texi@1.117 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep-opts@1.67 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.105 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.html@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.man.in@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntpsweep/ntpsweep.mdoc.in@1.106 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/invoke-ntptrace.texi@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace-opts@1.67 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.1ntptraceman@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.106 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.html@1.119 +2 -2 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.man.in@1.105 +3 -3 + NTP_4_2_8P9_WIN + + scripts/ntptrace/ntptrace.mdoc.in@1.107 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary-opts@1.68 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary.1plot_summaryman@1.118 +3 -3 + NTP_4_2_8P9_WIN + + scripts/plot_summary.1plot_summarymdoc@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary.html@1.121 +2 -2 + NTP_4_2_8P9_WIN + + scripts/plot_summary.man.in@1.118 +3 -3 + NTP_4_2_8P9_WIN + + scripts/plot_summary.mdoc.in@1.118 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary-opts@1.67 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary.1summaryman@1.117 +3 -3 + NTP_4_2_8P9_WIN + + scripts/summary.1summarymdoc@1.117 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary.html@1.120 +2 -2 + NTP_4_2_8P9_WIN + + scripts/summary.man.in@1.117 +3 -3 + NTP_4_2_8P9_WIN + + scripts/summary.mdoc.in@1.117 +2 -2 + NTP_4_2_8P9_WIN + + scripts/update-leap/invoke-update-leap.texi@1.18 +1 -1 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap-opts@1.18 +2 -2 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.1update-leapman@1.18 +3 -3 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.1update-leapmdoc@1.18 +2 -2 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.html@1.18 +1 -1 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.man.in@1.18 +3 -3 + NTP_4_2_8P9_WIN + + scripts/update-leap/update-leap.mdoc.in@1.18 +2 -2 + NTP_4_2_8P9_WIN + + sntp/invoke-sntp.texi@1.506 +2 -2 + NTP_4_2_8P9_WIN + + sntp/sntp-opts.c@1.525 +159 -159 + NTP_4_2_8P9_WIN + + sntp/sntp-opts.h@1.523 +3 -3 + NTP_4_2_8P9_WIN + + sntp/sntp.1sntpman@1.341 +3 -3 + NTP_4_2_8P9_WIN + + sntp/sntp.1sntpmdoc@1.341 +2 -2 + NTP_4_2_8P9_WIN + + sntp/sntp.html@1.521 +2 -2 + NTP_4_2_8P9_WIN + + sntp/sntp.man.in@1.341 +3 -3 + NTP_4_2_8P9_WIN + + sntp/sntp.mdoc.in@1.341 +2 -2 + NTP_4_2_8P9_WIN + + util/invoke-ntp-keygen.texi@1.509 +2 -2 + NTP_4_2_8P9_WIN + + util/ntp-keygen-opts.c@1.527 +173 -173 + NTP_4_2_8P9_WIN + + util/ntp-keygen-opts.h@1.525 +3 -3 + NTP_4_2_8P9_WIN + + util/ntp-keygen.1ntp-keygenman@1.337 +3 -3 + NTP_4_2_8P9_WIN + + util/ntp-keygen.1ntp-keygenmdoc@1.337 +2 -2 + NTP_4_2_8P9_WIN + + util/ntp-keygen.html@1.183 +2 -2 + NTP_4_2_8P9_WIN + + util/ntp-keygen.man.in@1.337 +3 -3 + NTP_4_2_8P9_WIN + + util/ntp-keygen.mdoc.in@1.337 +2 -2 + NTP_4_2_8P9_WIN + +ChangeSet@1.3728, 2017-01-28 09:32:36-05:00, stenn@pogo.udel.edu + typos + + sntp/m4/ntp_openssl.m4@1.26 +13 -13 + typos + +ChangeSet@1.3726, 2017-01-27 11:21:38+00:00, stenn@psp-deb1.ntp.org + ntp-4.2.8p9-win + + ChangeLog@1.1855 +4 -1 + ntp-4.2.8p9-win + + packageinfo.sh@1.533 +1 -1 + ntp-4.2.8p9-win + +ChangeSet@1.3725, 2017-01-27 11:09:20+00:00, stenn@psp-deb1.ntp.org + bk-7 repos don't have a ChangeSet file + + sntp/Makefile.am@1.89 +1 -1 + bk-7 repos don't have a ChangeSet file + +ChangeSet@1.3724, 2017-01-21 15:12:35+01:00, perlinger@ntp.org + [Bug 3144] NTP does not build without openSSL + - pulled missing changeset, minor warning fixes + + ChangeLog@1.1854 +2 -1 + [Bug 3144] NTP does not build without openSSL + - pulled missing changeset, minor warning fixes + + include/ssl_applink.c@1.3 +9 -1 + [Bug 3144] NTP does not build without openSSL + - minor warning fixes + + ports/winnt/ntpd/ntservice.c@1.31 +1 -0 + [Bug 3144] NTP does not build without openSSL + - pulled missing changeset, minor warning fixes + +ChangeSet@1.3720.1.2, 2017-01-10 06:07:05-05:00, stenn@pogo.udel.edu + configure.ac cleanup + + ChangeLog@1.1852.1.1 +5 -0 + configure.ac cleanup + + configure.ac@1.607 +1 -1 + configure.ac cleanup + +ChangeSet@1.3720.1.1, 2017-01-10 06:05:44-05:00, stenn@pogo.udel.edu + openssl configure cleanup + + sntp/m4/ntp_libntp.m4@1.34 +1 -3 + openssl configure cleanup + + sntp/m4/ntp_openssl.m4@1.25 +19 -1 + openssl configure cleanup + +ChangeSet@1.3722, 2016-11-23 08:34:52+01:00, perlinger@ntp.org + Bug 3144 - NTP does not build without openSSL + - fix SNTP to build '--without-crypto',too + - remove some warnings that result from '--without-crypto' + + ntpd/ntp_control.c@1.215 +4 -1 + Bug 3144 - NTP does not build without openSSL + - remove some warnings that result from '--without-crypto' + + ntpd/ntp_proto.c@1.398 +1 -1 + Bug 3144 - NTP does not build without openSSL + - remove some warnings that result from '--without-crypto' + + sntp/crypto.c@1.24 +1 -1 + Bug 3144 - NTP does not build without openSSL + - fix SNTP to build '--without-crypto', too + +ChangeSet@1.3721, 2016-11-22 22:22:46+01:00, perlinger@ntp.org + [Bug 3144] NTP does not build without openSSL + + ChangeLog@1.1853 +3 -1 + [Bug 3144] NTP does not build without openSSL + + include/ntp_md5.h@1.11 +4 -0 + [Bug 3144] NTP does not build without openSSL + - pull in "libssl_compat.h" if built with openssl + - provide compliant API otherwise + + libntp/a_md5encrypt.c@1.40 +0 -1 + [Bug 3144] NTP does not build without openSSL + - do not directly include "libssl_compat.h" -- comes with "ntp_md5.h" + + libntp/libssl_compat.c@1.2.1.1 +10 -7 + [Bug 3144] NTP does not build without openSSL + - compiles code only if openssl is indeed required + + ntpd/ntp_control.c@1.214 +1 -3 + [Bug 3144] NTP does not build without openSSL + - do not directly include "libssl_compat.h" -- comes with "ntp_md5.h" + - fix long-standing warning + + ntpd/ntp_io.c@1.418 +9 -5 + [Bug 3144] NTP does not build without openSSL + - sidekick: Fix annoying warnings for Debug Build (Win64/32 issue) + + ports/winnt/ntpd/ntp_iocompletionport.c@1.78 +4 -6 + [Bug 3144] NTP does not build without openSSL + - sidekick: Fix annoying warnings MSVC emits + ChangeSet@1.3720, 2016-11-21 08:08:21-05:00, stenn@deacon.udel.edu NTP_4_2_8P9 TAG: NTP_4_2_8P9 @@ -557,7 +995,6 @@ ChangeSet@1.3701, 2016-10-24 07:37:25+02 [winio2 - unlocked] - eliminate critical section, simplify API - the great renaming - ChangeSet@1.3698.1.7, 2016-10-23 05:18:04+00:00, stenn@psp-deb1.ntp.org ntp-4.2.8p9-PRE @@ -889,7 +1326,7 @@ ChangeSet@1.3698.1.7, 2016-10-23 05:18:0 util/ntp-keygen.mdoc.in@1.335 +2 -2 ntp-4.2.8p9-PRE -ChangeSet@1.3688.4.1, 2016-10-20 19:28:06+00:00, stenn@psp-deb1.ntp.org +ChangeSet@1.3688.5.1, 2016-10-20 19:28:06+00:00, stenn@psp-deb1.ntp.org cleanup ChangeLog@1.1836.4.1 +1 -0 @@ -910,7 +1347,6 @@ ChangeSet@1.3686.19.1, 2016-10-20 09:21: ChangeLog@1.1834.19.1 +4 -0 [Sec 3113] Broadcast Mode Poll Interval Enforcement DoS - include/ntp.h@1.220.1.1 +1 -1 [Sec 3113] Broadcast Mode Poll Interval Enforcement DoS @@ -953,7 +1389,7 @@ ChangeSet@1.3698.1.2, 2016-10-10 22:34:5 tests/bug-3102/zeroorg.py@1.0 +0 -0 -ChangeSet@1.3688.3.2, 2016-10-10 01:46:05-07:00, harlan@max.pfcs.com +ChangeSet@1.3688.4.1, 2016-10-10 01:46:05-07:00, harlan@max.pfcs.com Fix typos in include/ntp.h ChangeLog@1.1836.3.1 +1 -0 @@ -989,6 +1425,89 @@ ChangeSet@1.3699, 2016-10-04 08:36:17+02 [Bug 3125] NTPD doesn't fully start when ntp.conf entries are out of order using the loopback-ppsapi-provider.dll - fix wrong instance initialisation +ChangeSet@1.3688.3.2, 2016-10-02 09:01:53+02:00, perlinger@ntp.org + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + - fix linker input selection + + include/ssl_applink.c@1.2 +15 -3 + [Bug 3095] Compatibility with openssl 1.1 + - the graet renaming of v1.1.0 + + libntp/libssl_compat.c@1.3 +4 -0 + [Bug 3095] Compatibility with openssl 1.1 + - make sure 'inttypes.h' is included before SSL headers (macro definitiion order) + + ports/winnt/include/msvc_ssl_autolib.h@1.1 +94 -0 + [Bug 3095] Compatibility with openssl 1.1 + create automagic library selection header + + ports/winnt/include/msvc_ssl_autolib.h@1.0 +0 -0 + + ports/winnt/vs2008/debug-x64.vsprops@1.2 +2 -2 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2008/debug.vsprops@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2008/release-x64.vsprops@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2008/release.vsprops@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/debug-x64.props@1.3 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/debug.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/libntp/libntp.vcxproj@1.13 +2 -1 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.11 +3 -0 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2013/release-x64.props@1.3 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2013/release.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/debug-x64.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/debug.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/libntp/libntp.vcxproj@1.3 +1 -0 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2015/libntp/libntp.vcxproj.filters@1.3 +3 -0 + [Bug 3095] Compatibility with openssl 1.1 + - add autolib hader + + ports/winnt/vs2015/release-x64.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + + ports/winnt/vs2015/release.props@1.2 +1 -1 + [Bug 3095] Compatibility with openssl 1.1 + - fix linker input selection + ChangeSet@1.3698, 2016-10-01 10:52:11+00:00, stenn@psp-deb1.ntp.org Update NEWS for 3119 @@ -8089,31 +8608,24 @@ ChangeSet@1.3552.1.13, 2015-08-20 10:15: sntp/libevent/test/bench_httpclient.c@1.8 +5 -1 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress.c@1.8 +6 -2 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress_dns.c@1.10 +6 -5 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress_http.c@1.10 +8 -4 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/regress_minheap.c@1.5 +2 -1 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/test-ratelim.c@1.11 +6 -2 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - sntp/libevent/test/test-time.c@1.7 +2 -1 reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here. - ChangeSet@1.3552.1.12, 2015-08-20 01:10:57+02:00, viperus@ubuntu.(none) Makefile.am: @@ -8151,67 +8663,51 @@ ChangeSet@1.3552.1.10, 2015-08-20 00:23: ntpd/refclock_palisade.c@1.43 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - ntpq/ntpq.c@1.161 +7 -7 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/sample/http-server.c@1.11 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/bench_httpclient.c@1.7 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress.c@1.7 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress_dns.c@1.9 +4 -4 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress_http.c@1.9 +3 -3 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/regress_minheap.c@1.4 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/test-ratelim.c@1.10 +2 -2 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libevent/test/test-time.c@1.6 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/libopts/compat/pathfind.c@1.12 +5 -5 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/tests/fileHandlingTest.c@1.3 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - sntp/tests/packetProcessing.c@1.8 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - tests/libntp/a_md5encrypt.c@1.12 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - tests/libntp/calendar.c@1.6.1.1 +4 -4 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - tests/libntp/caljulian.c@1.10 +1 -1 Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc. - ChangeSet@1.3552.1.9, 2015-08-17 13:56:23+02:00, viperus@ubuntu.(none) Makefile.am: @@ -8595,7 +9091,6 @@ ChangeSet@1.3548.1.13, 2015-08-06 20:41: tests/libntp/socktoa.c@1.9 +2 -2 fixed. Tests are skipped when you do ./build --disable-ipv6 - tests/ntpq/Makefile.am@1.2 +8 -37 changes @@ -8636,7 +9131,6 @@ ChangeSet@1.3548.1.11, 2015-08-06 10:27: tests/libntp/run-socktoa.c@1.11 +7 -7 Minor changes due to the autogenerated ruby script - tests/libntp/socktoa.c@1.8 +22 -6 update @@ -8811,8 +9305,6 @@ ChangeSet@1.3548.1.2, 2015-08-01 22:40:5 Added test ntp_singd again, renamed it to ntp_signdT (including the original ntp_signd.c doesn't work if you have 2 files with the same name). I included the original ntp_signd.c, so static functions can be tested. Additional .o objects had to be added for everyhting to work. - - tests/ntpd/ntp_signdT.c@1.2 +17 -2 MUST ADD #define HAVE_NTP_NAME above the #include "ntp_NAME.c" @@ -8918,15 +9410,12 @@ ChangeSet@1.3529.1.18, 2015-07-27 19:46: tests/libntp/run-lfptostr.c@1.6 +11 -11 update - tests/libntp/run-netof.c@1.6 +0 -1 update - tests/libntp/run-socktoa.c@1.9 +6 -6 update - tests/ntpd/Makefile.am@1.6.1.4 +8 -3 Merge @@ -8942,11 +9431,9 @@ ChangeSet@1.3529.1.18, 2015-07-27 19:46: tests/ntpd/run-ntp_signd.c@1.3 +2 -2 update - tests/ntpd/run-rc_cmdlength.c@1.2 +8 -3 update - ChangeSet@1.3543, 2015-07-27 04:11:08+00:00, stenn@psp-at1.ntp.org [Bug 2595] ntpdate man page quirks. Hal Murray, Harlan Stenn @@ -9192,165 +9679,126 @@ ChangeSet@1.3529.1.10, 2015-07-25 16:54: tests/libntp/netof.c@1.3.1.1 +8 -0 adding declarations - tests/libntp/numtoa.c@1.6 +2 -0 adding declarations - tests/libntp/numtohost.c@1.5 +2 -0 adding declarations - tests/libntp/octtoint.c@1.3.1.1 +10 -0 adding declarations - tests/libntp/prettydate.c@1.3 +3 -0 adding declarations - tests/libntp/recvbuff.c@1.5 +4 -0 adding declarations - tests/libntp/refidsmear.c@1.5 +6 -3 adding declarations - tests/libntp/refnumtoa.c@1.5 +4 -0 adding declarations - tests/libntp/run-clocktime.c@1.9 +1 -1 update tests/libntp/run-lfpfunc.c@1.16 +9 -9 update - tests/libntp/run-netof.c@1.5 +4 -4 update - tests/libntp/run-numtoa.c@1.9 +2 -2 update - tests/libntp/run-numtohost.c@1.9 +1 -1 update - tests/libntp/run-octtoint.c@1.6 +7 -7 update - tests/libntp/run-prettydate.c@1.4 +1 -1 update - tests/libntp/run-recvbuff.c@1.4 +3 -3 update - tests/libntp/run-refidsmear.c@1.5 +1 -1 update - tests/libntp/run-refnumtoa.c@1.7 +2 -2 update - tests/libntp/run-sfptostr.c@1.4 +7 -7 update - tests/libntp/run-socktoa.c@1.8 +6 -6 update - tests/libntp/run-ssl_init.c@1.8 +5 -5 update - tests/libntp/run-statestr.c@1.9 +4 -4 update - tests/libntp/run-strtolfp.c@1.4 +6 -6 update - tests/libntp/run-timespecops.c@1.9 +28 -28 update - tests/libntp/run-timevalops.c@1.11 +28 -28 update - tests/libntp/run-tstotv.c@1.4 +3 -3 update - tests/libntp/run-tvtots.c@1.5 +3 -3 update - tests/libntp/run-vi64ops.c@1.7 +3 -3 update - tests/libntp/run-ymd2yd.c@1.10 +4 -4 update - tests/libntp/sfptostr.c@1.3 +10 -0 update - tests/libntp/sockaddrtest.c@1.2 +1 -0 update - tests/libntp/socktoa.c@1.3.1.1 +6 -0 added declarations tests/libntp/ssl_init.c@1.8 +6 -0 added declarations - tests/libntp/statestr.c@1.5 +4 -0 added declarations - tests/libntp/strtolfp.c@1.2.1.1 +9 -0 added declarations - tests/libntp/timespecops.c@1.8 +40 -1 added declarations - tests/libntp/timevalops.c@1.11 +37 -1 added declarations - tests/libntp/tstotv.c@1.3 +5 -0 added declarations - tests/libntp/tvtots.c@1.5 +3 -0 added declarations - tests/libntp/vi64ops.c@1.6 +6 -0 added declarations - tests/libntp/ymd2yd.c@1.6 +5 -0 added declarations *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 12 07:21:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C8FAD3A50A; Wed, 12 Apr 2017 07:21:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 420A5B02; Wed, 12 Apr 2017 07:21:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3C7Lt7C098197; Wed, 12 Apr 2017 07:21:55 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3C7LtcR098194; Wed, 12 Apr 2017 07:21:55 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201704120721.v3C7LtcR098194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 12 Apr 2017 07:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316723 - in head/sys/dev/rtwn: rtl8188e rtl8192c rtl8812a X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 07:21:56 -0000 Author: avos Date: Wed Apr 12 07:21:54 2017 New Revision: 316723 URL: https://svnweb.freebsd.org/changeset/base/316723 Log: rtwn: remove out-of-bounds access + fix debug output. Omit unused rates while initializing / dumping Tx power values. They were not accessed anywhere (except for debugging), so this is (mostly) no-op. Tested with * RTL8188EU, STA mode. * RTL8812AU, STA mode. Found by: PVS-Studio Modified: head/sys/dev/rtwn/rtl8188e/r88e_chan.c head/sys/dev/rtwn/rtl8192c/r92c_chan.c head/sys/dev/rtwn/rtl8812a/r12a_chan.c Modified: head/sys/dev/rtwn/rtl8188e/r88e_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_chan.c Wed Apr 12 06:24:35 2017 (r316722) +++ head/sys/dev/rtwn/rtl8188e/r88e_chan.c Wed Apr 12 07:21:54 2017 (r316723) @@ -110,7 +110,7 @@ r88e_get_txpower(struct rtwn_softc *sc, for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++) power[ridx] = base->pwr[0][ridx]; } - for (ridx = RTWN_RIDX_OFDM6; ridx < RTWN_RIDX_COUNT; ridx++) { + for (ridx = RTWN_RIDX_OFDM6; ridx <= max_mcs; ridx++) { if (rs->regulatory == 3) power[ridx] = base->pwr[0][ridx]; else if (rs->regulatory == 1) { Modified: head/sys/dev/rtwn/rtl8192c/r92c_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_chan.c Wed Apr 12 06:24:35 2017 (r316722) +++ head/sys/dev/rtwn/rtl8192c/r92c_chan.c Wed Apr 12 07:21:54 2017 (r316723) @@ -229,13 +229,13 @@ r92c_set_txpower(struct rtwn_softc *sc, rtwn_r92c_get_txpower(sc, i, c, power); #ifdef RTWN_DEBUG if (sc->sc_debug & RTWN_DEBUG_TXPWR) { - int ridx; + int max_mcs, ridx; + + max_mcs = RTWN_RIDX_MCS(sc->ntxchains * 8 - 1); /* Dump per-rate Tx power values. */ printf("Tx power for chain %d:\n", i); - for (ridx = RTWN_RIDX_CCK1; - ridx < RTWN_RIDX_COUNT; - ridx++) + for (ridx = RTWN_RIDX_CCK1; ridx <= max_mcs; ridx++) printf("Rate %d = %u\n", ridx, power[ridx]); } #endif Modified: head/sys/dev/rtwn/rtl8812a/r12a_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_chan.c Wed Apr 12 06:24:35 2017 (r316722) +++ head/sys/dev/rtwn/rtl8812a/r12a_chan.c Wed Apr 12 07:21:54 2017 (r316723) @@ -247,7 +247,7 @@ r12a_get_txpower(struct rtwn_softc *sc, if (sc->sc_debug & RTWN_DEBUG_TXPWR) { /* Dump per-rate Tx power values. */ printf("Tx power for chain %d:\n", chain); - for (ridx = RTWN_RIDX_CCK1; ridx < RTWN_RIDX_COUNT; ridx++) + for (ridx = RTWN_RIDX_CCK1; ridx <= max_mcs; ridx++) printf("Rate %d = %u\n", ridx, power[ridx]); } #endif From owner-svn-src-all@freebsd.org Wed Apr 12 09:11:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E530D372E6; Wed, 12 Apr 2017 09:11:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E63CEF4; Wed, 12 Apr 2017 09:11:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3C9BG2s042394; Wed, 12 Apr 2017 09:11:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3C9BGPi042393; Wed, 12 Apr 2017 09:11:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704120911.v3C9BGPi042393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 12 Apr 2017 09:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316724 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 09:11:17 -0000 Author: kib Date: Wed Apr 12 09:11:16 2017 New Revision: 316724 URL: https://svnweb.freebsd.org/changeset/base/316724 Log: MFC r316524: Use int instead of boolean_t for flags argument type in vnode_pager_generic_putpages() prototype; change the argument name to reflect that it is flags. Modified: stable/11/sys/vm/vnode_pager.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vnode_pager.h ============================================================================== --- stable/11/sys/vm/vnode_pager.h Wed Apr 12 07:21:54 2017 (r316723) +++ stable/11/sys/vm/vnode_pager.h Wed Apr 12 09:11:16 2017 (r316724) @@ -44,8 +44,7 @@ int vnode_pager_generic_getpages(struct int count, int *rbehind, int *rahead, vop_getpages_iodone_t iodone, void *arg); int vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *m, - int count, boolean_t sync, - int *rtvals); + int count, int flags, int *rtvals); int vnode_pager_local_getpages(struct vop_getpages_args *ap); int vnode_pager_local_getpages_async(struct vop_getpages_async_args *ap); From owner-svn-src-all@freebsd.org Wed Apr 12 09:13:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B823D37504; Wed, 12 Apr 2017 09:13:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD082211; Wed, 12 Apr 2017 09:13:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3C9Dd4B045786; Wed, 12 Apr 2017 09:13:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3C9Dd4n045785; Wed, 12 Apr 2017 09:13:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704120913.v3C9Dd4n045785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 12 Apr 2017 09:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316725 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 09:13:40 -0000 Author: kib Date: Wed Apr 12 09:13:38 2017 New Revision: 316725 URL: https://svnweb.freebsd.org/changeset/base/316725 Log: MFC r316525: Some style fixes for vnode_pager_generic_putpages(), in the local declaration block. Modified: stable/11/sys/vm/vnode_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vnode_pager.c ============================================================================== --- stable/11/sys/vm/vnode_pager.c Wed Apr 12 09:11:16 2017 (r316724) +++ stable/11/sys/vm/vnode_pager.c Wed Apr 12 09:13:38 2017 (r316725) @@ -1159,18 +1159,12 @@ int vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *ma, int bytecount, int flags, int *rtvals) { - int i; vm_object_t object; vm_page_t m; - int count; - - int maxsize, ncount; vm_ooffset_t poffset; struct uio auio; struct iovec aiov; - int error; - int ioflags; - int ppscheck = 0; + int count, error, i, ioflags, maxsize, ncount, ppscheck; static struct timeval lastfail; static int curfail; @@ -1265,6 +1259,7 @@ vnode_pager_generic_putpages(struct vnod PCPU_INC(cnt.v_vnodeout); PCPU_ADD(cnt.v_vnodepgsout, ncount); + ppscheck = 0; if (error) { if ((ppscheck = ppsratecheck(&lastfail, &curfail, 1))) printf("vnode_pager_putpages: I/O error %d\n", error); From owner-svn-src-all@freebsd.org Wed Apr 12 09:20:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8387AD3778B; Wed, 12 Apr 2017 09:20:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57FF46A5; Wed, 12 Apr 2017 09:20:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3C9K2Dr046081; Wed, 12 Apr 2017 09:20:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3C9K2jU046079; Wed, 12 Apr 2017 09:20:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704120920.v3C9K2jU046079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 12 Apr 2017 09:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316726 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 09:20:03 -0000 Author: kib Date: Wed Apr 12 09:20:02 2017 New Revision: 316726 URL: https://svnweb.freebsd.org/changeset/base/316726 Log: MFC r316526: Extract calculation of ioflags from the vm_pager_putpages flags into a helper. Modified: stable/11/sys/vm/vnode_pager.c stable/11/sys/vm/vnode_pager.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vnode_pager.c ============================================================================== --- stable/11/sys/vm/vnode_pager.c Wed Apr 12 09:13:38 2017 (r316725) +++ stable/11/sys/vm/vnode_pager.c Wed Apr 12 09:20:02 2017 (r316726) @@ -1164,7 +1164,7 @@ vnode_pager_generic_putpages(struct vnod vm_ooffset_t poffset; struct uio auio; struct iovec aiov; - int count, error, i, ioflags, maxsize, ncount, ppscheck; + int count, error, i, maxsize, ncount, ppscheck; static struct timeval lastfail; static int curfail; @@ -1231,21 +1231,6 @@ vnode_pager_generic_putpages(struct vnod } VM_OBJECT_WUNLOCK(object); - /* - * pageouts are already clustered, use IO_ASYNC to force a bawrite() - * rather then a bdwrite() to prevent paging I/O from saturating - * the buffer cache. Dummy-up the sequential heuristic to cause - * large ranges to cluster. If neither IO_SYNC or IO_ASYNC is set, - * the system decides how to cluster. - */ - ioflags = IO_VMIO; - if (flags & (VM_PAGER_PUT_SYNC | VM_PAGER_PUT_INVAL)) - ioflags |= IO_SYNC; - else if ((flags & VM_PAGER_CLUSTER_OK) == 0) - ioflags |= IO_ASYNC; - ioflags |= (flags & VM_PAGER_PUT_INVAL) ? IO_INVAL: 0; - ioflags |= IO_SEQMAX << IO_SEQSHIFT; - aiov.iov_base = (caddr_t) 0; aiov.iov_len = maxsize; auio.uio_iov = &aiov; @@ -1255,7 +1240,8 @@ vnode_pager_generic_putpages(struct vnod auio.uio_rw = UIO_WRITE; auio.uio_resid = maxsize; auio.uio_td = (struct thread *) 0; - error = VOP_WRITE(vp, &auio, ioflags, curthread->td_ucred); + error = VOP_WRITE(vp, &auio, vnode_pager_putpages_ioflags(flags), + curthread->td_ucred); PCPU_INC(cnt.v_vnodeout); PCPU_ADD(cnt.v_vnodepgsout, ncount); @@ -1275,6 +1261,32 @@ vnode_pager_generic_putpages(struct vnod return rtvals[0]; } +int +vnode_pager_putpages_ioflags(int pager_flags) +{ + int ioflags; + + /* + * Pageouts are already clustered, use IO_ASYNC to force a + * bawrite() rather then a bdwrite() to prevent paging I/O + * from saturating the buffer cache. Dummy-up the sequential + * heuristic to cause large ranges to cluster. If neither + * IO_SYNC or IO_ASYNC is set, the system decides how to + * cluster. + */ + ioflags = IO_VMIO; + if ((pager_flags & (VM_PAGER_PUT_SYNC | VM_PAGER_PUT_INVAL)) != 0) + ioflags |= IO_SYNC; + else if ((pager_flags & VM_PAGER_CLUSTER_OK) == 0) + ioflags |= IO_ASYNC; + ioflags |= (pager_flags & VM_PAGER_PUT_INVAL) != 0 ? IO_INVAL: 0; +#ifdef notyet + ioflags |= (pager_flags & VM_PAGER_PUT_NOREUSE) != 0 ? IO_NOREUSE : 0; +#endif + ioflags |= IO_SEQMAX << IO_SEQSHIFT; + return (ioflags); +} + void vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written) { Modified: stable/11/sys/vm/vnode_pager.h ============================================================================== --- stable/11/sys/vm/vnode_pager.h Wed Apr 12 09:13:38 2017 (r316725) +++ stable/11/sys/vm/vnode_pager.h Wed Apr 12 09:20:02 2017 (r316726) @@ -47,7 +47,7 @@ int vnode_pager_generic_putpages(struct int count, int flags, int *rtvals); int vnode_pager_local_getpages(struct vop_getpages_args *ap); int vnode_pager_local_getpages_async(struct vop_getpages_async_args *ap); - +int vnode_pager_putpages_ioflags(int pager_flags); void vnode_pager_release_writecount(vm_object_t object, vm_offset_t start, vm_offset_t end); void vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written); From owner-svn-src-all@freebsd.org Wed Apr 12 09:22:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A863FD37A42; Wed, 12 Apr 2017 09:22:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E977B99; Wed, 12 Apr 2017 09:22:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3C9M2h3049822; Wed, 12 Apr 2017 09:22:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3C9M2HI049820; Wed, 12 Apr 2017 09:22:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704120922.v3C9M2HI049820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 12 Apr 2017 09:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316727 - in stable/11/sys: kern sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 09:22:03 -0000 Author: kib Date: Wed Apr 12 09:22:02 2017 New Revision: 316727 URL: https://svnweb.freebsd.org/changeset/base/316727 Log: MFC r316528: Add V_VMIO flag for vinvalbuf(9). Modified: stable/11/sys/kern/vfs_subr.c stable/11/sys/sys/vnode.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Wed Apr 12 09:20:02 2017 (r316726) +++ stable/11/sys/kern/vfs_subr.c Wed Apr 12 09:22:02 2017 (r316727) @@ -1603,13 +1603,15 @@ bufobj_invalbuf(struct bufobj *bo, int f */ do { bufobj_wwait(bo, 0, 0); - BO_UNLOCK(bo); - if (bo->bo_object != NULL) { - VM_OBJECT_WLOCK(bo->bo_object); - vm_object_pip_wait(bo->bo_object, "bovlbx"); - VM_OBJECT_WUNLOCK(bo->bo_object); + if ((flags & V_VMIO) == 0) { + BO_UNLOCK(bo); + if (bo->bo_object != NULL) { + VM_OBJECT_WLOCK(bo->bo_object); + vm_object_pip_wait(bo->bo_object, "bovlbx"); + VM_OBJECT_WUNLOCK(bo->bo_object); + } + BO_LOCK(bo); } - BO_LOCK(bo); } while (bo->bo_numoutput > 0); BO_UNLOCK(bo); @@ -1617,7 +1619,7 @@ bufobj_invalbuf(struct bufobj *bo, int f * Destroy the copy in the VM cache, too. */ if (bo->bo_object != NULL && - (flags & (V_ALT | V_NORMAL | V_CLEANONLY)) == 0) { + (flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO)) == 0) { VM_OBJECT_WLOCK(bo->bo_object); vm_object_page_remove(bo->bo_object, 0, 0, (flags & V_SAVE) ? OBJPR_CLEANONLY : 0); @@ -1626,7 +1628,7 @@ bufobj_invalbuf(struct bufobj *bo, int f #ifdef INVARIANTS BO_LOCK(bo); - if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY)) == 0 && + if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO)) == 0 && (bo->bo_dirty.bv_cnt > 0 || bo->bo_clean.bv_cnt > 0)) panic("vinvalbuf: flush failed"); BO_UNLOCK(bo); Modified: stable/11/sys/sys/vnode.h ============================================================================== --- stable/11/sys/sys/vnode.h Wed Apr 12 09:20:02 2017 (r316726) +++ stable/11/sys/sys/vnode.h Wed Apr 12 09:22:02 2017 (r316727) @@ -396,6 +396,7 @@ extern int vttoif_tab[]; #define V_ALT 0x0002 /* vinvalbuf: invalidate only alternate bufs */ #define V_NORMAL 0x0004 /* vinvalbuf: invalidate only regular bufs */ #define V_CLEANONLY 0x0008 /* vinvalbuf: invalidate only clean bufs */ +#define V_VMIO 0x0010 /* vinvalbuf: called during pageout */ #define REVOKEALL 0x0001 /* vop_revoke: revoke all aliases */ #define V_WAIT 0x0001 /* vn_start_write: sleep for suspend */ #define V_NOWAIT 0x0002 /* vn_start_write: don't sleep for suspend */ From owner-svn-src-all@freebsd.org Wed Apr 12 10:34:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C793D3B3AE; Wed, 12 Apr 2017 10:34:51 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 116D5A69; Wed, 12 Apr 2017 10:34:51 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CAYoab078671; Wed, 12 Apr 2017 10:34:50 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CAYoY3078670; Wed, 12 Apr 2017 10:34:50 GMT (envelope-from br@FreeBSD.org) Message-Id: <201704121034.v3CAYoY3078670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 12 Apr 2017 10:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316728 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 10:34:51 -0000 Author: br Date: Wed Apr 12 10:34:50 2017 New Revision: 316728 URL: https://svnweb.freebsd.org/changeset/base/316728 Log: Provide a NULL pointer to device tree blob so GENERIC kernel can be compiled. We will need to get pointer to DTB from hardware, so mark as TODO. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Wed Apr 12 09:22:02 2017 (r316727) +++ head/sys/riscv/riscv/machdep.c Wed Apr 12 10:34:50 2017 (r316728) @@ -718,7 +718,12 @@ try_load_dtb(caddr_t kmdp) { vm_offset_t dtbp; +#if defined(FDT_DTB_STATIC) dtbp = (vm_offset_t)&fdt_static_dtb; +#else + /* TODO */ + dtbp = (vm_offset_t)NULL; +#endif if (dtbp == (vm_offset_t)NULL) { printf("ERROR loading DTB\n"); return; From owner-svn-src-all@freebsd.org Wed Apr 12 10:40:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4F6D3B459; Wed, 12 Apr 2017 10:40:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ABD4C21; Wed, 12 Apr 2017 10:40:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CAeUd3078924; Wed, 12 Apr 2017 10:40:30 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CAeULD078923; Wed, 12 Apr 2017 10:40:30 GMT (envelope-from br@FreeBSD.org) Message-Id: <201704121040.v3CAeULD078923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 12 Apr 2017 10:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316729 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 10:40:31 -0000 Author: br Date: Wed Apr 12 10:40:30 2017 New Revision: 316729 URL: https://svnweb.freebsd.org/changeset/base/316729 Log: Disable fformat-extensions for RISC-V target as GCC 6.1 external compiler has no support for that. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10348 Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Wed Apr 12 10:34:50 2017 (r316728) +++ head/sys/conf/kern.opts.mk Wed Apr 12 10:40:30 2017 (r316729) @@ -74,6 +74,10 @@ BROKEN_OPTIONS+= CDDL ZFS SSP BROKEN_OPTIONS+= ZFS .endif +.if ${MACHINE_CPUARCH} == "riscv" +BROKEN_OPTIONS+= FORMAT_EXTENSIONS +.endif + # Things that don't work because the kernel doesn't have the support # for them. .if ${MACHINE} != "i386" && ${MACHINE} != "amd64" From owner-svn-src-all@freebsd.org Wed Apr 12 10:45:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9A6AD3B643; Wed, 12 Apr 2017 10:45:20 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83A78BD; Wed, 12 Apr 2017 10:45:20 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CAjJqE082718; Wed, 12 Apr 2017 10:45:19 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CAjJZh082717; Wed, 12 Apr 2017 10:45:19 GMT (envelope-from br@FreeBSD.org) Message-Id: <201704121045.v3CAjJZh082717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 12 Apr 2017 10:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316730 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 10:45:20 -0000 Author: br Date: Wed Apr 12 10:45:19 2017 New Revision: 316730 URL: https://svnweb.freebsd.org/changeset/base/316730 Log: Include RISC-V target to universe build. Check if RISC-V external toolchain package is installed, otherwise skip build. Reviewed by: emaste Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10344 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Apr 12 10:40:30 2017 (r316729) +++ head/Makefile Wed Apr 12 10:45:19 2017 (r316730) @@ -417,16 +417,28 @@ worlds: .PHONY # existing system is. # .if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets) -TARGETS?=amd64 arm arm64 i386 mips powerpc sparc64 +TARGETS?=amd64 arm arm64 i386 mips powerpc riscv sparc64 _UNIVERSE_TARGETS= ${TARGETS} TARGET_ARCHES_arm?= arm armeb armv6 TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipselhf mipshf mips64elhf mips64hf TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe +TARGET_ARCHES_riscv?= riscv64 riscv64sf .for target in ${TARGETS} TARGET_ARCHES_${target}?= ${target} .endfor +MAKE_PARAMS_riscv?= CROSS_TOOLCHAIN=riscv64-gcc + +# XXX Remove riscv from universe if the required toolchain package is missing. +.if !exists(/usr/local/share/toolchains/riscv64-gcc.mk) && ${TARGETS:Mriscv} +_UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:Nriscv} +universe: universe_riscv_skip .PHONY +universe_epilogue: universe_riscv_skip .PHONY +universe_riscv_skip: universe_prologue .PHONY + @echo ">> riscv skipped - install riscv64-xtoolchain-gcc port or package to build" +.endif + .if defined(UNIVERSE_TARGET) MAKE_JUST_WORLDS= YES .else @@ -476,6 +488,7 @@ universe_${target}_${target_arch}: unive ${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ TARGET=${target} \ TARGET_ARCH=${target_arch} \ + ${MAKE_PARAMS_${target}} \ > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \ (echo "${target}.${target_arch} ${UNIVERSE_TARGET} failed," \ "check _.${target}.${target_arch}.${UNIVERSE_TARGET} for details" | \ @@ -531,6 +544,7 @@ universe_kernconf_${TARGET}_${kernel}: . ${SUB_MAKE} ${JFLAG} buildkernel \ TARGET=${TARGET} \ TARGET_ARCH=${TARGET_ARCH_${kernel}} \ + ${MAKE_PARAMS_${TARGET}} \ KERNCONF=${kernel} \ > _.${TARGET}.${kernel} 2>&1 || \ (echo "${TARGET} ${kernel} kernel failed," \ From owner-svn-src-all@freebsd.org Wed Apr 12 11:41:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E92AD39879; Wed, 12 Apr 2017 11:41:36 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10ACDCD; Wed, 12 Apr 2017 11:41:35 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CBfZMa006054; Wed, 12 Apr 2017 11:41:35 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CBfZKd006053; Wed, 12 Apr 2017 11:41:35 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201704121141.v3CBfZKd006053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Wed, 12 Apr 2017 11:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316731 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 11:41:36 -0000 Author: maxim Date: Wed Apr 12 11:41:35 2017 New Revision: 316731 URL: https://svnweb.freebsd.org/changeset/base/316731 Log: OpenBSD 6.1 release added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed Apr 12 10:45:19 2017 (r316730) +++ head/share/misc/bsd-family-tree Wed Apr 12 11:41:35 2017 (r316731) @@ -352,6 +352,7 @@ FreeBSD 5.2 | | | 11.0 10.12 | | | | | NetBSD 7.1 | | | | | | DragonFly 4.8.0 + | | | OpenBSD 6.1 | | | | | | FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -710,6 +711,7 @@ macOS 10.12 2016-09-20 [APL] FreeBSD 11.0 2016-10-10 [FBD] NetBSD 7.1 2017-03-11 [NBD] DragonFly 4.8.0 2017-03-27 [DFB] +OpenBSD 6.1 2017-04-11 [OBD] Bibliography ------------------------ From owner-svn-src-all@freebsd.org Wed Apr 12 12:34:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DCFED3A617; Wed, 12 Apr 2017 12:34:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30227768; Wed, 12 Apr 2017 12:34:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CCYSMI027207; Wed, 12 Apr 2017 12:34:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CCYScL027204; Wed, 12 Apr 2017 12:34:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704121234.v3CCYScL027204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 12 Apr 2017 12:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316732 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 12:34:29 -0000 Author: andrew Date: Wed Apr 12 12:34:27 2017 New Revision: 316732 URL: https://svnweb.freebsd.org/changeset/base/316732 Log: Use the unprivileged variant of the load and store instructions most places possible in the kernel. This forces these functions to fail if userspace is unable to access a given memory location, even if it is in the user memory range. This will simplify adding Privileged Access Never support later. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/copyinout.S head/sys/arm64/arm64/support.S Modified: head/sys/arm64/arm64/copyinout.S ============================================================================== --- head/sys/arm64/arm64/copyinout.S Wed Apr 12 11:41:35 2017 (r316731) +++ head/sys/arm64/arm64/copyinout.S Wed Apr 12 12:34:27 2017 (r316732) @@ -103,7 +103,8 @@ ENTRY(copyinstr) ldr x7, =VM_MAXUSER_ADDRESS 1: cmp x0, x7 b.cs copyio_fault - ldrb w4, [x0], #1 /* Load from uaddr */ + ldtrb w4, [x0] /* Load from uaddr */ + add x0, x0, #1 /* Next char */ strb w4, [x1], #1 /* Store in kaddr */ add x5, x5, #1 /* count++ */ cbz w4, 2f /* Break when NUL-terminated */ Modified: head/sys/arm64/arm64/support.S ============================================================================== --- head/sys/arm64/arm64/support.S Wed Apr 12 11:41:35 2017 (r316731) +++ head/sys/arm64/arm64/support.S Wed Apr 12 12:34:27 2017 (r316732) @@ -97,7 +97,7 @@ ENTRY(fubyte) b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x1) /* And set it */ - ldrb w0, [x0] /* Try loading the data */ + ldtrb w0, [x0] /* Try loading the data */ SET_FAULT_HANDLER(xzr, x1) /* Reset the fault handler */ ret /* Return */ END(fubyte) @@ -111,7 +111,7 @@ ENTRY(fuword16) b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x1) /* And set it */ - ldrh w0, [x0] /* Try loading the data */ + ldtrh w0, [x0] /* Try loading the data */ SET_FAULT_HANDLER(xzr, x1) /* Reset the fault handler */ ret /* Return */ END(fuword16) @@ -125,7 +125,7 @@ ENTRY(fueword32) b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ - ldr w0, [x0] /* Try loading the data */ + ldtr w0, [x0] /* Try loading the data */ SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ str w0, [x1] /* Save the data in kernel space */ mov w0, #0 /* Success */ @@ -143,7 +143,7 @@ EENTRY(fueword64) b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ - ldr x0, [x0] /* Try loading the data */ + ldtr x0, [x0] /* Try loading the data */ SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ str x0, [x1] /* Save the data in kernel space */ mov x0, #0 /* Success */ @@ -160,7 +160,7 @@ ENTRY(subyte) b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ - strb w1, [x0] /* Try storing the data */ + sttrb w1, [x0] /* Try storing the data */ SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ mov x0, #0 /* Success */ ret /* Return */ @@ -175,7 +175,7 @@ ENTRY(suword16) b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ - strh w1, [x0] /* Try storing the data */ + sttrh w1, [x0] /* Try storing the data */ SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ mov x0, #0 /* Success */ ret /* Return */ @@ -190,7 +190,7 @@ ENTRY(suword32) b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ - str w1, [x0] /* Try storing the data */ + sttr w1, [x0] /* Try storing the data */ SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ mov x0, #0 /* Success */ ret /* Return */ @@ -206,7 +206,7 @@ EENTRY(suword64) b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ - str x1, [x0] /* Try storing the data */ + sttr x1, [x0] /* Try storing the data */ SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ mov x0, #0 /* Success */ ret /* Return */ @@ -237,7 +237,7 @@ ENTRY(fuswintr) b.cs fsu_fault_nopcb adr x6, fsu_intr_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x1) /* And set it */ - ldr w0, [x0] /* Try loading the data */ + ldtr w0, [x0] /* Try loading the data */ SET_FAULT_HANDLER(xzr, x1) /* Reset the fault handler */ ret /* Return */ END(fuswintr) @@ -251,7 +251,7 @@ ENTRY(suswintr) b.cs fsu_fault_nopcb adr x6, fsu_intr_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ - str w1, [x0] /* Try storing the data */ + sttr w1, [x0] /* Try storing the data */ SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ mov x0, #0 /* Success */ ret /* Return */ From owner-svn-src-all@freebsd.org Wed Apr 12 16:00:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 047CED3A451; Wed, 12 Apr 2017 16:00:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B29F2691; Wed, 12 Apr 2017 16:00:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f45.google.com with SMTP id o81so91269769wmb.1; Wed, 12 Apr 2017 09:00:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Hc7MUahevWXwFTv4XlT2l7hDlOzZ3RXNJLKiFDgeNW0=; b=TxHK+/OgWt9bLvfGLp367eFsTKUFnBTWgCF7jM+Dw2tMz1j5+nlEoZbykBE9OBfzXA CZo38YTSwDQhk1NBYjH6d+SBrQHYyHcXOtC053V2zZEVo9MJCyKZS1N6tRxYs0wiRwz7 bkK1PEbfijlP+xSs7m23IiJkxhXiDjsb/za1KgvOCpbLAqIo5vQwuglFdQBrShfTzV42 aCR5Q7mPUKMvohd7iHBUr9x6UaDSV2K/9MIgfIBmMuOm+S9t0y81pZx+mdW7LAQM/mxe QV5D3+zaqnwTNPW61Up3pfpN9c++Q8twKh4hvu6LkciGPzz5lrhc96WhC4aUaS6DI28Z O9fg== X-Gm-Message-State: AN3rC/4ulrhkILHeHMWeS44ZS16oDljhKJvlnQSq05ZD6sFPLW30ahMJ BIFgO7Ubqnm1HxSRFac= X-Received: by 10.28.225.10 with SMTP id y10mr19266320wmg.34.1492012315164; Wed, 12 Apr 2017 08:51:55 -0700 (PDT) Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com. [209.85.128.170]) by smtp.gmail.com with ESMTPSA id o15sm26010281wra.61.2017.04.12.08.51.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Apr 2017 08:51:55 -0700 (PDT) Received: by mail-wr0-f170.google.com with SMTP id l28so20304152wre.0; Wed, 12 Apr 2017 08:51:55 -0700 (PDT) X-Received: by 10.223.131.67 with SMTP id 61mr3781432wrd.57.1492012314865; Wed, 12 Apr 2017 08:51:54 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Wed, 12 Apr 2017 08:51:54 -0700 (PDT) In-Reply-To: <201704112155.v3BLtepk065823@repo.freebsd.org> References: <201704112155.v3BLtepk065823@repo.freebsd.org> From: Conrad Meyer Date: Wed, 12 Apr 2017 08:51:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316718 - head/sbin/mksnap_ffs To: Maxim Sobolev Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 16:00:01 -0000 Hi Maxim, This breaks several stbuf checks in main() following the stat() call you removed to isdir(). Coverity reported this as CID 1374247. On Tue, Apr 11, 2017 at 2:55 PM, Maxim Sobolev wrote: > Author: sobomax > Date: Tue Apr 11 21:55:39 2017 > New Revision: 316718 > URL: https://svnweb.freebsd.org/changeset/base/316718 > > ... > --- head/sbin/mksnap_ffs/mksnap_ffs.c Tue Apr 11 20:28:15 2017 (r316717) > +++ head/sbin/mksnap_ffs/mksnap_ffs.c Tue Apr 11 21:55:39 2017 (r316718) > @@ -58,6 +58,33 @@ usage(void) > errx(EX_USAGE, "usage: mksnap_ffs snapshot_name"); > } > > +static int > +isdir(const char *path) > +{ > + struct stat stbuf; > + > + if (stat(path, &stbuf) < 0) > + return (-1); ^^^^^^^^^^^^^^^^^^ moved here > + if (!S_ISDIR(stbuf.st_mode)) > + return (0); > + return (1); > +} > ... > @@ -96,16 +123,33 @@ main(int argc, char **argv) > } > if (statfs(path, &stfsbuf) < 0) > err(1, "%s", path); > - if (stat(path, &stbuf) < 0) ^^^^^^^^^^^^^^^^^^^ from here > + switch (isdir(path)) { > + case -1: > err(1, "%s", path); > - if (!S_ISDIR(stbuf.st_mode)) > + case 0: > errx(1, "%s: Not a directory", path); > + default: > + break; > + } > if (access(path, W_OK) < 0) > err(1, "Lack write permission in %s", path); > if ((stbuf.st_mode & S_ISTXT) && stbuf.st_uid != getuid()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ now uninitialized use From owner-svn-src-all@freebsd.org Wed Apr 12 16:21:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C580FD3AC3F; Wed, 12 Apr 2017 16:21:56 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0C2F3ED; Wed, 12 Apr 2017 16:21:56 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CGLt50020618; Wed, 12 Apr 2017 16:21:55 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CGLtkP020617; Wed, 12 Apr 2017 16:21:55 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704121621.v3CGLtkP020617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 12 Apr 2017 16:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316733 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 16:21:56 -0000 Author: bde Date: Wed Apr 12 16:21:55 2017 New Revision: 316733 URL: https://svnweb.freebsd.org/changeset/base/316733 Log: Fix clobbering of the default attribute and the screen position in scteken_init(). Move the internals of scteken_sync() into a local function to help do this. scteken_init() reset or adjusted the default attribute and screen position at least 3 and 5 times, respectively. Warm init shouldn't do any more than reset the "input" state. (scterm-sc.c (which still works after minor editing), only resets the escape state and the saved cursor position, and then does a nearly-null sync of the current color.) This mainly broke mode changes, and was most noticeable when the background color is not teken's default (usually black). Then the screen gets cleared in the wrong color. vidcontrol restores the default normal attribute and tries to restore the default reverse attribute. vidcontrol doesn't clear the screen again after restoring the attribute(s), and it is too late to do it there without flicker. Now the default normal attribute is restored before the change affects the rendering. When the foreground color is not teken's default, clearing with the wrong attributes gave strange cursor colors for some cursor types. The default reverse attribute is not restored since it is unsupported. 2/3 of the clobbering was from 2 resetting window resizing calls. The second one is needed to restore the size, but must not reset. Window resizing also sanitizes the cursor position, and after the main reset resets the window size, the cursor row would often be adjusted from 24 to 23 if it were not already reset to 0. scteken_sync() is good for restoring the window size and the cursor position in the correct order, but was unusable at init time since scp->ts is not always initialized then. Adjust to use its internals. I didn't notice any problems from the cursor reset. The cursor should be reset, and a previous fix was to reset it consistently a little later. Doing nothing for warm init works almost as well, if not better. It is not very useful to reset the escape state for mode changes, since the reset is especially likely to be null then. The escape state is most likely to be non-initial and corrupted by its most normal uses -- sloppy non-atomic output where a context switch or just mixing stdout with stderr splits up escape sequences. Modified: head/sys/dev/syscons/scterm-teken.c Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Wed Apr 12 12:34:27 2017 (r316732) +++ head/sys/dev/syscons/scterm-teken.c Wed Apr 12 16:21:55 2017 (r316733) @@ -72,6 +72,8 @@ typedef struct { static teken_stat reserved_teken_stat; +static void scteken_sync_internal(scr_stat *, teken_stat *); + static sc_term_sw_t sc_term_scteken = { { NULL, NULL }, "scteken", /* emulator name */ @@ -116,7 +118,7 @@ static int scteken_init(scr_stat *scp, void **softc, int code) { teken_stat *ts; - teken_pos_t tp; + teken_attr_t ta; if (*softc == NULL) { if (reserved_teken_stat.ts_busy) @@ -131,17 +133,16 @@ scteken_init(scr_stat *scp, void **softc ts->ts_busy = 1; /* FALLTHROUGH */ case SC_TE_WARM_INIT: + ta = *teken_get_defattr(&ts->ts_teken); teken_init(&ts->ts_teken, &scteken_funcs, scp); + teken_set_defattr(&ts->ts_teken, &ta); #ifndef TEKEN_UTF8 teken_set_8bit(&ts->ts_teken); #endif /* !TEKEN_UTF8 */ #ifdef TEKEN_CONS25 teken_set_cons25(&ts->ts_teken); #endif /* TEKEN_CONS25 */ - - tp.tp_row = scp->ysize; - tp.tp_col = scp->xsize; - teken_set_winsize(&ts->ts_teken, &tp); + scteken_sync_internal(scp, ts); break; } @@ -219,7 +220,7 @@ scteken_clear(scr_stat *scp) teken_stat *ts = scp->ts; sc_move_cursor(scp, 0, 0); - scteken_sync(scp); + scteken_sync_internal(scp, ts); sc_vtb_clear(&scp->vtb, scp->sc->scr_map[0x20], scteken_te_to_sc_attr(teken_get_curattr(&ts->ts_teken)) << 8); @@ -284,9 +285,8 @@ scteken_fkeystr(scr_stat *scp, int c) } static void -scteken_sync(scr_stat *scp) +scteken_sync_internal(scr_stat *scp, teken_stat *ts) { - teken_stat *ts = scp->ts; teken_pos_t tp; tp.tp_col = scp->xsize; @@ -298,6 +298,12 @@ scteken_sync(scr_stat *scp) } static void +scteken_sync(scr_stat *scp) +{ + scteken_sync_internal(scp, scp->ts); +} + +static void scteken_nop(void) { From owner-svn-src-all@freebsd.org Wed Apr 12 16:28:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB20D3B1CA; Wed, 12 Apr 2017 16:28:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AFA5C44; Wed, 12 Apr 2017 16:28:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CGSeaQ023660; Wed, 12 Apr 2017 16:28:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CGSe7d023658; Wed, 12 Apr 2017 16:28:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704121628.v3CGSe7d023658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 12 Apr 2017 16:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316734 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 16:28:41 -0000 Author: andrew Date: Wed Apr 12 16:28:40 2017 New Revision: 316734 URL: https://svnweb.freebsd.org/changeset/base/316734 Log: Start to use the User and Privileged execute-never bits in the arm64 pagetables. This sets both bits when entering an address we know shouldn't be executed. I expect we could mark all userspace pages as Privileged execute-never to ensure the kernel doesn't branch to one of these addresses. While here add the ARMv8.1 upper attributes. Reviewed by: alc, kib (previous version) MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10360 Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pte.h Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Apr 12 16:21:55 2017 (r316733) +++ head/sys/arm64/arm64/pmap.c Wed Apr 12 16:28:40 2017 (r316734) @@ -606,7 +606,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT); pmap_load_store(&pagetable_dmap[l1_slot], - (pa & ~L1_OFFSET) | ATTR_DEFAULT | + (pa & ~L1_OFFSET) | ATTR_DEFAULT | ATTR_XN | ATTR_IDX(CACHED_MEMORY) | L1_BLOCK); } @@ -2428,14 +2428,16 @@ pmap_protect(pmap_t pmap, vm_offset_t sv { vm_offset_t va, va_next; pd_entry_t *l0, *l1, *l2; - pt_entry_t *l3p, l3; + pt_entry_t *l3p, l3, nbits; - if ((prot & VM_PROT_READ) == VM_PROT_NONE) { + KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot)); + if (prot == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; } - if ((prot & VM_PROT_WRITE) == VM_PROT_WRITE) + if ((prot & (VM_PROT_WRITE | VM_PROT_EXECUTE)) == + (VM_PROT_WRITE | VM_PROT_EXECUTE)) return; PMAP_LOCK(pmap); @@ -2480,17 +2482,25 @@ pmap_protect(pmap_t pmap, vm_offset_t sv for (l3p = pmap_l2_to_l3(l2, sva); sva != va_next; l3p++, sva += L3_SIZE) { l3 = pmap_load(l3p); - if (pmap_l3_valid(l3)) { + if (!pmap_l3_valid(l3)) + continue; + + nbits = 0; + if ((prot & VM_PROT_WRITE) == 0) { if ((l3 & ATTR_SW_MANAGED) && pmap_page_dirty(l3)) { vm_page_dirty(PHYS_TO_VM_PAGE(l3 & ~ATTR_MASK)); } - pmap_set(l3p, ATTR_AP(ATTR_AP_RO)); - PTE_SYNC(l3p); - /* XXX: Use pmap_invalidate_range */ - pmap_invalidate_page(pmap, va); + nbits |= ATTR_AP(ATTR_AP_RO); } + if ((prot & VM_PROT_EXECUTE) == 0) + nbits |= ATTR_XN; + + pmap_set(l3p, nbits); + PTE_SYNC(l3p); + /* XXX: Use pmap_invalidate_range */ + pmap_invalidate_page(pmap, va); } } PMAP_UNLOCK(pmap); @@ -2709,6 +2719,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, L3_PAGE); if ((prot & VM_PROT_WRITE) == 0) new_l3 |= ATTR_AP(ATTR_AP_RO); + if ((prot & VM_PROT_EXECUTE) == 0) + new_l3 |= ATTR_XN; if ((flags & PMAP_ENTER_WIRED) != 0) new_l3 |= ATTR_SW_WIRED; if ((va >> 63) == 0) @@ -3115,6 +3127,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ pa = VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_IDX(m->md.pv_memattr) | ATTR_AP(ATTR_AP_RO) | L3_PAGE; + if ((prot & VM_PROT_EXECUTE) == 0) + pa |= ATTR_XN; /* * Now validate mapping with RO protection Modified: head/sys/arm64/include/pte.h ============================================================================== --- head/sys/arm64/include/pte.h Wed Apr 12 16:21:55 2017 (r316733) +++ head/sys/arm64/include/pte.h Wed Apr 12 16:28:40 2017 (r316734) @@ -46,6 +46,11 @@ typedef uint64_t pt_entry_t; /* page ta /* Bits 58:55 are reserved for software */ #define ATTR_SW_MANAGED (1UL << 56) #define ATTR_SW_WIRED (1UL << 55) +#define ATTR_UXN (1UL << 54) +#define ATTR_PXN (1UL << 53) +#define ATTR_XN (ATTR_PXN | ATTR_UXN) +#define ATTR_CONTIGUOUS (1UL << 52) +#define ATTR_DBM (1UL << 51) #define ATTR_nG (1 << 11) #define ATTR_AF (1 << 10) #define ATTR_SH(x) ((x) << 8) From owner-svn-src-all@freebsd.org Wed Apr 12 17:06:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B5D2D3B147; Wed, 12 Apr 2017 17:06:25 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AE77E69; Wed, 12 Apr 2017 17:06:25 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CH6Oa5040244; Wed, 12 Apr 2017 17:06:24 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CH6OTM040243; Wed, 12 Apr 2017 17:06:24 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704121706.v3CH6OTM040243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 12 Apr 2017 17:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316735 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 17:06:25 -0000 Author: bde Date: Wed Apr 12 17:06:24 2017 New Revision: 316735 URL: https://svnweb.freebsd.org/changeset/base/316735 Log: Fix removing of the mouse image in vga planar mode with 8x8 fonts, and reduce hard-coded assumptions on font sizes so that the cursor size can be more independent of the font size. Moving the mouse in the buggy mode left trails of garbage. The mouse cursor currently has size 9x13 in all modes. This can occupy 2x3 character cells with 8x8 fonts, but the algorithm was hard-coded for only 2x2 character cells. Rearrange to hard-code only a maximum cursor size (now 10x16) and to not hard-code in the logic. The number of cells needed is now over-estimated in some cases. 2x3 character cells should also be used in text mode with 8x8 fonts (except with large pixels, the cursor size should be reduced), but hard-coding for 2x2 in the implementation makes it not very easy to expand, and it practice it shifts out bits to reduce to 2x2. In graphics modes, expansion is easier and there is no shifting out for 9x13 cursors (but 9 is a limit for hard-coding for 2 8-bit VGA cells wide). A previous commit removed the same buggy hard-coding for removal at a lower level in planar mode. Another previous commit fixed the much larger code for lower-level removal in direct mode; this is independent of the font size so worked for 8x8 fonts. Text mode always depended on the higher-level removal here, and always worked since everything was hard-coded consistently for 2x2 character cells. Modified: head/sys/dev/syscons/scmouse.c Modified: head/sys/dev/syscons/scmouse.c ============================================================================== --- head/sys/dev/syscons/scmouse.c Wed Apr 12 16:28:40 2017 (r316734) +++ head/sys/dev/syscons/scmouse.c Wed Apr 12 17:06:24 2017 (r316735) @@ -232,30 +232,33 @@ sc_draw_mouse_image(scr_stat *scp) void sc_remove_mouse_image(scr_stat *scp) { - int size; - int i; + int cols, i, rows; if (ISGRAPHSC(scp)) return; SC_VIDEO_LOCK(scp->sc); - (*scp->rndr->draw_mouse)(scp, - (scp->mouse_oldpos%scp->xsize + scp->xoff) - * scp->font_width, - (scp->mouse_oldpos/scp->xsize + scp->yoff) - * scp->font_size, + (*scp->rndr->draw_mouse)(scp, scp->mouse_oldxpos, scp->mouse_oldypos, FALSE); - size = scp->xsize*scp->ysize; + /* + * To simplify the renderer and ensure undrawing with correct + * attributes, mark for update a region containing the cursor + * (usually 2x2 character cells joined by almost a full line o + * character cells). + * + * The renderer should only undraw any pixels outside of the text + * window (e.g., ones in borders and hardware cursors). + */ i = scp->mouse_oldpos; mark_for_update(scp, i); mark_for_update(scp, i); - if (i + scp->xsize + 1 < size) { - mark_for_update(scp, i + scp->xsize + 1); - } else if (i + scp->xsize < size) { - mark_for_update(scp, i + scp->xsize); - } else if (i + 1 < size) { - mark_for_update(scp, i + 1); - } + cols = 1 + howmany(10 - 1, scp->font_width); /* up to VGA cursor width 9 */ + cols = imax(cols, 2); /* in case it is text mode 2x2 char cells */ + cols = imin(cols, scp->xsize - i % scp->xsize); + rows = 1 + howmany(16 - 1, scp->font_size); /* up to VGA cursor height 16 */ + rows = imax(rows, 2); /* don't bother reducing 3 to 2 if text */ + rows = imin(rows, scp->ysize - i / scp->xsize); + mark_for_update(scp, i + (rows - 1) * scp->xsize + cols - 1); scp->status &= ~MOUSE_VISIBLE; SC_VIDEO_UNLOCK(scp->sc); } From owner-svn-src-all@freebsd.org Wed Apr 12 17:08:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 380E6D3B237; Wed, 12 Apr 2017 17:08:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x230.google.com (mail-qk0-x230.google.com [IPv6:2607:f8b0:400d:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5B7011A; Wed, 12 Apr 2017 17:08:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x230.google.com with SMTP id f133so28685342qke.2; Wed, 12 Apr 2017 10:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fhHRY29d8blkqmT7jzEq7UwooqXC0/iJIjcVcsRDwG0=; b=rZBIvUYeIQjgFSkTPlQWOMhxadIi+vlulEwP2XsNiOi6htrY3ylo8fRxaxdlwl5ajT p08xEPqkRhk09hQhcFdgVy//9TvWCPAU6QcDFlnh+8S9Bpt+k1g5mbpnCyk7DAQ2Sr1q dysoARRSLIE0WZ3aCIE8Kw63kfikbCRx6kZ0so8Jaxu48sUKpmuxg22pOglco18NQ3Mj GHVx4e9oy/8kLWqg/FOOVKQQQptuRxgyvZyam2ndNARqZzSTUeAk0Ea5z1t7lSWeFdVf +sZGqlU9T/qhHmJA8Z89hyyTdWi4pBFqrUK/X503Ot6mrTtSxhE9oJkcarwG1DCmpbY2 rKTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=fhHRY29d8blkqmT7jzEq7UwooqXC0/iJIjcVcsRDwG0=; b=cJyCia96RzHDGapqO96f2/l0W/NnvD3pjUncOdt2jWdVD1ss0ujmcZ6Z4M2QY82jcd 1Hl4Mmgb7TXl9KeD+JhrGfFWC7lC51J5vULJnlFSKy7AwHx5l9EhQWsFr8wtqtLZEwSS pW82ucwfjm8d3RKy6oqGI7db20U10RD2hbTQgE1/zs2vOJr1bnng9MtoyemHgPt8y5fq cRp+EpbdZGW0O7ND6AE++1I1fTSt7jIQKrheAo8IvCNNWjLKZT9tHfEQPqVjQKX1NTAr hD2ni3QMFQCNfD3DP1Kmbj48w0RbB2rxH1Px9tDf9pupTrTsZpPfJvXzxB1n0ZcAkwQn kSmA== X-Gm-Message-State: AN3rC/7IeqsXZqozBILWhqvmsuhkTaDY1JM9Aua/cxQZkCmtSF2L1LLeMQ3dnQhge8ntqg== X-Received: by 10.55.66.136 with SMTP id p130mr31465186qka.89.1492016908922; Wed, 12 Apr 2017 10:08:28 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id j1sm13798856qkf.57.2017.04.12.10.08.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Apr 2017 10:08:28 -0700 (PDT) Sender: Mark Johnston Date: Wed, 12 Apr 2017 10:07:18 -0700 From: Mark Johnston To: Eric Badger Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r314690 - in head: share/man/man5 sys/conf sys/fs/procfs sys/modules/procfs Message-ID: <20170412170718.GA14764@wkstn-mjohnston.west.isilon.com> References: <201703050305.v2535OYk020986@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201703050305.v2535OYk020986@repo.freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 17:08:30 -0000 On Sun, Mar 05, 2017 at 03:05:24AM +0000, Eric Badger wrote: > Author: badger > Date: Sun Mar 5 03:05:24 2017 > New Revision: 314690 > URL: https://svnweb.freebsd.org/changeset/base/314690 > > Log: > remove procfs ctl interface > > This interface has no in-tree consumers and has been more or less > non-functional for several releases. On a related note, can we also get rid of procctl(8)? It seems rather obsolete at this point and its name is confusing given the existence of the unrelated procctl(2) and /usr/bin/proccontrol. From owner-svn-src-all@freebsd.org Wed Apr 12 17:38:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F4BED3BCEA; Wed, 12 Apr 2017 17:38:01 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C5BF1D14; Wed, 12 Apr 2017 17:38:01 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CHc0Uv053647; Wed, 12 Apr 2017 17:38:00 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CHc0np053646; Wed, 12 Apr 2017 17:38:00 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704121738.v3CHc0np053646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 12 Apr 2017 17:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316736 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 17:38:01 -0000 Author: bde Date: Wed Apr 12 17:38:00 2017 New Revision: 316736 URL: https://svnweb.freebsd.org/changeset/base/316736 Log: Trival style fix to previous commit to add this detail. The previous commit also fixed the coordinates passed to the mouse removal renderer. The coordinates were rounded down to a character boundary, and thus essentially unusable. The renderer had to keep track of the previous position, or clear a larger area. The latter is only safe in the border, which is all that needs special handling anyway. I think no renderer depends on the bug. They have the following handling: - gfb sparc64: this seems to assume non-rounded coordinates - gfb other: does nothing (seems to be missing border handling) - vga text: does nothing (doesn't need border handling) - vga planar: clears extras in the border, with some bugs. The fixes will use the precise coordinates to optimize. - vga direct: clears at the previous position with no check that it is active, and clears everything. Checking finds this bug. - others: are there any? Modified: head/sys/dev/syscons/scmouse.c Modified: head/sys/dev/syscons/scmouse.c ============================================================================== --- head/sys/dev/syscons/scmouse.c Wed Apr 12 17:06:24 2017 (r316735) +++ head/sys/dev/syscons/scmouse.c Wed Apr 12 17:38:00 2017 (r316736) @@ -252,7 +252,7 @@ sc_remove_mouse_image(scr_stat *scp) i = scp->mouse_oldpos; mark_for_update(scp, i); mark_for_update(scp, i); - cols = 1 + howmany(10 - 1, scp->font_width); /* up to VGA cursor width 9 */ + cols = 1 + howmany(10 - 1, scp->font_width); /* up to VGA cursor width 9 */ cols = imax(cols, 2); /* in case it is text mode 2x2 char cells */ cols = imin(cols, scp->xsize - i % scp->xsize); rows = 1 + howmany(16 - 1, scp->font_size); /* up to VGA cursor height 16 */ From owner-svn-src-all@freebsd.org Wed Apr 12 18:30:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22A45D3B119 for ; Wed, 12 Apr 2017 18:30:10 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E51F7774 for ; Wed, 12 Apr 2017 18:30:09 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io0-x22e.google.com with SMTP id r16so50479556ioi.2 for ; Wed, 12 Apr 2017 11:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=8rCAp7vIzYvlYtUfzWotWPi/p0fCAejfcKQQGhHtqj8=; b=B7ihqaBr8Yxl6RzvePE//wOUF5qRhIoOjbbLjGickcS3VFAFhtd3D/+7x/CloHaZX3 eEaui24+lM4bleTGypULLqWwQW0uz/0u/9SQAy4scgJBLc08B7ct2ro91WmNqNJDKml6 pHCGX9AAjpQK5VCptKHvsUj78b6jlclKB/cwWVVSnYTAYmZDNNshOp2H+5bu12Stdjz5 qTo9pUrPP5RU2/mtAnKDBvazPAh80LsN4NDPJAxE6kVNKeEi0kFncM1bh2Tshqb25pyX 1db8cXZOv8AXprfJqVzurMZpmsu6ryyxm5BKcDC0yOVSegg3ZzR89TxSUIhQ4RR4JiBh 7v+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=8rCAp7vIzYvlYtUfzWotWPi/p0fCAejfcKQQGhHtqj8=; b=H8yDTVR+d0Dj3piZI1HkYRD4BVRmT+KfsXl7dfs+KUm04Y+9B7o3QC6YoSOCFOCPwC T2DqKzIoEMcCzpXdOgvDmxfJYnS9T9RJ6ni/6fHMAN3NS0OIRKbPP4vf0w88ye472Rz6 jbozSP/MTATrPs+AgAox5FrjrFZyfuVGy3eDt33DlKeFKVDfIdFfusdGhsi5XSb22lOz bosGpwp6nUJij15xJOXZTeuCKhB24ag3ap/J69Pj7tySCF4PL5TK8ULYY+zeRaHBZNdI 2hdMPr2Cx6a8xs8xhnkrZl8HHBFJEq2tXh/N/MKoWlz6oDntS+cIc202AuOmZ6GxhegA KM/g== X-Gm-Message-State: AN3rC/7aHTJlljKyPH4MZzPDxQNhB8JVlA4QgSUwGCh5M6Fyg6+j+g1M 5llBGpATzd9758mcXkqKxd6fE2RvTQ5C X-Received: by 10.36.74.196 with SMTP id k187mr23598993itb.49.1492021809131; Wed, 12 Apr 2017 11:30:09 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.112.210 with HTTP; Wed, 12 Apr 2017 11:30:08 -0700 (PDT) In-Reply-To: References: <201704112155.v3BLtepk065823@repo.freebsd.org> From: Maxim Sobolev Date: Wed, 12 Apr 2017 11:30:08 -0700 X-Google-Sender-Auth: Cimcvlq5itCR34mMPUJtEmU35dI Message-ID: Subject: Re: svn commit: r316718 - head/sbin/mksnap_ffs To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 18:30:10 -0000 Ah, that's right. Good catch, sorry about that. I will fix it momentarily. -Maxim On Wed, Apr 12, 2017 at 8:51 AM, Conrad Meyer wrote: > Hi Maxim, > > This breaks several stbuf checks in main() following the stat() call > you removed to isdir(). Coverity reported this as CID 1374247. > > On Tue, Apr 11, 2017 at 2:55 PM, Maxim Sobolev > wrote: > > Author: sobomax > > Date: Tue Apr 11 21:55:39 2017 > > New Revision: 316718 > > URL: https://svnweb.freebsd.org/changeset/base/316718 > > > > ... > > --- head/sbin/mksnap_ffs/mksnap_ffs.c Tue Apr 11 20:28:15 2017 > (r316717) > > +++ head/sbin/mksnap_ffs/mksnap_ffs.c Tue Apr 11 21:55:39 2017 > (r316718) > > @@ -58,6 +58,33 @@ usage(void) > > errx(EX_USAGE, "usage: mksnap_ffs snapshot_name"); > > } > > > > +static int > > +isdir(const char *path) > > +{ > > + struct stat stbuf; > > + > > + if (stat(path, &stbuf) < 0) > > + return (-1); > ^^^^^^^^^^^^^^^^^^ moved here > > > + if (!S_ISDIR(stbuf.st_mode)) > > + return (0); > > + return (1); > > +} > > ... > > @@ -96,16 +123,33 @@ main(int argc, char **argv) > > } > > if (statfs(path, &stfsbuf) < 0) > > err(1, "%s", path); > > - if (stat(path, &stbuf) < 0) > ^^^^^^^^^^^^^^^^^^^ from here > > > + switch (isdir(path)) { > > + case -1: > > err(1, "%s", path); > > - if (!S_ISDIR(stbuf.st_mode)) > > + case 0: > > errx(1, "%s: Not a directory", path); > > + default: > > + break; > > + } > > if (access(path, W_OK) < 0) > > err(1, "Lack write permission in %s", path); > > if ((stbuf.st_mode & S_ISTXT) && stbuf.st_uid != getuid()) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ now uninitialized use > > From owner-svn-src-all@freebsd.org Wed Apr 12 18:52:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDD9CD3B953; Wed, 12 Apr 2017 18:52:07 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F815964; Wed, 12 Apr 2017 18:52:07 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CIq6cx085861; Wed, 12 Apr 2017 18:52:06 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CIq6Gm085860; Wed, 12 Apr 2017 18:52:06 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704121852.v3CIq6Gm085860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 12 Apr 2017 18:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316737 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 18:52:08 -0000 Author: bde Date: Wed Apr 12 18:52:06 2017 New Revision: 316737 URL: https://svnweb.freebsd.org/changeset/base/316737 Log: Fix removal of mouse image by the vga planar renderer in the right border in unusual cases. Optimize and significantly clean up removal in this renderer. Optimize removal in the vga direct renderer. Removal only needs to be done in the border (the part with pixels) in both cases. The planar renderer used the condition scp->xoff > 0 to test whether a right border exists. This actually tests for a left border, and when the total horizontal border is 8 pixels, rounding gives only a right border. This was the unusual broken case. An example is easy to configure using something like "vidcontrol -f 8x16 iso-8x16 -g 79x25 MODE_27". Optimize the planar case a little by only removing 9x13 active pixels out of 16x16. Optimize it a lot by not doing anything if there is no overlap with the border. Don't unroll the main loop or hard-code so many assumptions about font sizes in it. On my Haswell system, graphics memory and i/o accesses takes about 520 cycles each so optimizations from unrolling are in the noise. Optimize the direct case to not do anything if there is no overlap with the border. Do a sanity check on the saveunder's coordinates. This requires a previous change to pass non-rounded coordinates. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Wed Apr 12 17:38:00 2017 (r316736) +++ head/sys/dev/syscons/scvgarndr.c Wed Apr 12 18:52:06 2017 (r316737) @@ -159,6 +159,8 @@ RENDERER_MODULE(vga, vga_set); #ifndef SC_NO_CUTPASTE #if !defined(SC_ALT_MOUSE_IMAGE) || defined(SC_PIXEL_MODE) +#define MOUSE_IMAGE_HEIGHT 13 +#define MOUSE_IMAGE_WIDTH 9 static u_short mouse_and_mask[16] = { 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, 0xfe00, 0x1e00, 0x1f00, 0x0f00, 0x0f00, 0x0000, 0x0000, 0x0000 @@ -1100,49 +1102,31 @@ static void remove_pxlmouse_planar(scr_stat *scp, int x, int y) { vm_offset_t p; - int col, row; - int line_width; - int ymax; - int i; + int bx, by, i, line_width, xend, xoff, yend, yoff; /* - * The caller will remove parts of the mouse image over the text - * window better than we can do. Remove only parts over the border. + * It is only necessary to remove the mouse image where it overlaps + * the border. Determine the overlap, and do nothing if it is empty. */ - col = x/8 - scp->xoff; - row = y/scp->font_size - scp->yoff; + bx = (scp->xoff + scp->xsize) * 8; + by = (scp->yoff + scp->ysize) * scp->font_size; + xend = imin(x + MOUSE_IMAGE_WIDTH, scp->xpixel); + yend = imin(y + MOUSE_IMAGE_HEIGHT, scp->ypixel); + if (xend <= bx && yend <= by) + return; + + /* Repaint the non-empty overlap. */ line_width = scp->sc->adp->va_line_width; outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0003); /* data rotate/function select */ outw(GDCIDX, 0x0f01); /* set/reset enable */ outw(GDCIDX, 0xff08); /* bit mask */ outw(GDCIDX, (scp->border << 8) | 0x00); /* set/reset */ - if (row == scp->ysize - 1) { - i = (scp->ysize + scp->yoff)*scp->font_size; - ymax = imin(i + scp->font_size, scp->ypixel); - p = scp->sc->adp->va_window + i*line_width + scp->xoff + col; - if (col < scp->xsize - 1) { - for (; i < ymax; ++i) { - writeb(p, 0); - writeb(p + 1, 0); - p += line_width; - } - } else { - for (; i < ymax; ++i) { - writeb(p, 0); - p += line_width; - } - } - } - if ((col == scp->xsize - 1) && (scp->xoff > 0)) { - i = (row + scp->yoff)*scp->font_size; - ymax = imin(i + scp->font_size*2, scp->ypixel); - p = scp->sc->adp->va_window + i*line_width - + scp->xoff + scp->xsize; - for (; i < ymax; ++i) { + for (i = x / 8, xoff = i * 8; xoff < xend; ++i, xoff += 8) { + yoff = (xoff >= bx) ? y : by; + p = scp->sc->adp->va_window + yoff * line_width + i; + for (; yoff < yend; ++yoff, p += line_width) writeb(p, 0); - p += line_width; - } } outw(GDCIDX, 0x0000); /* set/reset */ outw(GDCIDX, 0x0001); /* set/reset enable */ @@ -1162,6 +1146,16 @@ vga_pxlmouse_direct(scr_stat *scp, int x uint8_t *u8; int bpp; + /* + * Determine overlap with the border and then if removing, do nothing + * if the overlap is empty. + */ + xend = imin(x + 16, scp->xpixel); + yend = imin(y + 16, scp->ypixel); + if (!on && xend <= (scp->xoff + scp->xsize) * 8 && + yend <= (scp->yoff + scp->ysize) * scp->font_size) + return; + bpp = scp->sc->adp->va_info.vi_depth; if ((bpp == 16) && (scp->sc->adp->va_info.vi_pixel_fsizes[1] == 5)) @@ -1170,12 +1164,18 @@ vga_pxlmouse_direct(scr_stat *scp, int x line_width = scp->sc->adp->va_line_width; pixel_size = scp->sc->adp->va_info.vi_pixel_size; - xend = imin(x + 16, scp->xpixel); - yend = imin(y + 16, scp->ypixel); - if (on) goto do_on; + /* + * Repaint overlap with the border and nearby. Unlike in the planar + * case, we kept track of everything under the cursor so can restore + * it all, but we don't completely trust the saved state to be still + * relevant, so do nothing if it is obviously stale. + */ + if (x != x_old || y != y_old || xend != xend_old || yend != yend_old) + return; + p = scp->sc->adp->va_window + y_old * line_width + x_old * pixel_size; for (i = 0; i < (yend_old - y_old); i++) { From owner-svn-src-all@freebsd.org Wed Apr 12 19:23:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F286DD3B746; Wed, 12 Apr 2017 19:23:42 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C29E7295; Wed, 12 Apr 2017 19:23:42 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CJNfFN098470; Wed, 12 Apr 2017 19:23:41 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CJNf6i098469; Wed, 12 Apr 2017 19:23:41 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201704121923.v3CJNf6i098469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Wed, 12 Apr 2017 19:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316738 - head/sbin/mksnap_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 19:23:43 -0000 Author: sobomax Date: Wed Apr 12 19:23:41 2017 New Revision: 316738 URL: https://svnweb.freebsd.org/changeset/base/316738 Log: Fix an issue in the rev.316718 causing variable to be unsed uninitialized. Reported by: Coverity Nudged by: cem MFC after: 2 weeks Modified: head/sbin/mksnap_ffs/mksnap_ffs.c Modified: head/sbin/mksnap_ffs/mksnap_ffs.c ============================================================================== --- head/sbin/mksnap_ffs/mksnap_ffs.c Wed Apr 12 18:52:06 2017 (r316737) +++ head/sbin/mksnap_ffs/mksnap_ffs.c Wed Apr 12 19:23:41 2017 (r316738) @@ -59,13 +59,12 @@ usage(void) } static int -isdir(const char *path) +isdir(const char *path, struct stat *stbufp) { - struct stat stbuf; - if (stat(path, &stbuf) < 0) + if (stat(path, stbufp) < 0) return (-1); - if (!S_ISDIR(stbuf.st_mode)) + if (!S_ISDIR(stbufp->st_mode)) return (0); return (1); } @@ -74,8 +73,9 @@ static int issamefs(const char *path, struct statfs *stfsp) { struct statfs stfsbuf; + struct stat stbuf; - if (isdir(path) != 1) + if (isdir(path, &stbuf) != 1) return (-1); if (statfs(path, &stfsbuf) < 0) return (-1); @@ -123,7 +123,7 @@ main(int argc, char **argv) } if (statfs(path, &stfsbuf) < 0) err(1, "%s", path); - switch (isdir(path)) { + switch (isdir(path, &stbuf)) { case -1: err(1, "%s", path); case 0: From owner-svn-src-all@freebsd.org Wed Apr 12 19:27:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FFA8D3B90F; Wed, 12 Apr 2017 19:27:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D120A6C5; Wed, 12 Apr 2017 19:27:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CJREKS098656; Wed, 12 Apr 2017 19:27:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CJREU8098655; Wed, 12 Apr 2017 19:27:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704121927.v3CJREU8098655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 12 Apr 2017 19:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316739 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 19:27:16 -0000 Author: kib Date: Wed Apr 12 19:27:14 2017 New Revision: 316739 URL: https://svnweb.freebsd.org/changeset/base/316739 Log: Report _SC_SEM_NSEMS_MAX and _SC_SEM_VALUE_MAX which show parameters of the current usermode implementation of the POSIX semaphores. For NSEMS_MAX, return -1 without changing errno, which indicates that the variable has no limit. Before, sysconf(3) returned parameters queried from the ksem(9) legacy implementation, which apparently has low defaults for NSEMS_MAX. Reported and tested by: jbeich Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/sysconf.c Modified: head/lib/libc/gen/sysconf.c ============================================================================== --- head/lib/libc/gen/sysconf.c Wed Apr 12 19:23:41 2017 (r316738) +++ head/lib/libc/gen/sysconf.c Wed Apr 12 19:27:14 2017 (r316739) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include /* we just need the limits */ +#include #include #include #include "un-namespace.h" @@ -299,13 +300,9 @@ do_NAME_MAX: mib[1] = CTL_P1003_1B_RTSIG_MAX; goto yesno; case _SC_SEM_NSEMS_MAX: - mib[0] = CTL_P1003_1B; - mib[1] = CTL_P1003_1B_SEM_NSEMS_MAX; - goto yesno; + return (-1); case _SC_SEM_VALUE_MAX: - mib[0] = CTL_P1003_1B; - mib[1] = CTL_P1003_1B_SEM_VALUE_MAX; - goto yesno; + return (SEM_VALUE_MAX); case _SC_SIGQUEUE_MAX: mib[0] = CTL_P1003_1B; mib[1] = CTL_P1003_1B_SIGQUEUE_MAX; From owner-svn-src-all@freebsd.org Wed Apr 12 20:08:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EDF1D3A7FE; Wed, 12 Apr 2017 20:08:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E03F2639; Wed, 12 Apr 2017 20:08:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CK8eMf015487; Wed, 12 Apr 2017 20:08:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CK8eXZ015485; Wed, 12 Apr 2017 20:08:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704122008.v3CK8eXZ015485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 12 Apr 2017 20:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316740 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 20:08:41 -0000 Author: ngie Date: Wed Apr 12 20:08:39 2017 New Revision: 316740 URL: https://svnweb.freebsd.org/changeset/base/316740 Log: Clarify `minfree` warning message in check_space(..) - State that the units are kB. - Be more complete/concise in terms of what is required (in this case `minfree` must be at least `X`kB) MFC after: 7 weeks Sponsored by: Dell EMC Isilon Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Apr 12 19:27:14 2017 (r316739) +++ head/sbin/savecore/savecore.c Wed Apr 12 20:08:39 2017 (r316740) @@ -303,7 +303,8 @@ check_space(const char *savedir, off_t d needed -= saved_dump_size(bounds); if ((minfree > 0 ? spacefree : totfree) - needed < minfree) { syslog(LOG_WARNING, - "no dump, not enough free space on device (%lld available, need %lld)", + "no dump: not enough free space on device (%lldkB " + "available; need at least %lldkB)", (long long)(minfree > 0 ? spacefree : totfree), (long long)needed); return (0); From owner-svn-src-all@freebsd.org Wed Apr 12 20:18:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE608D3AACD; Wed, 12 Apr 2017 20:18:39 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99E8CC44; Wed, 12 Apr 2017 20:18:39 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CKIcp5019867; Wed, 12 Apr 2017 20:18:38 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CKIcHe019866; Wed, 12 Apr 2017 20:18:38 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704122018.v3CKIcHe019866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 12 Apr 2017 20:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316741 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 20:18:39 -0000 Author: bde Date: Wed Apr 12 20:18:38 2017 New Revision: 316741 URL: https://svnweb.freebsd.org/changeset/base/316741 Log: Improve drawing of the vga planar mode mouse image a little. Unobfuscate the method a lot. Reduce the AND mask to the complement of the cursor's frame, so that area inside the frame is not drawn first in black and then in lightwhite. The AND-OR method is only directly suitable for the text mouse image, since it doesn't go to the hardware there. Planar mode Mouse cursor drawing takes 10-20 usec on my Haswell system (approx. 100 graphics accesses at 130 nsec each), so the transient was not visible. The method used the fancy read mode 1 and its color compare and color don't care registers with value 0 in them so that all colors matched. All that this did was make byte reads of frame buffer memory return 0xff, so that the x86 case could obfuscate read+write as "and". The read must be done for its side effect on the graphics controller but is not used, except it must return 0xff to avoid affecting the write when the write is obfuscated as a read-modify-write "and". Perhaps that was a good optimization for 8088 CPUs where each extra instruction byte took as long as a byte memory access. Just use read+write after removing the fancy read mode. Remove x86 ifdefs that did the "and". After removing the "and" in the non-x86 part of the ifdefs, fix 4 of 6 cases where the shift was wrong. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Wed Apr 12 20:08:39 2017 (r316740) +++ head/sys/dev/syscons/scvgarndr.c Wed Apr 12 20:18:38 2017 (r316741) @@ -1038,34 +1038,26 @@ draw_pxlmouse_planar(scr_stat *scp, int yoff = y - rounddown(y, line_width); ymax = imin(y + 16, scp->ypixel); - outw(GDCIDX, 0x0805); /* read mode 1, write mode 0 */ + outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0001); /* set/reset enable */ - outw(GDCIDX, 0x0002); /* color compare */ - outw(GDCIDX, 0x0007); /* color don't care */ outw(GDCIDX, 0xff08); /* bit mask */ outw(GDCIDX, 0x0803); /* data rotate/function select (and) */ p = scp->sc->adp->va_window + line_width*y + x/8; if (x < scp->xpixel - 8) { for (i = y, j = 0; i < ymax; ++i, ++j) { - m = ~(mouse_and_mask[j] >> xoff); -#if defined(__i386__) || defined(__amd64__) - *(u_char *)p &= m >> 8; - *(u_char *)(p + 1) &= m; -#else - writeb(p, readb(p) & (m >> 8)); - writeb(p + 1, readb(p + 1) & (m >> 8)); -#endif + m = ~((mouse_and_mask[j] & ~mouse_or_mask[j]) >> xoff); + readb(p); + writeb(p, m >> 8); + readb(p + 1); + writeb(p + 1, m); p += line_width; } } else { xoff += 8; for (i = y, j = 0; i < ymax; ++i, ++j) { - m = ~(mouse_and_mask[j] >> xoff); -#if defined(__i386__) || defined(__amd64__) - *(u_char *)p &= m; -#else - writeb(p, readb(p) & (m >> 8)); -#endif + m = ~((mouse_and_mask[j] & ~mouse_or_mask[j]) >> xoff); + readb(p); + writeb(p, m); p += line_width; } } @@ -1074,27 +1066,20 @@ draw_pxlmouse_planar(scr_stat *scp, int if (x < scp->xpixel - 8) { for (i = y, j = 0; i < ymax; ++i, ++j) { m = mouse_or_mask[j] >> xoff; -#if defined(__i386__) || defined(__amd64__) - *(u_char *)p &= m >> 8; - *(u_char *)(p + 1) &= m; -#else - writeb(p, readb(p) & (m >> 8)); - writeb(p + 1, readb(p + 1) & (m >> 8)); -#endif + readb(p); + writeb(p, m >> 8); + readb(p + 1); + writeb(p + 1, m); p += line_width; } } else { for (i = y, j = 0; i < ymax; ++i, ++j) { m = mouse_or_mask[j] >> xoff; -#if defined(__i386__) || defined(__amd64__) - *(u_char *)p &= m; -#else - writeb(p, readb(p) & (m >> 8)); -#endif + readb(p); + writeb(p, m); p += line_width; } } - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0003); /* data rotate/function select */ } From owner-svn-src-all@freebsd.org Wed Apr 12 20:20:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFAB5D3AB71; Wed, 12 Apr 2017 20:20:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B01AFDB9; Wed, 12 Apr 2017 20:20:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CKK49e019980; Wed, 12 Apr 2017 20:20:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CKK4bt019979; Wed, 12 Apr 2017 20:20:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704122020.v3CKK4bt019979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 12 Apr 2017 20:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316742 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 20:20:06 -0000 Author: ngie Date: Wed Apr 12 20:20:04 2017 New Revision: 316742 URL: https://svnweb.freebsd.org/changeset/base/316742 Log: Clarify units for mediasize and sectorsize in DoFile(..) They're byte quantities. MFC after: 7 weeks Sponsored by: Dell EMC Isilon Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Apr 12 20:18:38 2017 (r316741) +++ head/sbin/savecore/savecore.c Wed Apr 12 20:20:04 2017 (r316742) @@ -519,8 +519,8 @@ DoFile(const char *savedir, const char * } if (verbose) { - printf("mediasize = %lld\n", (long long)mediasize); - printf("sectorsize = %u\n", sectorsize); + printf("mediasize = %lld bytes\n", (long long)mediasize); + printf("sectorsize = %u bytes\n", sectorsize); } if (sectorsize < sizeof(kdhl)) { From owner-svn-src-all@freebsd.org Wed Apr 12 20:27:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2282D3AD79; Wed, 12 Apr 2017 20:27:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF44C321; Wed, 12 Apr 2017 20:27:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CKRF3x023860; Wed, 12 Apr 2017 20:27:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CKRFTn023858; Wed, 12 Apr 2017 20:27:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201704122027.v3CKRFTn023858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 12 Apr 2017 20:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316743 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 20:27:17 -0000 Author: tuexen Date: Wed Apr 12 20:27:15 2017 New Revision: 316743 URL: https://svnweb.freebsd.org/changeset/base/316743 Log: The sysctl variable net.inet.tcp.drop_synfin is not honored in all states, for example not in SYN-SENT. This patch adds code to check the sysctl variable in other states than LISTEN. Thanks to ae and gnn for providing comments. Reviewed by: gnn MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D9894 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Apr 12 20:20:04 2017 (r316742) +++ head/sys/netinet/tcp_input.c Wed Apr 12 20:27:15 2017 (r316743) @@ -1613,6 +1613,16 @@ tcp_do_segment(struct mbuf *m, struct tc tcp_pcap_add(th, m, &(tp->t_inpkts)); #endif + if ((thflags & TH_SYN) && (thflags & TH_FIN) && V_drop_synfin) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: " + "SYN|FIN segment ignored (based on " + "sysctl setting)\n", s, __func__); + free(s, M_TCPLOG); + } + goto drop; + } + /* * Segment received on connection. * Reset idle time and keep-alive timer. Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Wed Apr 12 20:20:04 2017 (r316742) +++ head/sys/netinet/tcp_stacks/fastpath.c Wed Apr 12 20:27:15 2017 (r316743) @@ -132,6 +132,8 @@ VNET_DECLARE(int, tcp_insecure_rst); #define V_tcp_insecure_rst VNET(tcp_insecure_rst) VNET_DECLARE(int, tcp_insecure_syn); #define V_tcp_insecure_syn VNET(tcp_insecure_syn) +VNET_DECLARE(int, drop_synfin); +#define V_drop_synfin VNET(drop_synfin) static void tcp_do_segment_fastslow(struct mbuf *, struct tcphdr *, struct socket *, struct tcpcb *, int, int, uint8_t, @@ -1729,7 +1731,6 @@ tcp_do_segment_fastslow(struct mbuf *m, struct tcpopt to; thflags = th->th_flags; - tp->sackhint.last_sack_ack = 0; inc = &tp->t_inpcb->inp_inc; nsegs = max(1, m->m_pkthdr.lro_nsegs); /* @@ -1760,6 +1761,23 @@ tcp_do_segment_fastslow(struct mbuf *m, KASSERT(tp->t_state != TCPS_TIME_WAIT, ("%s: TCPS_TIME_WAIT", __func__)); + if ((thflags & TH_SYN) && (thflags & TH_FIN) && V_drop_synfin) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: " + "SYN|FIN segment ignored (based on " + "sysctl setting)\n", s, __func__); + free(s, M_TCPLOG); + } + if (ti_locked == TI_RLOCKED) { + INP_INFO_RUNLOCK(&V_tcbinfo); + } + INP_WUNLOCK(tp->t_inpcb); + m_freem(m); + return; + } + + tp->sackhint.last_sack_ack = 0; + /* * Segment received on connection. * Reset idle time and keep-alive timer. @@ -2175,7 +2193,6 @@ tcp_do_segment_fastack(struct mbuf *m, s struct tcpopt to; thflags = th->th_flags; - tp->sackhint.last_sack_ack = 0; inc = &tp->t_inpcb->inp_inc; /* * If this is either a state-changing packet or current state isn't @@ -2205,6 +2222,23 @@ tcp_do_segment_fastack(struct mbuf *m, s KASSERT(tp->t_state != TCPS_TIME_WAIT, ("%s: TCPS_TIME_WAIT", __func__)); + if ((thflags & TH_SYN) && (thflags & TH_FIN) && V_drop_synfin) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: " + "SYN|FIN segment ignored (based on " + "sysctl setting)\n", s, __func__); + free(s, M_TCPLOG); + } + if (ti_locked == TI_RLOCKED) { + INP_INFO_RUNLOCK(&V_tcbinfo); + } + INP_WUNLOCK(tp->t_inpcb); + m_freem(m); + return; + } + + tp->sackhint.last_sack_ack = 0; + /* * Segment received on connection. * Reset idle time and keep-alive timer. From owner-svn-src-all@freebsd.org Wed Apr 12 21:15:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12E62D3BA20; Wed, 12 Apr 2017 21:15:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7806F47; Wed, 12 Apr 2017 21:15:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CLFtVK044575; Wed, 12 Apr 2017 21:15:55 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CLFtSY044574; Wed, 12 Apr 2017 21:15:55 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201704122115.v3CLFtSY044574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 12 Apr 2017 21:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316744 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 21:15:57 -0000 Author: jilles Date: Wed Apr 12 21:15:55 2017 New Revision: 316744 URL: https://svnweb.freebsd.org/changeset/base/316744 Log: sh: Reduce size of limits table. Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Wed Apr 12 20:27:15 2017 (r316743) +++ head/bin/sh/miscbltin.c Wed Apr 12 21:15:55 2017 (r316744) @@ -367,7 +367,7 @@ struct limits { const char *name; const char *units; int cmd; - int factor; /* multiply by to get rlim_{cur,max} values */ + short factor; /* multiply by to get rlim_{cur,max} values */ char option; }; From owner-svn-src-all@freebsd.org Wed Apr 12 21:37:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14297D3BE33; Wed, 12 Apr 2017 21:37:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE471A7C; Wed, 12 Apr 2017 21:37:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3CLbCOr052530; Wed, 12 Apr 2017 21:37:12 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3CLbCoA052529; Wed, 12 Apr 2017 21:37:12 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704122137.v3CLbCoA052529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 12 Apr 2017 21:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316745 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 21:37:14 -0000 Author: rmacklem Date: Wed Apr 12 21:37:12 2017 New Revision: 316745 URL: https://svnweb.freebsd.org/changeset/base/316745 Log: Fix the NFS client for "text file modified, process killed" mmap'd case. When an mmap'd text file is written and then executed immediately afterwards, it was possible that the modify time would change after the text file was executing, resulting in the process executing the file being killed. This was usually only observed when the file system's times were set to higher resolution, but could have occurred for any time resolution. This was reported on a recent email list discussion. This patch adds a VOP_SET_TEXT() to the NFS client which flushed all dirty pages to the NFS server and then makes sure that n_mtime is up to date to avoid this from occurring. Thanks go to kib@ and pho@ for their help with developing this patch. Tested by: pho Reviewed by: kib MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Apr 12 21:15:55 2017 (r316744) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Apr 12 21:37:12 2017 (r316745) @@ -140,6 +140,7 @@ static vop_advlock_t nfs_advlock; static vop_advlockasync_t nfs_advlockasync; static vop_getacl_t nfs_getacl; static vop_setacl_t nfs_setacl; +static vop_set_text_t nfs_set_text; /* * Global vfs data structures for nfs @@ -176,6 +177,7 @@ struct vop_vector newnfs_vnodeops = { .vop_write = ncl_write, .vop_getacl = nfs_getacl, .vop_setacl = nfs_setacl, + .vop_set_text = nfs_set_text, }; struct vop_vector newnfs_fifoops = { @@ -3381,6 +3383,39 @@ nfs_setacl(struct vop_setacl_args *ap) return (error); } +static int +nfs_set_text(struct vop_set_text_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct nfsnode *np; + + /* + * If the text file has been mmap'd, flush any dirty pages to the + * buffer cache and then... + * Make sure all writes are pushed to the NFS server. If this is not + * done, the modify time of the file can change while the text + * file is being executed. This will cause the process that is + * executing the text file to be terminated. + */ + if (vp->v_object != NULL) { + VM_OBJECT_WLOCK(vp->v_object); + vm_object_page_clean(vp->v_object, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(vp->v_object); + } + + /* Now, flush the buffer cache. */ + ncl_flush(vp, MNT_WAIT, NULL, curthread, 0, 0); + + /* And, finally, make sure that n_mtime is up to date. */ + np = VTONFS(vp); + mtx_lock(&np->n_mtx); + np->n_mtime = np->n_vattr.na_mtime; + mtx_unlock(&np->n_mtx); + + vp->v_vflag |= VV_TEXT; + return (0); +} + /* * Return POSIX pathconf information applicable to nfs filesystems. */ From owner-svn-src-all@freebsd.org Thu Apr 13 00:07:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BF4DD3B39A; Thu, 13 Apr 2017 00:07:41 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4385F25; Thu, 13 Apr 2017 00:07:40 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3D07epG014410; Thu, 13 Apr 2017 00:07:40 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3D07eQ9014409; Thu, 13 Apr 2017 00:07:40 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201704130007.v3D07eQ9014409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 13 Apr 2017 00:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316746 - head/share/examples/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 00:07:41 -0000 Author: allanjude Date: Thu Apr 13 00:07:39 2017 New Revision: 316746 URL: https://svnweb.freebsd.org/changeset/base/316746 Log: Add UEFI support to vmrun.sh Adds: -E: Use UEFI mode -f: path to UEFI firmware image (default: path to uefi-edk2-bhyve package) -F: UEFI framebuffer size (default: w=1024,h=768) -L: IP to listen for VNC connections on (default: 127.0.0.1) -P: Port to listen for VNC connections on (default: 5900) -T: Enable tablnet device (for VNC) -v: Wait for VNC client before booting VM Submitted by: Shawn Webb MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D10378 Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Wed Apr 12 21:37:12 2017 (r316745) +++ head/share/examples/bhyve/vmrun.sh Thu Apr 13 00:07:39 2017 (r316746) @@ -46,10 +46,12 @@ errmsg() { usage() { local msg=$1 - echo "Usage: vmrun.sh [-ahi] [-c ] [-C ] [-d ]" - echo " [-e ] [-g ] [-H ]" + echo "Usage: vmrun.sh [-aEhiTv] [-c ] [-C ] [-d ]" + echo " [-e ] [-f ] [-F ]" + echo " [-g ] [-H ]" echo " [-I ] [-l ]" - echo " [-m ] [-t ] " + echo " [-L ]" + echo " [-m ] [-P ] [-t ] " echo "" echo " -h: display this help message" echo " -a: force memory mapped local APIC access" @@ -57,15 +59,22 @@ usage() { echo " -C: console device (default is ${DEFAULT_CONSOLE})" echo " -d: virtio diskdev file (default is ${DEFAULT_VIRTIO_DISK})" echo " -e: set FreeBSD loader environment variable" + echo " -E: Use UEFI mode" + echo " -f: Use a specific UEFI firmware" + echo " -F: Use a custom UEFI GOP framebuffer size (default: w=1024,h=768)" echo " -g: listen for connection from kgdb at " echo " -H: host filesystem to export to the loader" echo " -i: force boot of the Installation CDROM image" echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" echo " -l: the OS loader to use (default is /boot/userboot.so)" + echo " -L: IP address for UEFI GOP VNC server (default: 127.0.0.1)" echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" echo " -p: pass-through a host PCI device at bus/slot/func (e.g. 10/0/0)" + echo " -P: UEFI GOP VNC port (default: 5900)" echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" + echo " -T: Enable tablet device (for UEFI GOP)" echo " -u: RTC keeps UTC time" + echo " -v: Wait for VNC client connection before booting VM" echo " -w: ignore unimplemented MSRs" echo "" [ -n "$msg" ] && errmsg "$msg" @@ -95,7 +104,16 @@ loader_opt="" bhyverun_opt="-H -A -P" pass_total=0 -while getopts ac:C:d:e:g:hH:iI:l:m:p:t:uw c ; do +# EFI-specific options +efi_mode=0 +efi_firmware="/usr/local/share/uefi-firmware/BHYVE_UEFI.fd" +vncwait="" +vnchost="127.0.0.1" +vncport=5900 +fbsize="w=1024,h=768" +tablet="" + +while getopts ac:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c ; do case $c in a) bhyverun_opt="${bhyverun_opt} -a" @@ -116,6 +134,15 @@ while getopts ac:C:d:e:g:hH:iI:l:m:p:t:u e) loader_opt="${loader_opt} -e ${OPTARG}" ;; + E) + efi_mode=1 + ;; + f) + efi_firmware="${OPTARG}" + ;; + F) + fbsize="${OPTARG}" + ;; g) gdbport=${OPTARG} ;; @@ -131,6 +158,9 @@ while getopts ac:C:d:e:g:hH:iI:l:m:p:t:u l) loader_opt="${loader_opt} -l ${OPTARG}" ;; + L) + vnchost="${OPTARG}" + ;; m) memsize=${OPTARG} ;; @@ -138,13 +168,22 @@ while getopts ac:C:d:e:g:hH:iI:l:m:p:t:u eval "pass_dev${pass_total}=\"${OPTARG}\"" pass_total=$(($pass_total + 1)) ;; + P) + vncport="${OPTARG}" + ;; t) eval "tap_dev${tap_total}=\"${OPTARG}\"" tap_total=$(($tap_total + 1)) ;; + T) + tablet="-s 30,xhci,tablet" + ;; u) bhyverun_opt="${bhyverun_opt} -u" ;; + v) + vncwait=",wait" + ;; w) bhyverun_opt="${bhyverun_opt} -w" ;; @@ -181,6 +220,13 @@ if [ ${pass_total} -gt 0 ]; then bhyverun_opt="${bhyverun_opt} -S" fi +if [ ${efi_mode} -gt 0 ]; then + if [ ! -f ${efi_firmware} ]; then + echo "Error: EFI Firmware ${efi_firmware} doesn't exist. Try: pkg install uefi-edk2-bhyve" + exit 1 + fi +fi + make_and_check_diskdev() { local virtio_diskdev="$1" @@ -243,11 +289,13 @@ while [ 1 ]; do installer_opt="" fi - ${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \ - ${vmname} - bhyve_exit=$? - if [ $bhyve_exit -ne 0 ]; then - break + if [ ${efi_mode} -eq 0 ]; then + ${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \ + ${vmname} + bhyve_exit=$? + if [ $bhyve_exit -ne 0 ]; then + break + fi fi # @@ -281,10 +329,18 @@ while [ 1 ]; do i=$(($i + 1)) done + efiargs="" + if [ ${efi_mode} -gt 0 ]; then + efiargs="-s 29,fbuf,tcp=${vnchost}:${vncport},${fbsize}${vncwait}" + efiargs="${efiargs} -l bootrom,${efi_firmware}" + efiargs="${efiargs} ${tablet}" + fi + ${FBSDRUN} -c ${cpus} -m ${memsize} ${bhyverun_opt} \ -g ${gdbport} \ -s 0:0,hostbridge \ -s 1:0,lpc \ + ${efiargs} \ ${devargs} \ -l com1,${console} \ ${installer_opt} \ From owner-svn-src-all@freebsd.org Thu Apr 13 01:17:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78C68D38AB4; Thu, 13 Apr 2017 01:17:50 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48EDC96E; Thu, 13 Apr 2017 01:17:50 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3D1HnBq042516; Thu, 13 Apr 2017 01:17:49 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3D1Hntp042515; Thu, 13 Apr 2017 01:17:49 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201704130117.v3D1Hntp042515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 13 Apr 2017 01:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316747 - head/sys/dev/qlnx/qlnxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 01:17:50 -0000 Author: davidcs Date: Thu Apr 13 01:17:49 2017 New Revision: 316747 URL: https://svnweb.freebsd.org/changeset/base/316747 Log: Fix rss_ind_table entry for num_funcs > 1 MFC after:3 days Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Thu Apr 13 00:07:39 2017 (r316746) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Thu Apr 13 01:17:49 2017 (r316747) @@ -5840,7 +5840,7 @@ qlnx_update_vport(struct ecore_dev *cdev ha->num_rss; fp = &ha->fp_array[fp_index]; - rss->rss_ind_table[i] = fp->rxq->handle; + rss->rss_ind_table[j] = fp->rxq->handle; } for (j = 0; j < ECORE_RSS_IND_TABLE_SIZE;) { From owner-svn-src-all@freebsd.org Thu Apr 13 01:36:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F8CD3A166; Thu, 13 Apr 2017 01:36:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 444F4684; Thu, 13 Apr 2017 01:36:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3D1apWb050321; Thu, 13 Apr 2017 01:36:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3D1apqv050320; Thu, 13 Apr 2017 01:36:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704130136.v3D1apqv050320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 13 Apr 2017 01:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316748 - stable/11/contrib/elftoolchain/elfcopy X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 01:36:52 -0000 Author: emaste Date: Thu Apr 13 01:36:51 2017 New Revision: 316748 URL: https://svnweb.freebsd.org/changeset/base/316748 Log: MFC r316284: elfcopy: remove temporary ELF file when converting from binary Previously a command like objcopy --input-target binary --output-target elf64-x86-64-freebsd \ binary_file object.o would leave a temporary file behind. ELF Tool Chain ticket #543 Modified: stable/11/contrib/elftoolchain/elfcopy/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/main.c Thu Apr 13 01:17:49 2017 (r316747) +++ stable/11/contrib/elftoolchain/elfcopy/main.c Thu Apr 13 01:36:51 2017 (r316748) @@ -674,6 +674,8 @@ create_file(struct elfcopy *ecp, const c if ((ifd = open(elftemp, O_RDONLY)) == -1) err(EXIT_FAILURE, "open %s failed", src); close(efd); + if (unlink(elftemp) < 0) + err(EXIT_FAILURE, "unlink %s failed", elftemp); free(elftemp); } From owner-svn-src-all@freebsd.org Thu Apr 13 01:56:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22079D3A694; Thu, 13 Apr 2017 01:56:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAD06EE0; Thu, 13 Apr 2017 01:56:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3D1uFPL058486; Thu, 13 Apr 2017 01:56:15 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3D1uFws058484; Thu, 13 Apr 2017 01:56:15 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704130156.v3D1uFws058484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 13 Apr 2017 01:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316749 - in head/sys/dev/drm2: . i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 01:56:17 -0000 Author: cem Date: Thu Apr 13 01:56:15 2017 New Revision: 316749 URL: https://svnweb.freebsd.org/changeset/base/316749 Log: drm2: Add some missing PCIIDs for some Haswell systems Submitted by: Jia-Shiun Li Modified: head/sys/dev/drm2/drm_pciids.h head/sys/dev/drm2/i915/i915_drv.c Modified: head/sys/dev/drm2/drm_pciids.h ============================================================================== --- head/sys/dev/drm2/drm_pciids.h Thu Apr 13 01:36:51 2017 (r316748) +++ head/sys/dev/drm2/drm_pciids.h Thu Apr 13 01:56:15 2017 (r316749) @@ -54,6 +54,7 @@ {0x8086, 0x0412, 0, "Intel Haswell (GT2 desktop)"}, \ {0x8086, 0x0416, 0, "Intel Haswell (GT2 mobile)"}, \ {0x8086, 0x041A, 0, "Intel Haswell (GT2 server)"}, \ + {0x8086, 0x041E, 0, "Intel Haswell (GT2 desktop)"}, \ {0x8086, 0x0422, 0, "Intel Haswell (GT2 desktop)"}, \ {0x8086, 0x0426, 0, "Intel Haswell (GT2 mobile)"}, \ {0x8086, 0x042A, 0, "Intel Haswell (GT2 server)"}, \ Modified: head/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.c Thu Apr 13 01:36:51 2017 (r316748) +++ head/sys/dev/drm2/i915/i915_drv.c Thu Apr 13 01:56:15 2017 (r316749) @@ -380,6 +380,7 @@ static const struct intel_gfx_device_id INTEL_VGA_DEVICE(0x016a, &intel_ivybridge_d_info), /* GT2 server */ INTEL_VGA_DEVICE(0x0402, &intel_haswell_d_info), /* GT1 desktop */ INTEL_VGA_DEVICE(0x0412, &intel_haswell_d_info), /* GT2 desktop */ + INTEL_VGA_DEVICE(0x041e, &intel_haswell_d_info), /* GT2 desktop */ INTEL_VGA_DEVICE(0x0422, &intel_haswell_d_info), /* GT2 desktop */ INTEL_VGA_DEVICE(0x040a, &intel_haswell_d_info), /* GT1 server */ INTEL_VGA_DEVICE(0x041a, &intel_haswell_d_info), /* GT2 server */ From owner-svn-src-all@freebsd.org Thu Apr 13 04:10:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 770D4D3BE87; Thu, 13 Apr 2017 04:10:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39574A72; Thu, 13 Apr 2017 04:10:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3D4ARjQ013812; Thu, 13 Apr 2017 04:10:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3D4AR7T013811; Thu, 13 Apr 2017 04:10:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704130410.v3D4AR7T013811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 13 Apr 2017 04:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316750 - head/contrib/netbsd-tests/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 04:10:28 -0000 Author: ngie Date: Thu Apr 13 04:10:27 2017 New Revision: 316750 URL: https://svnweb.freebsd.org/changeset/base/316750 Log: Fix expectations for testcases per bsdgrep vs gnu grep from base/ports The following failures occur with various versions of grep: BSD grep: - :context - :context2 GNU grep (base): - :color - :oflag_zerolen GNU grep (ports): - :recurse_symlink Tested with: bsdgrep (^/head@r316542), gnu grep (base/2.5.1), gnu grep (ports/2.27) Reported by: Jenkins (bsdgrep failures) Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Apr 13 01:56:15 2017 (r316749) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Apr 13 04:10:27 2017 (r316750) @@ -69,6 +69,12 @@ recurse_symlink_head() } recurse_symlink_body() { + # Begin FreeBSD + grep_type + if [ $? -eq $GREP_TYPE_GNU ]; then + atf_expect_fail "this test doesn't pass with gnu grep from ports" + fi + # End FreeBSD mkdir -p test/c/d (cd test/c/d && ln -s ../d .) echo "Test string" > test/c/match @@ -153,6 +159,12 @@ context_head() } context_body() { + # Begin FreeBSD + grep_type + if [ $? -eq $GREP_TYPE_BSD ]; then + atf_expect_fail "this test doesn't pass with BSD grep yet" + fi + # End FreeBSD cp $(atf_get_srcdir)/d_context_*.* . atf_check -o file:d_context_a.out grep -C2 bamboo d_context_a.in @@ -214,6 +226,12 @@ context2_head() } context2_body() { + # Begin FreeBSD + grep_type + if [ $? -eq $GREP_TYPE_BSD ]; then + atf_expect_fail "this test doesn't pass with BSD grep yet" + fi + # End FreeBSD printf "haddock\000cod\000plaice\000" > test1 printf "mackeral\000cod\000crab\000" > test2 @@ -227,6 +245,38 @@ context2_body() grep -z -C1 cod test1 test2 } # Begin FreeBSD + +# What grep(1) are we working with? +# - 0 : bsdgrep +# - 1 : gnu grep 2.51 (base) +# - 2 : gnu grep (ports) +GREP_TYPE_BSD=0 +GREP_TYPE_GNU_FREEBSD=1 +GREP_TYPE_GNU=2 +GREP_TYPE_UNKNOWN=3 + +grep_type() +{ + local grep_version=$(grep --version) + + case "$grep_version" in + *"BSD grep"*) + return $GREP_TYPE_BSD + ;; + *"GNU grep"*) + case "$grep_version" in + *2.5.1-FreeBSD*) + return $GREP_TYPE_GNU_FREEBSD + ;; + *) + return $GREP_TYPE_GNU + ;; + esac + ;; + esac + atf_fail "unknown grep type: $grep_version" +} + atf_test_case oflag_zerolen oflag_zerolen_head() { @@ -234,6 +284,11 @@ oflag_zerolen_head() } oflag_zerolen_body() { + grep_type + if [ $? -eq $GREP_TYPE_GNU_FREEBSD ]; then + atf_expect_fail "this test doesn't pass with gnu grep in base" + fi + atf_check -o file:"$(atf_get_srcdir)/d_oflag_zerolen_a.out" \ grep -Eo '(^|:)0*' "$(atf_get_srcdir)/d_oflag_zerolen_a.in" @@ -271,6 +326,11 @@ color_head() } color_body() { + grep_type + if [ $? -eq $GREP_TYPE_GNU_FREEBSD ]; then + atf_expect_fail "this test doesn't pass with gnu grep in base" + fi + echo 'abcd*' > grepfile echo 'abc$' >> grepfile echo '^abc' >> grepfile From owner-svn-src-all@freebsd.org Thu Apr 13 04:17:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2714D3B1E8; Thu, 13 Apr 2017 04:17:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92322216; Thu, 13 Apr 2017 04:17:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id a188so8349202pfa.2; Wed, 12 Apr 2017 21:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=ExHWzLmus0zbe26GquCQtyEKWj9Coo7X2HPwOuvIz2I=; b=DfBcUifN4maevJT9v/G5lt2YUu7HlfIUtlyMfY6fut1aavTLLFuzY+KuzwhPRvty1f 7IZ33dnvUuVbc4vT3e3yvnnRyDrcv7nv+ZBKVvGxVMHpFEBts1Xwc6YzSG5BREV+Hf1s grENq2XUho+ztkXvvVXQms6XW0iWtN+avj2d+i+xSs3UMu4YqDpnlIuCw3hJL7hw4SOz PBXMqZ0fEp26xx3ZDdyiMlDU4UM3MK/ouRVULgEohuiDpf7ICs7g8YeSqeR1E2yiDNfA +pxmdF4rGwyZax/dKF3+ajoVLhwnwYfm5n/qenuN/FCE0YT0KWlWIAs/4mhNNb7vD3Ct l9vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=ExHWzLmus0zbe26GquCQtyEKWj9Coo7X2HPwOuvIz2I=; b=PvKSBJFFnzCbLtQDsc1BFETMJVgEyJPOxNZ9mst9pPnfOy+DleDark7VM4BMGSmuTZ D0W0qJ7GCStCyTuG+MEyblfpcm2UCllx3VRvyznpTvI5OeefVHE/ItQ1Nh9TAOyulvdC ZyAITBm16OiPn6gaSWmb9RPtR4F9hlcRZvXismbX8aZBtwnU1esWAgnOPgt7AOAZv/n8 L1IUSIW9KemWbMXA4fr2qXHU/sT4qzK2u26HIQaMEMPC37uVELvuqdmM0xeIf/gr0dlR ZI7ra4jVEzUy0Fd4vvDEm37+nYTNbXarM5I79RvILn8iDrrJJseBs6tqf9ER5bxSzFb0 Gjpw== X-Gm-Message-State: AN3rC/6vsLSzpX0YxkMINgYh+FIjQxn1jCCATkuXNjFkEBgTZP80pDmM pXyHxwGeYWpPeJYYVio= X-Received: by 10.99.111.138 with SMTP id k132mr1255869pgc.138.1492057054025; Wed, 12 Apr 2017 21:17:34 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id e5sm39209081pga.13.2017.04.12.21.17.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Apr 2017 21:17:33 -0700 (PDT) Subject: Re: svn commit: r316750 - head/contrib/netbsd-tests/usr.bin/grep Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_EE7EF8DB-89B5-43B5-A576-D1BA76896037"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201704130410.v3D4AR7T013811@repo.freebsd.org> Date: Wed, 12 Apr 2017 21:17:32 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201704130410.v3D4AR7T013811@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 04:17:34 -0000 --Apple-Mail=_EE7EF8DB-89B5-43B5-A576-D1BA76896037 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 12, 2017, at 21:10, Ngie Cooper wrote: >=20 > Author: ngie > Date: Thu Apr 13 04:10:27 2017 > New Revision: 316750 > URL: https://svnweb.freebsd.org/changeset/base/316750 =E2=80=A6 > Reported by: Jenkins (bsdgrep failures) Slight correction: Jenkins is reporting failures with gnu grep from = base, not bsdgrep, since bsdgrep is still not the default grep. Thanks, -Ngie --Apple-Mail=_EE7EF8DB-89B5-43B5-A576-D1BA76896037 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY7vvcAAoJEPWDqSZpMIYVpJ4P/2LXa60ljSd8D07BYDzsoQDP tj5tcRVl3T4/zyEU9dHx5Pi2vkyFhnvLIhRGBPsIL65VOOoIkfraBknvPzjrvaC2 BaW5HwOkdKRFlGbaOrF1OIkW+ADlucBOS5+iAL4LMAf8h/0ZtSfloujlf/LeGx6c hQJiLhRDe4dhkoOlPxsk7z0LTr1gPhK++s0VnTvO6f4pGRtyTm7G+JG5Vm8i4a6F YJ1d5DPyHBz+hQhg9FWHsqHjOMuJ+Vti77O+P/rZuLcCO2Z0YfjmUBuCl+wp8RKF GNd2lBnOA8e6JkGs46PZeQzkaZvCrLogsoFoAf34lMKHroUDxxtFX6+V3up1a87K 5wf+Bn9aGpYANagfeYqwx0EUic4hOR2b61XSDIcbzRIHnMPnQzKkdBoYHtmLXGML YnRGwhl5fYS0zVk+xVxqFDK86TsFU+e5w4Y6Z5iucg8kIlQ/kLtHNY8xf78FkBKJ GucYqRZenRGHd1bDmCgkSBJ+yi3ROvmJrBlFyKNgxXVd7buOAt4GfrbUTCVqxe1Q taP5q3mYD51LxcY69dywt92er3pHvsDX+pYQdImiLDDv+p3V5ijvjpSgalOr8fXB /2nkO6dEbgL4mqvYkw8oxWG9gyB0Azdhd8vx97DYomrtbN12zVy3ySfeGhrAqcod rKNU5Lz2sq5iJ+Syj6eu =oyHC -----END PGP SIGNATURE----- --Apple-Mail=_EE7EF8DB-89B5-43B5-A576-D1BA76896037-- From owner-svn-src-all@freebsd.org Thu Apr 13 05:47:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAB44D3B7B8; Thu, 13 Apr 2017 05:47:53 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89888C05; Thu, 13 Apr 2017 05:47:53 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3D5lqDP054511; Thu, 13 Apr 2017 05:47:52 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3D5lqKj054510; Thu, 13 Apr 2017 05:47:52 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201704130547.v3D5lqKj054510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 13 Apr 2017 05:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316751 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 05:47:53 -0000 Author: jpaetzel Date: Thu Apr 13 05:47:52 2017 New Revision: 316751 URL: https://svnweb.freebsd.org/changeset/base/316751 Log: 5661 ZFS: "compression = on" should use lz4 if feature is enabled Reviewed by: Matthew Ahrens Reviewed by: Josef 'Jeff' Sipek Reviewed by: Xin LI Approved by: Robert Mustacchi Author: Justin T. Gibbs illumos/illumos-gate@db1741f555ec79def5e9846e6bfd132248514ff Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Thu Apr 13 04:10:27 2017 (r316750) +++ vendor/illumos/dist/man/man1m/zfs.1m Thu Apr 13 05:47:52 2017 (r316751) @@ -987,20 +987,25 @@ Changing this property affects only newl .sp .ne 2 .na -\fB\fBcompression\fR=\fBon\fR | \fBoff\fR | \fBlzjb\fR | \fBgzip\fR | -\fBgzip-\fR\fIN\fR | \fBzle\fR\fR | \fBlz4\fR +\fB\fBcompression\fR=\fBon\fR | \fBoff\fR | \fBlzjb\fR | \fBlz4\fR | +\fBgzip\fR | \fBgzip-\fR\fIN\fR | \fBzle\fR\fR .ad .sp .6 .RS 4n -Controls the compression algorithm used for this dataset. The \fBlzjb\fR -compression algorithm is optimized for performance while providing decent data -compression. Setting compression to \fBon\fR uses the \fBlzjb\fR compression -algorithm. The \fBgzip\fR compression algorithm uses the same compression as -the \fBgzip\fR(1) command. You can specify the \fBgzip\fR level by using the -value \fBgzip-\fR\fIN\fR where \fIN\fR is an integer from 1 (fastest) to 9 -(best compression ratio). Currently, \fBgzip\fR is equivalent to \fBgzip-6\fR -(which is also the default for \fBgzip\fR(1)). The \fBzle\fR compression -algorithm compresses runs of zeros. +Controls the compression algorithm used for this dataset. +.sp +Setting compression to \fBon\fR indicates that the current default +compression algorithm should be used. The default balances compression +and decompression speed, with compression ratio and is expected to +work well on a wide variety of workloads. Unlike all other settings for +this property, \fBon\fR does not select a fixed compression type. As +new compression algorithms are added to ZFS and enabled on a pool, the +default compression algorithm may change. The current default compression +algorthm is either \fBlzjb\fR or, if the \fBlz4_compress\fR feature is +enabled, \fBlz4\fR. +.sp +The \fBlzjb\fR compression algorithm is optimized for performance while +providing decent data compression. .sp The \fBlz4\fR compression algorithm is a high-performance replacement for the \fBlzjb\fR algorithm. It features significantly faster @@ -1010,6 +1015,13 @@ the \fBlz4_compress\fR feature set to \f \fBzpool-features\fR(5) for details on ZFS feature flags and the \fBlz4_compress\fR feature. .sp +The \fBgzip\fR compression algorithm uses the same compression as +the \fBgzip\fR(1) command. You can specify the \fBgzip\fR level by using the +value \fBgzip-\fR\fIN\fR where \fIN\fR is an integer from 1 (fastest) to 9 +(best compression ratio). Currently, \fBgzip\fR is equivalent to \fBgzip-6\fR +(which is also the default for \fBgzip\fR(1)). The \fBzle\fR compression +algorithm compresses runs of zeros. +.sp This property can also be referred to by its shortened column name \fBcompress\fR. Changing this property affects only newly-written data. .RE From owner-svn-src-all@freebsd.org Thu Apr 13 05:55:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1779DD3BAA3; Thu, 13 Apr 2017 05:55:38 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D73C8266; Thu, 13 Apr 2017 05:55:37 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3D5tbb5058843; Thu, 13 Apr 2017 05:55:37 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3D5tb42058842; Thu, 13 Apr 2017 05:55:37 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201704130555.v3D5tb42058842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 13 Apr 2017 05:55:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316752 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 05:55:38 -0000 Author: jpaetzel Date: Thu Apr 13 05:55:36 2017 New Revision: 316752 URL: https://svnweb.freebsd.org/changeset/base/316752 Log: 5409 Remove shareiscsi description and example from zfs(1M) illumos/illumos-gate@b3cff10cdd26674d8dc66e0b349fd185df709fad https://github.com/illumos/illumos-gate/commit/b3cff10cdd26674d8dc66e0b349fd185df709fad https://www.illumos.org/issues/5409 Reviewed by: Matthew Ahrens Approved by: Gordon Ross Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Thu Apr 13 05:47:52 2017 (r316751) +++ vendor/illumos/dist/man/man1m/zfs.1m Thu Apr 13 05:55:36 2017 (r316752) @@ -1,4 +1,3 @@ -'\" t .\" .\" CDDL HEADER START .\" @@ -26,647 +25,574 @@ .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright (c) 2014 by Adam Stevko. All rights reserved. -.\" Copyright 2014 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright 2015 Nexenta Systems, Inc. All Rights Reserved. .\" -.TH ZFS 1M "November 11, 2014" -.SH NAME -zfs \- configures ZFS file systems -.SH SYNOPSIS -.LP -.nf -\fBzfs\fR [\fB-?\fR] -.fi - -.LP -.nf -\fBzfs\fR \fBcreate\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... \fIfilesystem\fR -.fi - -.LP -.nf -\fBzfs\fR \fBcreate\fR [\fB-ps\fR] [\fB-b\fR \fIblocksize\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... \fB-V\fR \fIsize\fR \fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBdestroy\fR [\fB-fnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBdestroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,\fIsnap\fR[%\fIsnap\fR]]... -.fi - -.LP -.nf -\fBzfs\fR \fBdestroy\fR \fIfilesystem\fR|\fIvolume\fR#\fIbookmark\fR -.fi - -.LP -.nf -\fBzfs\fR \fBsnapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... - \fIfilesystem@snapname\fR|\fIvolume@snapname\fR... -.fi - -.LP -.nf -\fBzfs\fR \fBrollback\fR [\fB-rRf\fR] \fIsnapshot\fR -.fi - -.LP -.nf -\fBzfs\fR \fBclone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBpromote\fR \fIclone-filesystem\fR -.fi - -.LP -.nf -\fBzfs\fR \fBrename\fR [\fB-f\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR - \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR -.fi - -.LP -.nf -\fBzfs\fR \fBrename\fR [\fB-fp\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBrename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR -.fi - -.LP -.nf -\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIproperty\fR[,\fIproperty\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...] - [\fB-s\fR \fIproperty\fR]... [\fB-S\fR \fIproperty\fR]... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR]... -.fi - -.LP -.nf -\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR... \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR... -.fi - -.LP -.nf -\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...] - [\fB-s\fR \fIsource\fR[,\fIsource\fR]...] \fBall\fR | \fIproperty\fR[,\fIproperty\fR]... - \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR... -.fi - -.LP -.nf -\fBzfs\fR \fBinherit\fR [\fB-rS\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR... -.fi - -.LP -.nf -\fBzfs\fR \fBupgrade\fR [\fB-v\fR] -.fi - -.LP -.nf -\fBzfs\fR \fBupgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIfilesystem\fR -.fi - -.LP -.nf -\fBzfs\fR \fBuserspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-s\fR \fIfield\fR]... - [\fB-S\fR \fIfield\fR]... [\fB-t\fR \fItype\fR[,\fItype\fR]...] \fIfilesystem\fR|\fIsnapshot\fR -.fi - -.LP -.nf -\fBzfs\fR \fBgroupspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-s\fR \fIfield\fR]... - [\fB-S\fR \fIfield\fR]... [\fB-t\fR \fItype\fR[,\fItype\fR]...] \fIfilesystem\fR|\fIsnapshot\fR -.fi - -.LP -.nf -\fBzfs\fR \fBmount\fR -.fi - -.LP -.nf -\fBzfs\fR \fBmount\fR [\fB-vO\fR] [\fB-o \fIoptions\fR\fR] \fB-a\fR | \fIfilesystem\fR -.fi - -.LP -.nf -\fBzfs\fR \fBunmount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR -.fi - -.LP -.nf -\fBzfs\fR \fBshare\fR \fB-a\fR | \fIfilesystem\fR -.fi - -.LP -.nf -\fBzfs\fR \fBunshare\fR \fB-a\fR \fIfilesystem\fR|\fImountpoint\fR -.fi - -.LP -.nf -\fBzfs\fR \fBbookmark\fR \fIsnapshot\fR \fIbookmark\fR -.fi - -.LP -.nf -\fBzfs\fR \fBsend\fR [\fB-DnPpRveL\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR -.fi - -.LP -.nf -\fBzfs\fR \fBsend\fR [\fB-eL\fR] [\fB-i \fIsnapshot\fR|\fIbookmark\fR]\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR -.fi - -.LP -.nf -\fBzfs\fR \fBreceive\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR -.fi - -.LP -.nf -\fBzfs\fR \fBreceive\fR [\fB-vnFu\fR] [\fB-d\fR|\fB-e\fR] \fIfilesystem\fR -.fi - -.LP -.nf -\fBzfs\fR \fBallow\fR \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBallow\fR [\fB-ldug\fR] \fIuser\fR|\fIgroup\fR[,\fIuser\fR|\fIgroup\fR]... - \fIperm\fR|\fI@setname\fR[,\fIperm\fR|\fI@setname\fR]... \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBallow\fR [\fB-ld\fR] \fB-e\fR|\fBeveryone\fR \fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]... - \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBallow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]... \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBallow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]... \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] \fIuser\fR|\fIgroup\fR[,\fIuser\fR|\fIgroup\fR]... - [\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]...] \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBunallow\fR [\fB-rld\fR] \fB-e\fR|\fBeveryone\fR [\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]...] - \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]...] \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-s\fR @\fIsetname\fR [\fIperm\fR|@\fIsetname\fR[,\fIperm\fR|\fI@setname\fR]...] - \fIfilesystem\fR|\fIvolume\fR -.fi - -.LP -.nf -\fBzfs\fR \fBhold\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR... -.fi - -.LP -.nf -\fBzfs\fR \fBholds\fR [\fB-r\fR] \fIsnapshot\fR... -.fi - -.LP -.nf -\fBzfs\fR \fBrelease\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR... -.fi - -.LP -.nf -\fBzfs\fR \fBdiff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR - -.SH DESCRIPTION -.LP -The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage -pool, as described in \fBzpool\fR(1M). A dataset is identified by a unique path -within the \fBZFS\fR namespace. For example: -.sp -.in +2 -.nf +.Dd June 8, 2015 +.Dt ZFS 1M +.Os +.Sh NAME +.Nm zfs +.Nd configures ZFS file systems +.Sh SYNOPSIS +.Nm +.Op Fl \? +.Nm +.Cm create +.Op Fl p +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... +.Ar filesystem +.Nm +.Cm create +.Op Fl ps +.Op Fl b Ar blocksize +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... +.Fl V Ar size Ar volume +.Nm +.Cm destroy +.Op Fl Rfnprv +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm destroy +.Op Fl Rdnprv +.Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns +.Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ... +.Nm +.Cm destroy +.Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark +.Nm +.Cm snapshot +.Op Fl r +.Oo Fl o Ar property Ns = Ns value Oc Ns ... +.Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ... +.Nm +.Cm rollback +.Op Fl Rfr +.Ar snapshot +.Nm +.Cm clone +.Op Fl p +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... +.Ar snapshot Ar filesystem Ns | Ns Ar volume +.Nm +.Cm promote +.Ar clone-filesystem +.Nm +.Cm rename +.Op Fl f +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Nm +.Cm rename +.Op Fl fp +.Ar filesystem Ns | Ns Ar volume +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm rename +.Fl r +.Ar snapshot Ar snapshot +.Nm +.Cm list +.Op Fl r Ns | Ns Fl d Ar depth +.Op Fl Hp +.Oo Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... Oc +.Oo Fl s Ar property Oc Ns ... +.Oo Fl S Ar property Oc Ns ... +.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc +.Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Oc Ns ... +.Nm +.Cm set +.Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ... +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... +.Nm +.Cm get +.Op Fl r Ns | Ns Fl d Ar depth +.Op Fl Hp +.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc +.Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc +.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc +.Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ... +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... +.Nm +.Cm inherit +.Op Fl rS +.Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... +.Nm +.Cm upgrade +.Nm +.Cm upgrade +.Fl v +.Nm +.Cm upgrade +.Op Fl r +.Op Fl V Ar version +.Fl a | Ar filesystem +.Nm +.Cm userspace +.Op Fl Hinp +.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc +.Oo Fl s Ar field Oc Ns ... +.Oo Fl S Ar field Oc Ns ... +.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc +.Ar filesystem Ns | Ns Ar snapshot +.Nm +.Cm groupspace +.Op Fl Hinp +.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc +.Oo Fl s Ar field Oc Ns ... +.Oo Fl S Ar field Oc Ns ... +.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc +.Ar filesystem Ns | Ns Ar snapshot +.Nm +.Cm mount +.Nm +.Cm mount +.Op Fl Ov +.Op Fl o Ar options +.Fl a | Ar filesystem +.Nm +.Cm unmount +.Op Fl f +.Fl a | Ar filesystem Ns | Ns Ar mountpoint +.Nm +.Cm share +.Fl a | Ar filesystem +.Nm +.Cm unshare +.Fl a | Ar filesystem Ns | Ns Ar mountpoint +.Nm +.Cm bookmark +.Ar snapshot bookmark +.Nm +.Cm send +.Op Fl DLPRenpv +.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot +.Ar snapshot +.Nm +.Cm send +.Op Fl Le +.Op Fl i Ar snapshot Ns | Ns Ar bookmark +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Nm +.Cm receive +.Op Fl Fnuv +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Nm +.Cm receive +.Op Fl Fnuv +.Op Fl d Ns | Ns Fl e +.Ar filesystem +.Nm +.Cm allow +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm allow +.Op Fl dglu +.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ... +.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns +.Ar setname Oc Ns ... +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm allow +.Op Fl dl +.Fl e Ns | Ns Sy everyone +.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns +.Ar setname Oc Ns ... +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm allow +.Fl c +.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns +.Ar setname Oc Ns ... +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm allow +.Fl s No @ Ns Ar setname +.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns +.Ar setname Oc Ns ... +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm unallow +.Op Fl dglru +.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ... +.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns +.Ar setname Oc Ns ... Oc +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm unallow +.Op Fl dlr +.Fl e Ns | Ns Sy everyone +.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns +.Ar setname Oc Ns ... Oc +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm unallow +.Op Fl r +.Fl c +.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns +.Ar setname Oc Ns ... Oc +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm unallow +.Op Fl r +.Fl s @ Ns Ar setname +.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns +.Ar setname Oc Ns ... Oc +.Ar filesystem Ns | Ns Ar volume +.Nm +.Cm hold +.Op Fl r +.Ar tag Ar snapshot Ns ... +.Nm +.Cm holds +.Op Fl r +.Ar snapshot Ns ... +.Nm +.Cm release +.Op Fl r +.Ar tag Ar snapshot Ns ... +.Nm +.Cm diff +.Op Fl FHt +.Ar snapshot Ar snapshot Ns | Ns Ar filesystem +.Sh DESCRIPTION +The +.Nm +command configures ZFS datasets within a ZFS storage pool, as described in +.Xr zpool 1M . +A dataset is identified by a unique path within the ZFS namespace. For example: +.Bd -literal pool/{filesystem,volume,snapshot} -.fi -.in -2 -.sp - -.sp -.LP -where the maximum length of a dataset name is \fBMAXNAMELEN\fR (256 bytes). -.sp -.LP +.Ed +.Pp +where the maximum length of a dataset name is +.Dv MAXNAMELEN +.Pq 256 bytes . +.Pp A dataset can be one of the following: -.sp -.ne 2 -.na -\fB\fIfile system\fR\fR -.ad -.sp .6 -.RS 4n -A \fBZFS\fR dataset of type \fBfilesystem\fR can be mounted within the standard -system namespace and behaves like other file systems. While \fBZFS\fR file -systems are designed to be \fBPOSIX\fR compliant, known issues exist that -prevent compliance in some cases. Applications that depend on standards -conformance might fail due to nonstandard behavior when checking file system -free space. -.RE - -.sp -.ne 2 -.na -\fB\fIvolume\fR\fR -.ad -.sp .6 -.RS 4n +.Bl -tag -width "file system" +.It Sy file system +A ZFS dataset of type +.Sy filesystem +can be mounted within the standard system namespace and behaves like other file +systems. While ZFS file systems are designed to be POSIX compliant, known issues +exist that prevent compliance in some cases. Applications that depend on +standards conformance might fail due to non-standard behavior when checking file +system free space. +.It Sy volume A logical volume exported as a raw or block device. This type of dataset should only be used under special circumstances. File systems are typically used in most environments. -.RE - -.sp -.ne 2 -.na -\fB\fIsnapshot\fR\fR -.ad -.sp .6 -.RS 4n +.It Sy snapshot A read-only version of a file system or volume at a given point in time. It is -specified as \fIfilesystem@name\fR or \fIvolume@name\fR. -.RE - -.SS "ZFS File System Hierarchy" -.LP -A \fBZFS\fR storage pool is a logical collection of devices that provide space -for datasets. A storage pool is also the root of the \fBZFS\fR file system -hierarchy. -.sp -.LP +specified as +.Ar filesystem Ns @ Ns Ar name +or +.Ar volume Ns @ Ns Ar name . +.El +.Ss ZFS File System Hierarchy +A ZFS storage pool is a logical collection of devices that provide space for +datasets. A storage pool is also the root of the ZFS file system hierarchy. +.Pp The root of the pool can be accessed as a file system, such as mounting and unmounting, taking snapshots, and setting properties. The physical storage -characteristics, however, are managed by the \fBzpool\fR(1M) command. -.sp -.LP -See \fBzpool\fR(1M) for more information on creating and administering pools. -.SS "Snapshots" -.LP +characteristics, however, are managed by the +.Xr zpool 1M +command. +.Pp +See +.Xr zpool 1M +for more information on creating and administering pools. +.Ss Snapshots A snapshot is a read-only copy of a file system or volume. Snapshots can be created extremely quickly, and initially consume no additional space within the pool. As data within the active dataset changes, the snapshot consumes more data than would otherwise be shared with the active dataset. -.sp -.LP +.Pp Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back, but cannot be accessed independently. -.sp -.LP -File system snapshots can be accessed under the \fB\&.zfs/snapshot\fR directory -in the root of the file system. Snapshots are automatically mounted on demand -and may be unmounted at regular intervals. The visibility of the \fB\&.zfs\fR -directory can be controlled by the \fBsnapdir\fR property. -.SS "Clones" -.LP +.Pp +File system snapshots can be accessed under the +.Pa .zfs/snapshot +directory in the root of the file system. Snapshots are automatically mounted on +demand and may be unmounted at regular intervals. The visibility of the +.Pa .zfs +directory can be controlled by the +snapdir +property. +.Ss Clones A clone is a writable volume or file system whose initial contents are the same -as another dataset. As with snapshots, creating a clone is nearly -instantaneous, and initially consumes no additional space. -.sp -.LP +as another dataset. As with snapshots, creating a clone is nearly instantaneous, +and initially consumes no additional space. +.Pp Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot -cannot be destroyed as long as a clone exists. The \fBorigin\fR property -exposes this dependency, and the \fBdestroy\fR command lists any such -dependencies, if they exist. -.sp -.LP +cannot be destroyed as long as a clone exists. The +.Sy origin +property exposes this dependency, and the +.Cm destroy +command lists any such dependencies, if they exist. +.Pp The clone parent-child dependency relationship can be reversed by using the -\fBpromote\fR subcommand. This causes the "origin" file system to become a -clone of the specified file system, which makes it possible to destroy the file -system that the clone was created from. -.SS "Mount Points" -.LP -Creating a \fBZFS\fR file system is a simple operation, so the number of file -systems per system is likely to be numerous. To cope with this, \fBZFS\fR -automatically manages mounting and unmounting file systems without the need to -edit the \fB/etc/vfstab\fR file. All automatically managed file systems are -mounted by \fBZFS\fR at boot time. -.sp -.LP -By default, file systems are mounted under \fB/\fIpath\fR\fR, where \fIpath\fR -is the name of the file system in the \fBZFS\fR namespace. Directories are -created and destroyed as needed. -.sp -.LP -A file system can also have a mount point set in the \fBmountpoint\fR property. -This directory is created as needed, and \fBZFS\fR automatically mounts the -file system when the \fBzfs mount -a\fR command is invoked (without editing -\fB/etc/vfstab\fR). The \fBmountpoint\fR property can be inherited, so if -\fBpool/home\fR has a mount point of \fB/export/stuff\fR, then -\fBpool/home/user\fR automatically inherits a mount point of -\fB/export/stuff/user\fR. -.sp -.LP -A file system \fBmountpoint\fR property of \fBnone\fR prevents the file system -from being mounted. -.sp -.LP -If needed, \fBZFS\fR file systems can also be managed with traditional tools -(\fBmount\fR, \fBumount\fR, \fB/etc/vfstab\fR). If a file system's mount point -is set to \fBlegacy\fR, \fBZFS\fR makes no attempt to manage the file system, -and the administrator is responsible for mounting and unmounting the file -system. -.SS "Zones" -.LP -A \fBZFS\fR file system can be added to a non-global zone by using the -\fBzonecfg\fR \fBadd fs\fR subcommand. A \fBZFS\fR file system that is added to -a non-global zone must have its \fBmountpoint\fR property set to \fBlegacy\fR. -.sp -.LP +.Cm promote +subcommand. This causes the +.Qq origin +file system to become a clone of the specified file system, which makes it +possible to destroy the file system that the clone was created from. +.Ss "Mount Points" +Creating a ZFS file system is a simple operation, so the number of file systems +per system is likely to be numerous. To cope with this, ZFS automatically +manages mounting and unmounting file systems without the need to edit the +.Pa /etc/vfstab +file. All automatically managed file systems are mounted by ZFS at boot time. +.Pp +By default, file systems are mounted under +.Pa /path , +where +.Ar path +is the name of the file system in the ZFS namespace. Directories are created and +destroyed as needed. +.Pp +A file system can also have a mount point set in the +.Sy mountpoint +property. This directory is created as needed, and ZFS automatically mounts the +file system when the +.Nm zfs Cm mount Fl a +command is invoked +.Po without editing +.Pa /etc/vfstab +.Pc . +The +.Sy mountpoint +property can be inherited, so if +.Em pool/home +has a mount point of +.Pa /export/stuff , +then +.Em pool/home/user +automatically inherits a mount point of +.Pa /export/stuff/user . +.Pp +A file system +.Sy mountpoint +property of +.Sy none +prevents the file system from being mounted. +.Pp +If needed, ZFS file systems can also be managed with traditional tools +.Po +.Nm mount , +.Nm umount , +.Pa /etc/vfstab +.Pc . +If a file system's mount point is set to +.Sy legacy , +ZFS makes no attempt to manage the file system, and the administrator is +responsible for mounting and unmounting the file system. +.Ss "Zones" +A ZFS file system can be added to a non-global zone by using the +.Nm zonecfg Cm add Sy fs +subcommand. A ZFS file system that is added to a non-global zone must have its +.Sy mountpoint +property set to +.Sy legacy . +.Pp The physical properties of an added file system are controlled by the global administrator. However, the zone administrator can create, modify, or destroy -files within the added file system, depending on how the file system is -mounted. -.sp -.LP -A dataset can also be delegated to a non-global zone by using the \fBzonecfg\fR -\fBadd dataset\fR subcommand. You cannot delegate a dataset to one zone and the -children of the same dataset to another zone. The zone administrator can change -properties of the dataset or any of its children. However, the \fBquota\fR, -\fBfilesystem_limit\fR and \fBsnapshot_limit\fR properties of the delegated -dataset can be modified only by the global administrator. -.sp -.LP -A \fBZFS\fR volume can be added as a device to a non-global zone by using the -\fBzonecfg\fR \fBadd device\fR subcommand. However, its physical properties can -be modified only by the global administrator. -.sp -.LP -For more information about \fBzonecfg\fR syntax, see \fBzonecfg\fR(1M). -.sp -.LP -After a dataset is delegated to a non-global zone, the \fBzoned\fR property is -automatically set. A zoned file system cannot be mounted in the global zone, -since the zone administrator might have to set the mount point to an -unacceptable value. -.sp -.LP -The global administrator can forcibly clear the \fBzoned\fR property, though -this should be done with extreme care. The global administrator should verify -that all the mount points are acceptable before clearing the property. -.SS "Native Properties" -.LP -Properties are divided into two types, native properties and user-defined (or -"user") properties. Native properties either export internal statistics or -control \fBZFS\fR behavior. In addition, native properties are either editable -or read-only. User properties have no effect on \fBZFS\fR behavior, but you can -use them to annotate datasets in a way that is meaningful in your environment. -For more information about user properties, see the "User Properties" section, -below. -.sp -.LP +files within the added file system, depending on how the file system is mounted. +.Pp +A dataset can also be delegated to a non-global zone by using the +.Nm zonecfg Cm add Sy dataset +subcommand. You cannot delegate a dataset to one zone and the children of the +same dataset to another zone. The zone administrator can change properties of +the dataset or any of its children. However, the +.Sy quota , +.Sy filesystem_limit +and +.Sy snapshot_limit +properties of the delegated dataset can be modified only by the global +administrator. +.Pp +A ZFS volume can be added as a device to a non-global zone by using the +.Nm zonecfg Cm add Sy device +subcommand. However, its physical properties can be modified only by the global +administrator. +.Pp +For more information about +.Nm zonecfg +syntax, see +.Xr zonecfg 1M . +.Pp +After a dataset is delegated to a non-global zone, the +.Sy zoned +property is automatically set. A zoned file system cannot be mounted in the +global zone, since the zone administrator might have to set the mount point to +an unacceptable value. +.Pp +The global administrator can forcibly clear the +.Sy zoned +property, though this should be done with extreme care. The global administrator +should verify that all the mount points are acceptable before clearing the +property. +.Ss Native Properties +Properties are divided into two types, native properties and user-defined +.Po or +.Qq user +.Pc +properties. Native properties either export internal statistics or control ZFS +behavior. In addition, native properties are either editable or read-only. User +properties have no effect on ZFS behavior, but you can use them to annotate +datasets in a way that is meaningful in your environment. For more information +about user properties, see the +.Sx User Properties +section, below. +.Pp Every dataset has a set of properties that export statistics about the dataset as well as control various behaviors. Properties are inherited from the parent unless overridden by the child. Some properties apply only to certain types of -datasets (file systems, volumes, or snapshots). -.sp -.LP +datasets +.Pq file systems, volumes, or snapshots . +.Pp The values of numeric properties can be specified using human-readable suffixes -(for example, \fBk\fR, \fBKB\fR, \fBM\fR, \fBGb\fR, and so forth, up to \fBZ\fR -for zettabyte). The following are all valid (and equal) specifications: -.sp -.in +2 -.nf -1536M, 1.5g, 1.50GB -.fi -.in -2 -.sp - -.sp -.LP +.Po for example, +.Sy k , +.Sy KB , +.Sy M , +.Sy Gb , +and so forth, up to +.Sy Z +for zettabyte +.Pc . +The following are all valid +.Pq and equal +specifications: +.Li 1536M, 1.5g, 1.50GB . +.Pp The values of non-numeric properties are case sensitive and must be lowercase, -except for \fBmountpoint\fR, \fBsharenfs\fR, and \fBsharesmb\fR. -.sp -.LP +except for +.Sy mountpoint , +.Sy sharenfs , +and +.Sy sharesmb . +.Pp The following native properties consist of read-only statistics about the dataset. These properties can be neither set, nor inherited. Native properties apply to all dataset types unless otherwise noted. -.sp -.ne 2 -.na -\fB\fBavailable\fR\fR -.ad -.sp .6 -.RS 4n -The amount of space available to the dataset and all its children, assuming -that there is no other activity in the pool. Because space is shared within a -pool, availability can be limited by any number of factors, including physical -pool size, quotas, reservations, or other datasets within the pool. -.sp +.Bl -tag -width "usedbyrefreservation" +.It Sy available +The amount of space available to the dataset and all its children, assuming that +there is no other activity in the pool. Because space is shared within a pool, +availability can be limited by any number of factors, including physical pool +size, quotas, reservations, or other datasets within the pool. +.Pp This property can also be referred to by its shortened column name, -\fBavail\fR. -.RE - -.sp -.ne 2 -.na -\fB\fBcompressratio\fR\fR -.ad -.sp .6 -.RS 4n -For non-snapshots, the compression ratio achieved for the \fBused\fR -space of this dataset, expressed as a multiplier. The \fBused\fR -property includes descendant datasets, and, for clones, does not include -the space shared with the origin snapshot. For snapshots, the -\fBcompressratio\fR is the same as the \fBrefcompressratio\fR property. -Compression can be turned on by running: \fBzfs set compression=on -\fIdataset\fR\fR. The default value is \fBoff\fR. -.RE - -.sp -.ne 2 -.na -\fB\fBcreation\fR\fR -.ad -.sp .6 -.RS 4n +.Sy avail . +.It Sy compressratio +For non-snapshots, the compression ratio achieved for the +.Sy used +space of this dataset, expressed as a multiplier. The +.Sy used +property includes descendant datasets, and, for clones, does not include the +space shared with the origin snapshot. For snapshots, the +.Sy compressratio +is the same as the +.Sy refcompressratio +property. Compression can be turned on by running: +.Nm zfs Cm set Sy compression Ns = Ns Sy on Ar dataset . +The default value is +.Sy off . +.It Sy creation The time this dataset was created. -.RE - -.sp -.ne 2 -.na -\fB\fBclones\fR\fR -.ad -.sp .6 -.RS 4n -For snapshots, this property is a comma-separated list of filesystems or -volumes which are clones of this snapshot. The clones' \fBorigin\fR property -is this snapshot. If the \fBclones\fR property is not empty, then this -snapshot can not be destroyed (even with the \fB-r\fR or \fB-f\fR options). -.RE - -.sp -.ne 2 -.na -\fB\fBdefer_destroy\fR\fR -.ad -.sp .6 -.RS 4n -This property is \fBon\fR if the snapshot has been marked for deferred destroy -by using the \fBzfs destroy\fR \fB-d\fR command. Otherwise, the property is -\fBoff\fR. -.RE - -.sp -.ne 2 -.na -\fB\fBfilesystem_count\fR -.ad -.sp .6 -.RS 4n -The total number of filesystems and volumes that exist under this location in the -dataset tree. This value is only available when a \fBfilesystem_limit\fR has -been set somewhere in the tree under which the dataset resides. -.RE - -.sp -.ne 2 -.na -\fB\fBlogicalreferenced\fR\fR -.ad -.sp .6 -.RS 4n -The amount of space that is "logically" accessible by this dataset. See -the \fBreferenced\fR property. The logical space ignores the effect of -the \fBcompression\fR and \fBcopies\fR properties, giving a quantity -closer to the amount of data that applications see. However, it does -include space consumed by metadata. -.sp +.It Sy clones +For snapshots, this property is a comma-separated list of filesystems or volumes *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Apr 13 08:21:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 566FCD3BEC2; Thu, 13 Apr 2017 08:21:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33671763; Thu, 13 Apr 2017 08:21:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3D8LUkw016491; Thu, 13 Apr 2017 08:21:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3D8LUfY016488; Thu, 13 Apr 2017 08:21:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704130821.v3D8LUfY016488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 13 Apr 2017 08:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316753 - stable/11/sys/fs/nfsclient X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 08:21:31 -0000 Author: kib Date: Thu Apr 13 08:21:29 2017 New Revision: 316753 URL: https://svnweb.freebsd.org/changeset/base/316753 Log: MFC r316566: Remove spl*() calls from the nfsclient code. Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c stable/11/sys/fs/nfsclient/nfs_clvfsops.c stable/11/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clbio.c Thu Apr 13 05:55:36 2017 (r316752) +++ stable/11/sys/fs/nfsclient/nfs_clbio.c Thu Apr 13 08:21:29 2017 (r316753) @@ -1816,9 +1816,6 @@ ncl_doio(struct vnode *vp, struct buf *b */ if (error == EINTR || error == EIO || error == ETIMEDOUT || (!error && (bp->b_flags & B_NEEDCOMMIT))) { - int s; - - s = splbio(); bp->b_flags &= ~(B_INVAL|B_NOCACHE); if ((bp->b_flags & B_PAGING) == 0) { bdirty(bp); @@ -1827,7 +1824,6 @@ ncl_doio(struct vnode *vp, struct buf *b if ((error == EINTR || error == ETIMEDOUT) && (bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; - splx(s); } else { if (error) { bp->b_ioflags |= BIO_ERROR; Modified: stable/11/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clvfsops.c Thu Apr 13 05:55:36 2017 (r316752) +++ stable/11/sys/fs/nfsclient/nfs_clvfsops.c Thu Apr 13 08:21:29 2017 (r316753) @@ -415,11 +415,6 @@ nfs_mountroot(struct mount *mp) nfs_convert_diskless(); /* - * XXX splnet, so networks will receive... - */ - splnet(); - - /* * Do enough of ifconfig(8) so that the critical net interface can * talk to the server. */ @@ -558,12 +553,9 @@ static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp, const char *hostname, struct ucred *cred, struct thread *td) { - int s; int adjsock; char *p; - s = splnet(); - /* * Set read-only flag if requested; otherwise, clear it if this is * an update. If this is not an update, then either the read-only @@ -609,7 +601,6 @@ nfs_decode_args(struct mount *mp, struct /* Update flags atomically. Don't change the lock bits. */ nmp->nm_flag = argp->flags | nmp->nm_flag; - splx(s); if ((argp->flags & NFSMNT_TIMEO) && argp->timeo > 0) { nmp->nm_timeo = (argp->timeo * NFS_HZ + 5) / 10; Modified: stable/11/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clvnops.c Thu Apr 13 05:55:36 2017 (r316752) +++ stable/11/sys/fs/nfsclient/nfs_clvnops.c Thu Apr 13 08:21:29 2017 (r316753) @@ -3150,27 +3150,21 @@ nfs_print(struct vop_print_args *ap) int ncl_writebp(struct buf *bp, int force __unused, struct thread *td) { - int s; - int oldflags = bp->b_flags; -#if 0 - int retv = 1; - off_t off; -#endif + int oldflags, rtval; BUF_ASSERT_HELD(bp); if (bp->b_flags & B_INVAL) { brelse(bp); - return(0); + return (0); } + oldflags = bp->b_flags; bp->b_flags |= B_CACHE; /* * Undirty the bp. We will redirty it later if the I/O fails. */ - - s = splbio(); bundirty(bp); bp->b_flags &= ~B_DONE; bp->b_ioflags &= ~BIO_ERROR; @@ -3178,7 +3172,6 @@ ncl_writebp(struct buf *bp, int force __ bufobj_wref(bp->b_bufobj); curthread->td_ru.ru_oublock++; - splx(s); /* * Note: to avoid loopback deadlocks, we do not @@ -3190,19 +3183,14 @@ ncl_writebp(struct buf *bp, int force __ bp->b_iooffset = dbtob(bp->b_blkno); bstrategy(bp); - if( (oldflags & B_ASYNC) == 0) { - int rtval = bufwait(bp); - - if (oldflags & B_DELWRI) { - s = splbio(); - reassignbuf(bp); - splx(s); - } - brelse(bp); - return (rtval); - } + if ((oldflags & B_ASYNC) != 0) + return (0); - return (0); + rtval = bufwait(bp); + if (oldflags & B_DELWRI) + reassignbuf(bp); + brelse(bp); + return (rtval); } /* From owner-svn-src-all@freebsd.org Thu Apr 13 09:59:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 917CED3C7F5; Thu, 13 Apr 2017 09:59:13 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53071124; Thu, 13 Apr 2017 09:59:13 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3D9xCSC056521; Thu, 13 Apr 2017 09:59:12 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3D9xCOo056518; Thu, 13 Apr 2017 09:59:12 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201704130959.v3D9xCOo056518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 13 Apr 2017 09:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316754 - in head/sys/boot: common i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 09:59:13 -0000 Author: royger Date: Thu Apr 13 09:59:12 2017 New Revision: 316754 URL: https://svnweb.freebsd.org/changeset/base/316754 Log: loader/multiboot: fix multiboot loading The current multiboot loader code doesn't clean the metadata added to the kernel after the bi_load64 dry run, which breaks accounting of the required memory for the metadata. This issue didn't show itself before because all the metadata items where small (8bytes), but after r316343 there's a big blob in the metadata, which triggers this. Fix it by cleaning the metadata added to the kernel after the bi_load64 dry run. Also add a comment describing the memory layout when booting using multiboot (Xen Dom0). This unbreaks booting a FreeBSD/Xen Dom0 after r316343. MFC after: 3 weeks Sponsored by: Citrix Systems R&D Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/module.c head/sys/boot/i386/libi386/multiboot.c Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Thu Apr 13 08:21:29 2017 (r316753) +++ head/sys/boot/common/bootstrap.h Thu Apr 13 09:59:12 2017 (r316754) @@ -228,6 +228,7 @@ void file_discard(struct preloaded_file void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); int file_addmodule(struct preloaded_file *fp, char *modname, int version, struct kernel_module **newmp); +void file_removemetadata(struct preloaded_file *fp); /* MI module loaders */ #ifdef __elfN Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Thu Apr 13 08:21:29 2017 (r316753) +++ head/sys/boot/common/module.c Thu Apr 13 09:59:12 2017 (r316754) @@ -663,6 +663,22 @@ file_findmetadata(struct preloaded_file return(md); } +/* + * Remove all metadata from the file. + */ +void +file_removemetadata(struct preloaded_file *fp) +{ + struct file_metadata *md, *next; + + for (md = fp->f_metadata; md != NULL; md = next) + { + next = md->md_next; + free(md); + } + fp->f_metadata = NULL; +} + struct file_metadata * metadata_next(struct file_metadata *md, int type) { Modified: head/sys/boot/i386/libi386/multiboot.c ============================================================================== --- head/sys/boot/i386/libi386/multiboot.c Thu Apr 13 08:21:29 2017 (r316753) +++ head/sys/boot/i386/libi386/multiboot.c Thu Apr 13 09:59:12 2017 (r316754) @@ -267,7 +267,39 @@ multiboot_exec(struct preloaded_file *fp * information is placed at the start of the second module and * the original modulep value is saved together with the other * metadata, so we can relocate everything. + * + * Native layout: + * fp->f_addr + fp->f_size + * +---------+----------------+------------+ + * | | | | + * | Kernel | Modules | Metadata | + * | | | | + * +---------+----------------+------------+ + * fp->f_addr modulep kernend + * + * Xen layout: + * + * Initial: + * fp->f_addr + fp->f_size + * +---------+----------+----------------+------------+ + * | | | | | + * | Kernel | Reserved | Modules | Metadata | + * | | | | dry run | + * +---------+----------+----------------+------------+ + * fp->f_addr + * + * After metadata polacement (ie: final): + * fp->f_addr + fp->f_size + * +-----------+---------+----------+----------------+ + * | | | | | + * | Kernel | Free | Metadata | Modules | + * | | | | | + * +-----------+---------+----------+----------------+ + * fp->f_addr modulep kernend + * \__________/ \__________________________/ + * Multiboot module 0 Multiboot module 1 */ + fp = file_findfile(NULL, "elf kernel"); if (fp == NULL) { printf("No FreeBSD kernel provided, aborting\n"); @@ -275,6 +307,13 @@ multiboot_exec(struct preloaded_file *fp goto error; } + if (fp->f_metadata != NULL) { + printf("FreeBSD kernel already contains metadata, aborting\n"); + error = EINVAL; + goto error; + } + + mb_mod = malloc(sizeof(struct multiboot_mod_list) * NUM_MODULES); if (mb_mod == NULL) { error = ENOMEM; @@ -312,6 +351,9 @@ multiboot_exec(struct preloaded_file *fp goto error; } + /* Clean the metadata added to the kernel in the bi_load64 dry run */ + file_removemetadata(fp); + /* * This is the position where the second multiboot module * will be placed. From owner-svn-src-all@freebsd.org Thu Apr 13 10:29:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE1B9D3C309; Thu, 13 Apr 2017 10:29:29 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B406EBBD; Thu, 13 Apr 2017 10:29:29 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3DATS4X000974; Thu, 13 Apr 2017 03:29:28 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3DATSUQ000973; Thu, 13 Apr 2017 03:29:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704131029.v3DATSUQ000973@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316746 - head/share/examples/bhyve In-Reply-To: <201704130007.v3D07eQ9014409@repo.freebsd.org> To: Allan Jude Date: Thu, 13 Apr 2017 03:29:28 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 10:29:30 -0000 > Author: allanjude > Date: Thu Apr 13 00:07:39 2017 > New Revision: 316746 > URL: https://svnweb.freebsd.org/changeset/base/316746 > > Log: > Add UEFI support to vmrun.sh > > Adds: > -E: Use UEFI mode > -f: path to UEFI firmware image (default: path to uefi-edk2-bhyve package) > -F: UEFI framebuffer size (default: w=1024,h=768) > -L: IP to listen for VNC connections on (default: 127.0.0.1) > -P: Port to listen for VNC connections on (default: 5900) > -T: Enable tablnet device (for VNC) > -v: Wait for VNC client before booting VM > > Submitted by: Shawn Webb > MFC after: 2 weeks > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D10378 This spent 15 minutes in differtial? Something is wrong if that is how we use the diffential process. That isnt even enough time for someone to have reacted to a notice this was there. We do mailing list CC: for bugzilla for when bugs are related to areas, do we do anything like that in reviews.freebsd.org? Or just the projects lists? As a general not I dont think we want vmrun.sh to become a too relied upon way to start bhyve vm's, a million options to this and you still wont have it doing what needs done, and the more we add to this the more we are going to have to keep it around and support it. I would like to see vmrun.sh go away sooner rather than later with the use of config files. > Modified: > head/share/examples/bhyve/vmrun.sh > > Modified: head/share/examples/bhyve/vmrun.sh > ============================================================================== > --- head/share/examples/bhyve/vmrun.sh Wed Apr 12 21:37:12 2017 (r316745) > +++ head/share/examples/bhyve/vmrun.sh Thu Apr 13 00:07:39 2017 (r316746) > @@ -46,10 +46,12 @@ errmsg() { > usage() { > local msg=$1 > > - echo "Usage: vmrun.sh [-ahi] [-c ] [-C ] [-d ]" > - echo " [-e ] [-g ] [-H ]" > + echo "Usage: vmrun.sh [-aEhiTv] [-c ] [-C ] [-d ]" > + echo " [-e ] [-f ] [-F ]" > + echo " [-g ] [-H ]" > echo " [-I ] [-l ]" > - echo " [-m ] [-t ] " > + echo " [-L ]" > + echo " [-m ] [-P ] [-t ] " > echo "" > echo " -h: display this help message" > echo " -a: force memory mapped local APIC access" > @@ -57,15 +59,22 @@ usage() { > echo " -C: console device (default is ${DEFAULT_CONSOLE})" > echo " -d: virtio diskdev file (default is ${DEFAULT_VIRTIO_DISK})" > echo " -e: set FreeBSD loader environment variable" > + echo " -E: Use UEFI mode" > + echo " -f: Use a specific UEFI firmware" > + echo " -F: Use a custom UEFI GOP framebuffer size (default: w=1024,h=768)" > echo " -g: listen for connection from kgdb at " > echo " -H: host filesystem to export to the loader" > echo " -i: force boot of the Installation CDROM image" > echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" > echo " -l: the OS loader to use (default is /boot/userboot.so)" > + echo " -L: IP address for UEFI GOP VNC server (default: 127.0.0.1)" > echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" > echo " -p: pass-through a host PCI device at bus/slot/func (e.g. 10/0/0)" > + echo " -P: UEFI GOP VNC port (default: 5900)" > echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" > + echo " -T: Enable tablet device (for UEFI GOP)" > echo " -u: RTC keeps UTC time" > + echo " -v: Wait for VNC client connection before booting VM" > echo " -w: ignore unimplemented MSRs" > echo "" > [ -n "$msg" ] && errmsg "$msg" > @@ -95,7 +104,16 @@ loader_opt="" > bhyverun_opt="-H -A -P" > pass_total=0 > > -while getopts ac:C:d:e:g:hH:iI:l:m:p:t:uw c ; do > +# EFI-specific options > +efi_mode=0 > +efi_firmware="/usr/local/share/uefi-firmware/BHYVE_UEFI.fd" Hard coding /usr/local in the base system is not a good idea, as far as I know this has never been acceptable as the user is allowed to load ports to any PREFIX they prefer. > +vncwait="" > +vnchost="127.0.0.1" > +vncport=5900 > +fbsize="w=1024,h=768" These already have defaults inside the binaries, duplicating them here only leads to maintanance issues. > +tablet="" > + > +while getopts ac:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c ; do > case $c in > a) > bhyverun_opt="${bhyverun_opt} -a" > @@ -116,6 +134,15 @@ while getopts ac:C:d:e:g:hH:iI:l:m:p:t:u > e) > loader_opt="${loader_opt} -e ${OPTARG}" > ;; > + E) > + efi_mode=1 > + ;; > + f) > + efi_firmware="${OPTARG}" > + ;; > + F) > + fbsize="${OPTARG}" > + ;; > g) > gdbport=${OPTARG} > ;; > @@ -131,6 +158,9 @@ while getopts ac:C:d:e:g:hH:iI:l:m:p:t:u > l) > loader_opt="${loader_opt} -l ${OPTARG}" > ;; > + L) > + vnchost="${OPTARG}" > + ;; > m) > memsize=${OPTARG} > ;; > @@ -138,13 +168,22 @@ while getopts ac:C:d:e:g:hH:iI:l:m:p:t:u > eval "pass_dev${pass_total}=\"${OPTARG}\"" > pass_total=$(($pass_total + 1)) > ;; > + P) > + vncport="${OPTARG}" > + ;; > t) > eval "tap_dev${tap_total}=\"${OPTARG}\"" > tap_total=$(($tap_total + 1)) > ;; > + T) > + tablet="-s 30,xhci,tablet" > + ;; > u) > bhyverun_opt="${bhyverun_opt} -u" > ;; > + v) > + vncwait=",wait" > + ;; > w) > bhyverun_opt="${bhyverun_opt} -w" > ;; > @@ -181,6 +220,13 @@ if [ ${pass_total} -gt 0 ]; then > bhyverun_opt="${bhyverun_opt} -S" > fi > > +if [ ${efi_mode} -gt 0 ]; then > + if [ ! -f ${efi_firmware} ]; then > + echo "Error: EFI Firmware ${efi_firmware} doesn't exist. Try: pkg install uefi-edk2-bhyve" Not sure if it is a good idea to make recomendations that well probably outdate faster than releases, and uefi-edk2 is not the only optional firmware we can load, iirc. > + exit 1 > + fi > +fi > + > make_and_check_diskdev() > { > local virtio_diskdev="$1" > @@ -243,11 +289,13 @@ while [ 1 ]; do > installer_opt="" > fi > > - ${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \ > - ${vmname} > - bhyve_exit=$? > - if [ $bhyve_exit -ne 0 ]; then > - break > + if [ ${efi_mode} -eq 0 ]; then > + ${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \ > + ${vmname} > + bhyve_exit=$? > + if [ $bhyve_exit -ne 0 ]; then > + break > + fi > fi > > # > @@ -281,10 +329,18 @@ while [ 1 ]; do > i=$(($i + 1)) > done > > + efiargs="" > + if [ ${efi_mode} -gt 0 ]; then > + efiargs="-s 29,fbuf,tcp=${vnchost}:${vncport},${fbsize}${vncwait}" This can be recoded so that if the user does not set vnchost, vncport, fbsize, vncwait these are nulled and the defaults that already exist in the binary are used. > + efiargs="${efiargs} -l bootrom,${efi_firmware}" > + efiargs="${efiargs} ${tablet}" > + fi > + > ${FBSDRUN} -c ${cpus} -m ${memsize} ${bhyverun_opt} \ > -g ${gdbport} \ > -s 0:0,hostbridge \ > -s 1:0,lpc \ > + ${efiargs} \ > ${devargs} \ > -l com1,${console} \ > ${installer_opt} \ > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Apr 13 11:56:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93DD4D3BD69; Thu, 13 Apr 2017 11:56:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AA82B24; Thu, 13 Apr 2017 11:56:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DBuRdT008715; Thu, 13 Apr 2017 11:56:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DBuRKI008713; Thu, 13 Apr 2017 11:56:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704131156.v3DBuRKI008713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 13 Apr 2017 11:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316755 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 11:56:28 -0000 Author: andrew Date: Thu Apr 13 11:56:27 2017 New Revision: 316755 URL: https://svnweb.freebsd.org/changeset/base/316755 Log: Add SCTLR bits added in ARMv8.1 and ARMv8.2 and start to use them in the early boot code. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/locore.S head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Thu Apr 13 09:59:12 2017 (r316754) +++ head/sys/arm64/arm64/locore.S Thu Apr 13 11:56:27 2017 (r316755) @@ -626,12 +626,13 @@ tcr: TCR_CACHE_ATTRS | TCR_SMP_ATTRS) sctlr_set: /* Bits to set */ - .quad (SCTLR_UCI | SCTLR_nTWE | SCTLR_nTWI | SCTLR_UCT | SCTLR_DZE | \ + .quad (SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_UCI | SCTLR_SPAN | \ + SCTLR_nTWE | SCTLR_nTWI | SCTLR_UCT | SCTLR_DZE | \ SCTLR_I | SCTLR_SED | SCTLR_SA0 | SCTLR_SA | SCTLR_C | SCTLR_M) sctlr_clear: /* Bits to clear */ - .quad (SCTLR_EE | SCTLR_EOE | SCTLR_WXN | SCTLR_UMA | SCTLR_ITD | \ - SCTLR_THEE | SCTLR_CP15BEN | SCTLR_A) + .quad (SCTLR_EE | SCTLR_EOE | SCTLR_IESB | SCTLR_WXN | SCTLR_UMA | \ + SCTLR_ITD | SCTLR_THEE | SCTLR_CP15BEN | SCTLR_A) .globl abort abort: Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Apr 13 09:59:12 2017 (r316754) +++ head/sys/arm64/include/armreg.h Thu Apr 13 11:56:27 2017 (r316755) @@ -384,8 +384,8 @@ #define PAR_S_MASK (0x1 << PAR_S_SHIFT) /* SCTLR_EL1 - System Control Register */ -#define SCTLR_RES0 0xc8222400 /* Reserved, write 0 */ -#define SCTLR_RES1 0x30d00800 /* Reserved, write 1 */ +#define SCTLR_RES0 0xc8222400 /* Reserved ARMv8.0, write 0 */ +#define SCTLR_RES1 0x30d00800 /* Reserved ARMv8.0, write 1 */ #define SCTLR_M 0x00000001 #define SCTLR_A 0x00000002 @@ -403,9 +403,13 @@ #define SCTLR_nTWI 0x00010000 #define SCTLR_nTWE 0x00040000 #define SCTLR_WXN 0x00080000 +#define SCTLR_IESB 0x00200000 +#define SCTLR_SPAN 0x00800000 #define SCTLR_EOE 0x01000000 #define SCTLR_EE 0x02000000 #define SCTLR_UCI 0x04000000 +#define SCTLR_nTLSMD 0x10000000 +#define SCTLR_LSMAOE 0x20000000 /* SPSR_EL1 */ /* From owner-svn-src-all@freebsd.org Thu Apr 13 13:46:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59884D3BC1B; Thu, 13 Apr 2017 13:46:03 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CA86F88; Thu, 13 Apr 2017 13:46:03 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DDk2JM053444; Thu, 13 Apr 2017 13:46:02 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DDk1hQ053436; Thu, 13 Apr 2017 13:46:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704131346.v3DDk1hQ053436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 13 Apr 2017 13:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316756 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 13:46:03 -0000 Author: andrew Date: Thu Apr 13 13:46:01 2017 New Revision: 316756 URL: https://svnweb.freebsd.org/changeset/base/316756 Log: In ARMv8.1 ARM has added a process state bit to disable access to userspace from the kernel. Make use of this to restrict accessing userspace to just the functions that explicitly handle crossing the user kernel boundary. Reported by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10371 Modified: head/sys/arm64/arm64/copyinout.S head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/arm64/support.S head/sys/arm64/include/armreg.h head/sys/arm64/include/asm.h head/sys/arm64/include/cpufunc.h Modified: head/sys/arm64/arm64/copyinout.S ============================================================================== --- head/sys/arm64/arm64/copyinout.S Thu Apr 13 11:56:27 2017 (r316755) +++ head/sys/arm64/arm64/copyinout.S Thu Apr 13 13:46:01 2017 (r316756) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); */ ENTRY(copyio_fault) SET_FAULT_HANDLER(xzr, x1) /* Clear the handler */ + EXIT_USER_ACCESS_CHECK(w0, x1) copyio_fault_nopcb: mov x0, #EFAULT ret @@ -99,6 +100,7 @@ ENTRY(copyinstr) adr x6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(x6, x7) /* Set the handler */ + ENTER_USER_ACCESS(w6, x7) ldr x7, =VM_MAXUSER_ADDRESS 1: cmp x0, x7 @@ -111,7 +113,9 @@ ENTRY(copyinstr) sub x2, x2, #1 /* len-- */ cbnz x2, 1b -2: SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ +2: EXIT_USER_ACCESS(w6) + SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ + 3: cbz x3, 4f /* Check if done != NULL */ str x5, [x3] /* done = count */ @@ -145,7 +149,7 @@ END(copyinstr) copycommon: adr x6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(x6, x7) /* Set the handler */ - + ENTER_USER_ACCESS(w6, x7) /* Check alignment */ orr x3, x0, x1 @@ -214,6 +218,7 @@ last_byte: strb w3, [x1] ending: + EXIT_USER_ACCESS_CHECK(w6, x7) SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ mov x0, xzr /* return 0 */ Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Thu Apr 13 11:56:27 2017 (r316755) +++ head/sys/arm64/arm64/machdep.c Thu Apr 13 13:46:01 2017 (r316756) @@ -118,6 +118,7 @@ int64_t dcache_line_size; /* The minimum int64_t icache_line_size; /* The minimum I cache line size */ int64_t idcache_line_size; /* The minimum cache line size */ int64_t dczva_line_size; /* The size of cache line the dc zva zeroes */ +int has_pan; /* pagezero_* implementations are provided in support.S */ void pagezero_simple(void *); @@ -127,6 +128,37 @@ void pagezero_cache(void *); void (*pagezero)(void *p) = pagezero_simple; static void +pan_setup(void) +{ + uint64_t id_aa64mfr1; + + id_aa64mfr1 = READ_SPECIALREG(id_aa64mmfr1_el1); + if (ID_AA64MMFR1_PAN(id_aa64mfr1) != ID_AA64MMFR1_PAN_NONE) + has_pan = 1; +} + +void +pan_enable(void) +{ + + /* + * The LLVM integrated assembler doesn't understand the PAN + * PSTATE field. Because of this we need to manually create + * the instruction in an asm block. This is equivalent to: + * msr pan, #1 + * + * This sets the PAN bit, stopping the kernel from accessing + * memory when userspace can also access it unless the kernel + * uses the userspace load/store instructions. + */ + if (has_pan) { + WRITE_SPECIALREG(sctlr_el1, + READ_SPECIALREG(sctlr_el1) & ~SCTLR_SPAN); + __asm __volatile(".inst 0xd500409f | (0x1 << 8)"); + } +} + +static void cpu_startup(void *dummy) { @@ -997,6 +1029,7 @@ initarm(struct arm64_bootparams *abp) init_param1(); cache_setup(); + pan_setup(); /* Bootstrap enough of pmap to enter the kernel proper */ pmap_bootstrap(abp->kern_l0pt, abp->kern_l1pt, @@ -1019,6 +1052,7 @@ initarm(struct arm64_bootparams *abp) dbg_monitor_init(); kdb_init(); + pan_enable(); early_boot = 0; } Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Thu Apr 13 11:56:27 2017 (r316755) +++ head/sys/arm64/arm64/mp_machdep.c Thu Apr 13 13:46:01 2017 (r316756) @@ -272,6 +272,7 @@ init_secondary(uint64_t cpu) #endif dbg_monitor_init(); + pan_enable(); /* Enable interrupts */ intr_enable(); Modified: head/sys/arm64/arm64/support.S ============================================================================== --- head/sys/arm64/arm64/support.S Thu Apr 13 11:56:27 2017 (r316755) +++ head/sys/arm64/arm64/support.S Thu Apr 13 13:46:01 2017 (r316756) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); */ ENTRY(fsu_fault) SET_FAULT_HANDLER(xzr, x1) /* Reset the handler function */ + EXIT_USER_ACCESS_CHECK(w0, x1) fsu_fault_nopcb: mov x0, #-1 ret @@ -57,11 +58,13 @@ ENTRY(casueword32) b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x4) /* And set it */ + ENTER_USER_ACCESS(w6, x4) 1: ldxr w4, [x0] /* Load-exclusive the data */ cmp w4, w1 /* Compare */ b.ne 2f /* Not equal, exit */ stxr w5, w3, [x0] /* Store the new data */ cbnz w5, 1b /* Retry on failure */ + EXIT_USER_ACCESS(w6) 2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ str w4, [x2] /* Store the read data */ mov x0, #0 /* Success */ @@ -77,11 +80,13 @@ ENTRY(casueword) b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x4) /* And set it */ + ENTER_USER_ACCESS(w6, x4) 1: ldxr x4, [x0] /* Load-exclusive the data */ cmp x4, x1 /* Compare */ b.ne 2f /* Not equal, exit */ stxr w5, x3, [x0] /* Store the new data */ cbnz w5, 1b /* Retry on failure */ + EXIT_USER_ACCESS(w6) 2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ str x4, [x2] /* Store the read data */ mov x0, #0 /* Success */ @@ -224,6 +229,7 @@ END(suword) */ ENTRY(fsu_intr_fault) SET_FAULT_HANDLER(xzr, x1) /* Reset the handler function */ + EXIT_USER_ACCESS_CHECK(w0, x1) mov x0, #-1 ret END(fsu_fault) Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Apr 13 11:56:27 2017 (r316755) +++ head/sys/arm64/include/armreg.h Thu Apr 13 13:46:01 2017 (r316756) @@ -312,6 +312,7 @@ #define ID_AA64MMFR1_PAN(x) ((x) & ID_AA64MMFR1_PAN_MASK) #define ID_AA64MMFR1_PAN_NONE (0x0 << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_PAN_IMPL (0x1 << ID_AA64MMFR1_PAN_SHIFT) +#define ID_AA64MMFR1_PAN_ATS1E1 (0x2 << ID_AA64MMFR1_PAN_SHIFT) /* ID_AA64PFR0_EL1 */ #define ID_AA64PFR0_MASK 0x0fffffff Modified: head/sys/arm64/include/asm.h ============================================================================== --- head/sys/arm64/include/asm.h Thu Apr 13 11:56:27 2017 (r316755) +++ head/sys/arm64/include/asm.h Thu Apr 13 13:46:01 2017 (r316756) @@ -71,4 +71,23 @@ ldr tmp, [tmp, #TD_PCB]; /* Load the pcb */ \ str handler, [tmp, #PCB_ONFAULT] /* Set the handler */ +#define ENTER_USER_ACCESS(reg, tmp) \ + ldr tmp, =has_pan; /* Get the addr of has_pan */ \ + ldr reg, [tmp]; /* Read it */ \ + cbz reg, 997f; /* If no PAN skip */ \ + .inst 0xd500409f | (0 << 8); /* Clear PAN */ \ + 997: + +#define EXIT_USER_ACCESS(reg) \ + cbz reg, 998f; /* If no PAN skip */ \ + .inst 0xd500409f | (1 << 8); /* Set PAN */ \ + 998: + +#define EXIT_USER_ACCESS_CHECK(reg, tmp) \ + ldr tmp, =has_pan; /* Get the addr of has_pan */ \ + ldr reg, [tmp]; /* Read it */ \ + cbz reg, 999f; /* If no PAN skip */ \ + .inst 0xd500409f | (1 << 8); /* Set PAN */ \ + 999: + #endif /* _MACHINE_ASM_H_ */ Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Thu Apr 13 11:56:27 2017 (r316755) +++ head/sys/arm64/include/cpufunc.h Thu Apr 13 13:46:01 2017 (r316756) @@ -33,6 +33,8 @@ #include +void pan_enable(void); + static __inline void breakpoint(void) { From owner-svn-src-all@freebsd.org Thu Apr 13 14:23:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A8AD3CA34; Thu, 13 Apr 2017 14:23:28 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4423E29F; Thu, 13 Apr 2017 14:23:28 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DENRGg069717; Thu, 13 Apr 2017 14:23:27 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DENRiK069715; Thu, 13 Apr 2017 14:23:27 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201704131423.v3DENRiK069715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Thu, 13 Apr 2017 14:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316757 - in head/sys: arm/arm arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 14:23:28 -0000 Author: kan Date: Thu Apr 13 14:23:27 2017 New Revision: 316757 URL: https://svnweb.freebsd.org/changeset/base/316757 Log: Use proper fields to check for interrupt trigger mode. Modified: head/sys/arm/arm/gic.c head/sys/arm64/arm64/gic_v3.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Thu Apr 13 13:46:01 2017 (r316756) +++ head/sys/arm/arm/gic.c Thu Apr 13 14:23:27 2017 (r316757) @@ -987,7 +987,7 @@ arm_gic_setup_intr(device_t dev, struct gi->gi_trig = trig; /* Edge triggered interrupts need an early EOI sent */ - if (gi->gi_pol == INTR_TRIGGER_EDGE) + if (gi->gi_trig == INTR_TRIGGER_EDGE) gi->gi_flags |= GI_FLAG_EARLY_EOI; } Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Thu Apr 13 13:46:01 2017 (r316756) +++ head/sys/arm64/arm64/gic_v3.c Thu Apr 13 14:23:27 2017 (r316757) @@ -437,11 +437,11 @@ arm_gic_v3_intr(void *arg) #endif } else if (active_irq >= GIC_FIRST_PPI && active_irq <= GIC_LAST_SPI) { - if (gi->gi_pol == INTR_TRIGGER_EDGE) + if (gi->gi_trig == INTR_TRIGGER_EDGE) gic_icc_write(EOIR1, gi->gi_irq); if (intr_isrc_dispatch(&gi->gi_isrc, tf) != 0) { - if (gi->gi_pol != INTR_TRIGGER_EDGE) + if (gi->gi_trig != INTR_TRIGGER_EDGE) gic_icc_write(EOIR1, gi->gi_irq); gic_v3_disable_intr(sc->dev, &gi->gi_isrc); device_printf(sc->dev, @@ -781,7 +781,7 @@ gic_v3_post_filter(device_t dev, struct { struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; - if (gi->gi_pol == INTR_TRIGGER_EDGE) + if (gi->gi_trig == INTR_TRIGGER_EDGE) return; gic_icc_write(EOIR1, gi->gi_irq); From owner-svn-src-all@freebsd.org Thu Apr 13 14:40:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00F90D3CF08; Thu, 13 Apr 2017 14:40:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B89A9F1C; Thu, 13 Apr 2017 14:40:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DEemmC074721; Thu, 13 Apr 2017 14:40:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DEem18074719; Thu, 13 Apr 2017 14:40:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704131440.v3DEem18074719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 13 Apr 2017 14:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316758 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 14:40:50 -0000 Author: mav Date: Thu Apr 13 14:40:48 2017 New Revision: 316758 URL: https://svnweb.freebsd.org/changeset/base/316758 Log: Update list of Conexant and Realtek codecs. MFC after: 2 weeks Modified: head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Thu Apr 13 14:23:27 2017 (r316757) +++ head/sys/dev/sound/pci/hda/hdac.h Thu Apr 13 14:40:48 2017 (r316758) @@ -339,7 +339,13 @@ /* Realtek */ #define REALTEK_VENDORID 0x10ec #define HDA_CODEC_ALC221 HDA_CODEC_CONSTRUCT(REALTEK, 0x0221) +#define HDA_CODEC_ALC225 HDA_CODEC_CONSTRUCT(REALTEK, 0x0225) +#define HDA_CODEC_ALC231 HDA_CODEC_CONSTRUCT(REALTEK, 0x0231) #define HDA_CODEC_ALC233 HDA_CODEC_CONSTRUCT(REALTEK, 0x0233) +#define HDA_CODEC_ALC234 HDA_CODEC_CONSTRUCT(REALTEK, 0x0234) +#define HDA_CODEC_ALC235 HDA_CODEC_CONSTRUCT(REALTEK, 0x0235) +#define HDA_CODEC_ALC255 HDA_CODEC_CONSTRUCT(REALTEK, 0x0255) +#define HDA_CODEC_ALC256 HDA_CODEC_CONSTRUCT(REALTEK, 0x0256) #define HDA_CODEC_ALC260 HDA_CODEC_CONSTRUCT(REALTEK, 0x0260) #define HDA_CODEC_ALC262 HDA_CODEC_CONSTRUCT(REALTEK, 0x0262) #define HDA_CODEC_ALC267 HDA_CODEC_CONSTRUCT(REALTEK, 0x0267) @@ -348,8 +354,23 @@ #define HDA_CODEC_ALC270 HDA_CODEC_CONSTRUCT(REALTEK, 0x0270) #define HDA_CODEC_ALC272 HDA_CODEC_CONSTRUCT(REALTEK, 0x0272) #define HDA_CODEC_ALC273 HDA_CODEC_CONSTRUCT(REALTEK, 0x0273) +#define HDA_CODEC_ALC274 HDA_CODEC_CONSTRUCT(REALTEK, 0x0274) #define HDA_CODEC_ALC275 HDA_CODEC_CONSTRUCT(REALTEK, 0x0275) #define HDA_CODEC_ALC276 HDA_CODEC_CONSTRUCT(REALTEK, 0x0276) +#define HDA_CODEC_ALC280 HDA_CODEC_CONSTRUCT(REALTEK, 0x0280) +#define HDA_CODEC_ALC282 HDA_CODEC_CONSTRUCT(REALTEK, 0x0282) +#define HDA_CODEC_ALC283 HDA_CODEC_CONSTRUCT(REALTEK, 0x0283) +#define HDA_CODEC_ALC284 HDA_CODEC_CONSTRUCT(REALTEK, 0x0284) +#define HDA_CODEC_ALC285 HDA_CODEC_CONSTRUCT(REALTEK, 0x0285) +#define HDA_CODEC_ALC286 HDA_CODEC_CONSTRUCT(REALTEK, 0x0286) +#define HDA_CODEC_ALC288 HDA_CODEC_CONSTRUCT(REALTEK, 0x0288) +#define HDA_CODEC_ALC290 HDA_CODEC_CONSTRUCT(REALTEK, 0x0290) +#define HDA_CODEC_ALC292 HDA_CODEC_CONSTRUCT(REALTEK, 0x0292) +#define HDA_CODEC_ALC293 HDA_CODEC_CONSTRUCT(REALTEK, 0x0293) +#define HDA_CODEC_ALC294 HDA_CODEC_CONSTRUCT(REALTEK, 0x0294) +#define HDA_CODEC_ALC295 HDA_CODEC_CONSTRUCT(REALTEK, 0x0295) +#define HDA_CODEC_ALC298 HDA_CODEC_CONSTRUCT(REALTEK, 0x0298) +#define HDA_CODEC_ALC299 HDA_CODEC_CONSTRUCT(REALTEK, 0x0299) #define HDA_CODEC_ALC292 HDA_CODEC_CONSTRUCT(REALTEK, 0x0292) #define HDA_CODEC_ALC295 HDA_CODEC_CONSTRUCT(REALTEK, 0x0295) #define HDA_CODEC_ALC660 HDA_CODEC_CONSTRUCT(REALTEK, 0x0660) @@ -357,7 +378,11 @@ #define HDA_CODEC_ALC663 HDA_CODEC_CONSTRUCT(REALTEK, 0x0663) #define HDA_CODEC_ALC665 HDA_CODEC_CONSTRUCT(REALTEK, 0x0665) #define HDA_CODEC_ALC670 HDA_CODEC_CONSTRUCT(REALTEK, 0x0670) +#define HDA_CODEC_ALC671 HDA_CODEC_CONSTRUCT(REALTEK, 0x0671) #define HDA_CODEC_ALC680 HDA_CODEC_CONSTRUCT(REALTEK, 0x0680) +#define HDA_CODEC_ALC700 HDA_CODEC_CONSTRUCT(REALTEK, 0x0700) +#define HDA_CODEC_ALC701 HDA_CODEC_CONSTRUCT(REALTEK, 0x0701) +#define HDA_CODEC_ALC703 HDA_CODEC_CONSTRUCT(REALTEK, 0x0703) #define HDA_CODEC_ALC861 HDA_CODEC_CONSTRUCT(REALTEK, 0x0861) #define HDA_CODEC_ALC861VD HDA_CODEC_CONSTRUCT(REALTEK, 0x0862) #define HDA_CODEC_ALC880 HDA_CODEC_CONSTRUCT(REALTEK, 0x0880) @@ -370,6 +395,7 @@ #define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) #define HDA_CODEC_ALC1150 HDA_CODEC_CONSTRUCT(REALTEK, 0x0900) +#define HDA_CODEC_ALC1220 HDA_CODEC_CONSTRUCT(REALTEK, 0x1220) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) /* Motorola */ @@ -546,6 +572,17 @@ #define HDA_CODEC_CX20652 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50ac) #define HDA_CODEC_CX20664 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50b8) #define HDA_CODEC_CX20665 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50b9) +#define HDA_CODEC_CX21722 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50f1) +#define HDA_CODEC_CX20722 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50f2) +#define HDA_CODEC_CX21724 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50f3) +#define HDA_CODEC_CX20724 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50f4) +#define HDA_CODEC_CX20751 HDA_CODEC_CONSTRUCT(CONEXANT, 0x510f) +#define HDA_CODEC_CX20751_2 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5110) +#define HDA_CODEC_CX20753 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5111) +#define HDA_CODEC_CX20755 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5113) +#define HDA_CODEC_CX20756 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5114) +#define HDA_CODEC_CX20757 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5115) +#define HDA_CODEC_CX20952 HDA_CODEC_CONSTRUCT(CONEXANT, 0x51d7) #define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff) /* VIA */ Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Thu Apr 13 14:23:27 2017 (r316757) +++ head/sys/dev/sound/pci/hda/hdacc.c Thu Apr 13 14:40:48 2017 (r316758) @@ -77,7 +77,13 @@ static const struct { { HDA_CODEC_CS4207, 0, "Cirrus Logic CS4207" }, { HDA_CODEC_CS4210, 0, "Cirrus Logic CS4210" }, { HDA_CODEC_ALC221, 0, "Realtek ALC221" }, + { HDA_CODEC_ALC225, 0, "Realtek ALC225" }, + { HDA_CODEC_ALC231, 0, "Realtek ALC231" }, { HDA_CODEC_ALC233, 0, "Realtek ALC233" }, + { HDA_CODEC_ALC234, 0, "Realtek ALC234" }, + { HDA_CODEC_ALC235, 0, "Realtek ALC235" }, + { HDA_CODEC_ALC255, 0, "Realtek ALC255" }, + { HDA_CODEC_ALC256, 0, "Realtek ALC256" }, { HDA_CODEC_ALC260, 0, "Realtek ALC260" }, { HDA_CODEC_ALC262, 0, "Realtek ALC262" }, { HDA_CODEC_ALC267, 0, "Realtek ALC267" }, @@ -86,17 +92,36 @@ static const struct { { HDA_CODEC_ALC270, 0, "Realtek ALC270" }, { HDA_CODEC_ALC272, 0, "Realtek ALC272" }, { HDA_CODEC_ALC273, 0, "Realtek ALC273" }, + { HDA_CODEC_ALC274, 0, "Realtek ALC274" }, { HDA_CODEC_ALC275, 0, "Realtek ALC275" }, { HDA_CODEC_ALC276, 0, "Realtek ALC276" }, { HDA_CODEC_ALC292, 0, "Realtek ALC292" }, { HDA_CODEC_ALC295, 0, "Realtek ALC295" }, + { HDA_CODEC_ALC280, 0, "Realtek ALC280" }, + { HDA_CODEC_ALC282, 0, "Realtek ALC282" }, + { HDA_CODEC_ALC283, 0, "Realtek ALC283" }, + { HDA_CODEC_ALC284, 0, "Realtek ALC284" }, + { HDA_CODEC_ALC285, 0, "Realtek ALC285" }, + { HDA_CODEC_ALC286, 0, "Realtek ALC286" }, + { HDA_CODEC_ALC288, 0, "Realtek ALC288" }, + { HDA_CODEC_ALC290, 0, "Realtek ALC290" }, + { HDA_CODEC_ALC292, 0, "Realtek ALC292" }, + { HDA_CODEC_ALC293, 0, "Realtek ALC293" }, + { HDA_CODEC_ALC294, 0, "Realtek ALC294" }, + { HDA_CODEC_ALC295, 0, "Realtek ALC295" }, + { HDA_CODEC_ALC298, 0, "Realtek ALC298" }, + { HDA_CODEC_ALC299, 0, "Realtek ALC299" }, { HDA_CODEC_ALC660, 0, "Realtek ALC660-VD" }, { HDA_CODEC_ALC662, 0x0002, "Realtek ALC662 rev2" }, { HDA_CODEC_ALC662, 0, "Realtek ALC662" }, { HDA_CODEC_ALC663, 0, "Realtek ALC663" }, { HDA_CODEC_ALC665, 0, "Realtek ALC665" }, { HDA_CODEC_ALC670, 0, "Realtek ALC670" }, + { HDA_CODEC_ALC671, 0, "Realtek ALC671" }, { HDA_CODEC_ALC680, 0, "Realtek ALC680" }, + { HDA_CODEC_ALC700, 0, "Realtek ALC700" }, + { HDA_CODEC_ALC701, 0, "Realtek ALC701" }, + { HDA_CODEC_ALC703, 0, "Realtek ALC703" }, { HDA_CODEC_ALC861, 0x0340, "Realtek ALC660" }, { HDA_CODEC_ALC861, 0, "Realtek ALC861" }, { HDA_CODEC_ALC861VD, 0, "Realtek ALC861-VD" }, @@ -113,6 +138,7 @@ static const struct { { HDA_CODEC_ALC892, 0, "Realtek ALC892" }, { HDA_CODEC_ALC899, 0, "Realtek ALC899" }, { HDA_CODEC_ALC1150, 0, "Realtek ALC1150" }, + { HDA_CODEC_ALC1220, 0, "Realtek ALC1220" }, { HDA_CODEC_AD1882, 0, "Analog Devices AD1882" }, { HDA_CODEC_AD1882A, 0, "Analog Devices AD1882A" }, { HDA_CODEC_AD1883, 0, "Analog Devices AD1883" }, @@ -248,6 +274,17 @@ static const struct { { HDA_CODEC_CX20652, 0, "Conexant CX20652" }, { HDA_CODEC_CX20664, 0, "Conexant CX20664" }, { HDA_CODEC_CX20665, 0, "Conexant CX20665" }, + { HDA_CODEC_CX21722, 0, "Conexant CX21722" }, + { HDA_CODEC_CX20722, 0, "Conexant CX20722" }, + { HDA_CODEC_CX21724, 0, "Conexant CX21724" }, + { HDA_CODEC_CX20724, 0, "Conexant CX20724" }, + { HDA_CODEC_CX20751, 0, "Conexant CX20751/2" }, + { HDA_CODEC_CX20751_2, 0, "Conexant CX20751/2" }, + { HDA_CODEC_CX20753, 0, "Conexant CX20753/4" }, + { HDA_CODEC_CX20755, 0, "Conexant CX20755" }, + { HDA_CODEC_CX20756, 0, "Conexant CX20756" }, + { HDA_CODEC_CX20757, 0, "Conexant CX20757" }, + { HDA_CODEC_CX20952, 0, "Conexant CX20952" }, { HDA_CODEC_VT1708_8, 0, "VIA VT1708_8" }, { HDA_CODEC_VT1708_9, 0, "VIA VT1708_9" }, { HDA_CODEC_VT1708_A, 0, "VIA VT1708_A" }, From owner-svn-src-all@freebsd.org Thu Apr 13 14:44:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2FBFD3B10B; Thu, 13 Apr 2017 14:44:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4C981332; Thu, 13 Apr 2017 14:44:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DEiHwB078659; Thu, 13 Apr 2017 14:44:17 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DEiHUX078655; Thu, 13 Apr 2017 14:44:17 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704131444.v3DEiHUX078655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 13 Apr 2017 14:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316759 - in head: lib/libipsec sbin/setkey sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 14:44:18 -0000 Author: ae Date: Thu Apr 13 14:44:17 2017 New Revision: 316759 URL: https://svnweb.freebsd.org/changeset/base/316759 Log: Add large replay widow support to setkey(8) and libipsec. When the replay window size is large than UINT8_MAX, add to the request the SADB_X_EXT_SA_REPLAY extension header that was added in r309144. Also add support of SADB_X_EXT_NAT_T_TYPE, SADB_X_EXT_NAT_T_SPORT, SADB_X_EXT_NAT_T_DPORT, SADB_X_EXT_NAT_T_OAI, SADB_X_EXT_NAT_T_OAR, SADB_X_EXT_SA_REPLAY, SADB_X_EXT_NEW_ADDRESS_SRC, SADB_X_EXT_NEW_ADDRESS_DST extension headers to the key_debug that is used by `setkey -x`. Modify kdebug_sockaddr() to use inet_ntop() for IP addresses formatting. And modify kdebug_sadb_x_policy() to show policy scope and priority. Reviewed by: gnn, Emeric Poupon MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10375 Modified: head/lib/libipsec/pfkey.c head/sbin/setkey/Makefile head/sbin/setkey/parse.y head/sys/netipsec/key_debug.c Modified: head/lib/libipsec/pfkey.c ============================================================================== --- head/lib/libipsec/pfkey.c Thu Apr 13 14:40:48 2017 (r316758) +++ head/lib/libipsec/pfkey.c Thu Apr 13 14:44:17 2017 (r316759) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -69,6 +70,7 @@ static caddr_t pfkey_setsadbmsg(caddr_t, u_int, u_int32_t, pid_t); static caddr_t pfkey_setsadbsa(caddr_t, caddr_t, u_int32_t, u_int, u_int, u_int, u_int32_t); +static caddr_t pfkey_setsadbxreplay(caddr_t, caddr_t, uint32_t); static caddr_t pfkey_setsadbaddr(caddr_t, caddr_t, u_int, struct sockaddr *, u_int, u_int); static caddr_t pfkey_setsadbkey(caddr_t, caddr_t, u_int, caddr_t, u_int); @@ -1196,6 +1198,13 @@ pfkey_send_x1(so, type, satype, mode, sr + sizeof(struct sadb_lifetime) + sizeof(struct sadb_lifetime); + if (wsize > UINT8_MAX) { + if (wsize > (UINT32_MAX - 32) >> 3) { + __ipsec_errcode = EIPSEC_INVAL_ARGUMENT; + return (-1); + } + len += sizeof(struct sadb_x_sa_replay); + } if (e_type != SADB_EALG_NONE) len += (sizeof(struct sadb_key) + PFKEY_ALIGN8(e_keylen)); if (a_type != SADB_AALG_NONE) @@ -1223,6 +1232,13 @@ pfkey_send_x1(so, type, satype, mode, sr free(newmsg); return -1; } + if (wsize > UINT8_MAX) { + p = pfkey_setsadbxreplay(p, ep, wsize); + if (!p) { + free(newmsg); + return (-1); + } + } p = pfkey_setsadbaddr(p, ep, SADB_EXT_ADDRESS_SRC, src, plen, IPSEC_ULPROTO_ANY); if (!p) { @@ -1982,7 +1998,7 @@ pfkey_setsadbsa(buf, lim, spi, wsize, au p->sadb_sa_len = PFKEY_UNIT64(len); p->sadb_sa_exttype = SADB_EXT_SA; p->sadb_sa_spi = spi; - p->sadb_sa_replay = wsize; + p->sadb_sa_replay = wsize > UINT8_MAX ? UINT8_MAX: wsize; p->sadb_sa_state = SADB_SASTATE_LARVAL; p->sadb_sa_auth = auth; p->sadb_sa_encrypt = enc; @@ -1992,6 +2008,31 @@ pfkey_setsadbsa(buf, lim, spi, wsize, au } /* + * Set data into sadb_x_sa_replay. + * `buf' must has been allocated sufficiently. + */ +static caddr_t +pfkey_setsadbxreplay(caddr_t buf, caddr_t lim, uint32_t wsize) +{ + struct sadb_x_sa_replay *p; + u_int len; + + p = (struct sadb_x_sa_replay *)buf; + len = sizeof(struct sadb_x_sa_replay); + + if (buf + len > lim) + return (NULL); + + memset(p, 0, len); + p->sadb_x_sa_replay_len = PFKEY_UNIT64(len); + p->sadb_x_sa_replay_exttype = SADB_X_EXT_SA_REPLAY; + /* Convert wsize from bytes to number of packets. */ + p->sadb_x_sa_replay_replay = wsize << 3; + + return (buf + len); +} + +/* * set data into sadb_address. * `buf' must has been allocated sufficiently. * prefixlen is in bits. Modified: head/sbin/setkey/Makefile ============================================================================== --- head/sbin/setkey/Makefile Thu Apr 13 14:40:48 2017 (r316758) +++ head/sbin/setkey/Makefile Thu Apr 13 14:44:17 2017 (r316759) @@ -51,6 +51,9 @@ CFLAGS+= -I${SRCTOP}/sys SRCS+= y.tab.h y.tab.h: parse.y CFLAGS+= -DIPSEC_DEBUG -DYY_NO_UNPUT +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif Modified: head/sbin/setkey/parse.y ============================================================================== --- head/sbin/setkey/parse.y Thu Apr 13 14:40:48 2017 (r316758) +++ head/sbin/setkey/parse.y Thu Apr 13 14:44:17 2017 (r316759) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -513,6 +514,8 @@ extension return -1; } p_replay = $2; + if (p_replay > (UINT32_MAX - 32) >> 3) + yyerror("replay window is too large"); } | F_LIFETIME_HARD DECSTRING { p_lt_hard = $2; } | F_LIFETIME_SOFT DECSTRING { p_lt_soft = $2; } @@ -899,6 +902,7 @@ setkeymsg_addr(type, satype, srcs, dsts, int l, l0, len; struct sadb_sa m_sa; struct sadb_x_sa2 m_sa2; + struct sadb_x_sa_replay m_replay; struct sadb_address m_addr; struct addrinfo *s, *d; int n; @@ -920,7 +924,8 @@ setkeymsg_addr(type, satype, srcs, dsts, m_sa.sadb_sa_len = PFKEY_UNIT64(len); m_sa.sadb_sa_exttype = SADB_EXT_SA; m_sa.sadb_sa_spi = htonl(p_spi); - m_sa.sadb_sa_replay = p_replay; + m_sa.sadb_sa_replay = p_replay > UINT8_MAX ? UINT8_MAX: + p_replay; m_sa.sadb_sa_state = 0; m_sa.sadb_sa_auth = p_alg_auth; m_sa.sadb_sa_encrypt = p_alg_enc; @@ -937,6 +942,17 @@ setkeymsg_addr(type, satype, srcs, dsts, memcpy(buf + l, &m_sa2, len); l += len; + + if (p_replay > UINT8_MAX) { + len = sizeof(struct sadb_x_sa_replay); + m_replay.sadb_x_sa_replay_len = PFKEY_UNIT64(len); + m_replay.sadb_x_sa_replay_exttype = + SADB_X_EXT_SA_REPLAY; + m_replay.sadb_x_sa_replay_replay = p_replay << 3; + + memcpy(buf + l, &m_replay, len); + l += len; + } } l0 = l; @@ -1017,6 +1033,7 @@ setkeymsg_add(type, satype, srcs, dsts) struct sadb_sa m_sa; struct sadb_x_sa2 m_sa2; struct sadb_address m_addr; + struct sadb_x_sa_replay m_replay; struct addrinfo *s, *d; int n; int plen; @@ -1100,7 +1117,7 @@ setkeymsg_add(type, satype, srcs, dsts) m_sa.sadb_sa_len = PFKEY_UNIT64(len); m_sa.sadb_sa_exttype = SADB_EXT_SA; m_sa.sadb_sa_spi = htonl(p_spi); - m_sa.sadb_sa_replay = p_replay; + m_sa.sadb_sa_replay = p_replay > UINT8_MAX ? UINT8_MAX: p_replay; m_sa.sadb_sa_state = 0; m_sa.sadb_sa_auth = p_alg_auth; m_sa.sadb_sa_encrypt = p_alg_enc; @@ -1118,6 +1135,15 @@ setkeymsg_add(type, satype, srcs, dsts) memcpy(buf + l, &m_sa2, len); l += len; + if (p_replay > UINT8_MAX) { + len = sizeof(struct sadb_x_sa_replay); + m_replay.sadb_x_sa_replay_len = PFKEY_UNIT64(len); + m_replay.sadb_x_sa_replay_exttype = SADB_X_EXT_SA_REPLAY; + m_replay.sadb_x_sa_replay_replay = p_replay << 3; + + memcpy(buf + l, &m_replay, len); + l += len; + } l0 = l; n = 0; Modified: head/sys/netipsec/key_debug.c ============================================================================== --- head/sys/netipsec/key_debug.c Thu Apr 13 14:40:48 2017 (r316758) +++ head/sys/netipsec/key_debug.c Thu Apr 13 14:44:17 2017 (r316759) @@ -63,6 +63,7 @@ #include #include #include +#include #endif /* !_KERNEL */ static void kdebug_sadb_prop(struct sadb_ext *); @@ -73,6 +74,8 @@ static void kdebug_sadb_sa(struct sadb_e static void kdebug_sadb_address(struct sadb_ext *); static void kdebug_sadb_key(struct sadb_ext *); static void kdebug_sadb_x_sa2(struct sadb_ext *); +static void kdebug_sadb_x_sa_replay(struct sadb_ext *); +static void kdebug_sadb_x_natt(struct sadb_ext *); #ifdef _KERNEL static void kdebug_secreplay(struct secreplay *); @@ -131,6 +134,10 @@ kdebug_sadb(struct sadb_msg *base) case SADB_EXT_ADDRESS_SRC: case SADB_EXT_ADDRESS_DST: case SADB_EXT_ADDRESS_PROXY: + case SADB_X_EXT_NAT_T_OAI: + case SADB_X_EXT_NAT_T_OAR: + case SADB_X_EXT_NEW_ADDRESS_SRC: + case SADB_X_EXT_NEW_ADDRESS_DST: kdebug_sadb_address(ext); break; case SADB_EXT_KEY_AUTH: @@ -159,6 +166,14 @@ kdebug_sadb(struct sadb_msg *base) case SADB_X_EXT_SA2: kdebug_sadb_x_sa2(ext); break; + case SADB_X_EXT_SA_REPLAY: + kdebug_sadb_x_sa_replay(ext); + break; + case SADB_X_EXT_NAT_T_TYPE: + case SADB_X_EXT_NAT_T_SPORT: + case SADB_X_EXT_NAT_T_DPORT: + kdebug_sadb_x_natt(ext); + break; default: printf("%s: invalid ext_type %u\n", __func__, ext->sadb_ext_type); @@ -342,8 +357,6 @@ kdebug_sadb_address(struct sadb_ext *ext ((u_char *)&addr->sadb_address_reserved)[1]); kdebug_sockaddr((struct sockaddr *)((caddr_t)ext + sizeof(*addr))); - - return; } static void @@ -392,6 +405,41 @@ kdebug_sadb_x_sa2(struct sadb_ext *ext) return; } +static void +kdebug_sadb_x_sa_replay(struct sadb_ext *ext) +{ + struct sadb_x_sa_replay *replay; + + /* sanity check */ + if (ext == NULL) + panic("%s: NULL pointer was passed.\n", __func__); + + replay = (struct sadb_x_sa_replay *)ext; + printf("sadb_x_sa_replay{ replay=%u }\n", + replay->sadb_x_sa_replay_replay); +} + +static void +kdebug_sadb_x_natt(struct sadb_ext *ext) +{ + struct sadb_x_nat_t_type *type; + struct sadb_x_nat_t_port *port; + + /* sanity check */ + if (ext == NULL) + panic("%s: NULL pointer was passed.\n", __func__); + + if (ext->sadb_ext_type == SADB_X_EXT_NAT_T_TYPE) { + type = (struct sadb_x_nat_t_type *)ext; + printf("sadb_x_nat_t_type{ type=%u }\n", + type->sadb_x_nat_t_type_type); + } else { + port = (struct sadb_x_nat_t_port *)ext; + printf("sadb_x_nat_t_port{ port=%u }\n", + ntohs(port->sadb_x_nat_t_port_port)); + } +} + void kdebug_sadb_x_policy(struct sadb_ext *ext) { @@ -402,9 +450,11 @@ kdebug_sadb_x_policy(struct sadb_ext *ex if (ext == NULL) panic("%s: NULL pointer was passed.\n", __func__); - printf("sadb_x_policy{ type=%u dir=%u id=%x }\n", + printf("sadb_x_policy{ type=%u dir=%u id=%x scope=%u %s=%u }\n", xpl->sadb_x_policy_type, xpl->sadb_x_policy_dir, - xpl->sadb_x_policy_id); + xpl->sadb_x_policy_id, xpl->sadb_x_policy_scope, + xpl->sadb_x_policy_scope == IPSEC_POLICYSCOPE_IFNET ? + "ifindex": "priority", xpl->sadb_x_policy_priority); if (xpl->sadb_x_policy_type == IPSEC_POLICY_IPSEC) { int tlen; @@ -850,39 +900,42 @@ ipsec_sa2str(struct secasvar *sav, char void kdebug_sockaddr(struct sockaddr *addr) { - struct sockaddr_in *sin4; -#ifdef INET6 - struct sockaddr_in6 *sin6; -#endif + char buf[IPSEC_ADDRSTRLEN]; /* sanity check */ if (addr == NULL) panic("%s: NULL pointer was passed.\n", __func__); - /* NOTE: We deal with port number as host byte order. */ - printf("sockaddr{ len=%u family=%u", addr->sa_len, addr->sa_family); - switch (addr->sa_family) { - case AF_INET: - sin4 = (struct sockaddr_in *)addr; - printf(" port=%u\n", ntohs(sin4->sin_port)); - ipsec_hexdump((caddr_t)&sin4->sin_addr, sizeof(sin4->sin_addr)); +#ifdef INET + case AF_INET: { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)addr; + inet_ntop(AF_INET, &sin->sin_addr, buf, sizeof(buf)); break; + } +#endif #ifdef INET6 - case AF_INET6: + case AF_INET6: { + struct sockaddr_in6 *sin6; + sin6 = (struct sockaddr_in6 *)addr; - printf(" port=%u\n", ntohs(sin6->sin6_port)); - printf(" flowinfo=0x%08x, scope_id=0x%08x\n", - sin6->sin6_flowinfo, sin6->sin6_scope_id); - ipsec_hexdump((caddr_t)&sin6->sin6_addr, - sizeof(sin6->sin6_addr)); + if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { + snprintf(buf, sizeof(buf), "%s%%%u", + inet_ntop(AF_INET6, &sin6->sin6_addr, buf, + sizeof(buf)), sin6->sin6_scope_id); + } else + inet_ntop(AF_INET6, &sin6->sin6_addr, buf, + sizeof(buf)); break; + } #endif + default: + sprintf(buf, "unknown"); } - - printf(" }\n"); - - return; + printf("sockaddr{ len=%u family=%u addr=%s }\n", addr->sa_len, + addr->sa_family, buf); } void From owner-svn-src-all@freebsd.org Thu Apr 13 14:51:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3874D3B247; Thu, 13 Apr 2017 14:51:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0A5D1693; Thu, 13 Apr 2017 14:51:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DEpYC9079956; Thu, 13 Apr 2017 14:51:34 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DEpYbe079955; Thu, 13 Apr 2017 14:51:34 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704131451.v3DEpYbe079955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 13 Apr 2017 14:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316760 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 14:51:36 -0000 Author: asomers Date: Thu Apr 13 14:51:34 2017 New Revision: 316760 URL: https://svnweb.freebsd.org/changeset/base/316760 Log: Fix vdev_geom_attach_by_guids for partitioned disks When opening a vdev whose path is unknown, vdev_geom must find a geom provider with a label whose guids match the desired vdev. However, due to partitioning, it is possible that two non-synonomous providers will share some labels. For example, if the first partition starts at the beginning of the drive, then ada0 and ada0p1 will share the first label. More troubling, if the last partition runs to the end of the drive, then ada0p3 and ada0 will share the last label. If vdev_geom opens ada0 when it should've opened ada0p3, then the pool won't be readable. If it opens ada0 when it should've opened ada0p1, then it will corrupt some other partition when it writes the 3rd and 4th labels. The easiest way to reproduce this problem is to install a mirrored root pool with the default partition layout, then swap the positions of the two boot drives and reboot. Whether the bug manifests depends on the order in which geom lists its providers, which is arbitrary. Fix this situation by modifying the search algorithm to prefer geom providers that have all four labels intact. If no such provider exists, then open whichever provider has the most. Reviewed by: mav MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D10365 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Apr 13 14:44:17 2017 (r316759) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Apr 13 14:51:34 2017 (r316760) @@ -400,12 +400,17 @@ vdev_geom_io(struct g_consumer *cp, int kmem_free(bios, bios_size); } +/* + * Read the vdev config from a device. Return the number of valid labels that + * were found. The vdev config will be returned in config if and only if at + * least one valid label was found. + */ static int vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) { struct g_provider *pp; vdev_phys_t *vdev_lists[VDEV_LABELS]; - char *p, *buf; + char *buf; size_t buflen; uint64_t psize, state, txg; off_t offsets[VDEV_LABELS]; @@ -413,7 +418,7 @@ vdev_geom_read_config(struct g_consumer off_t sizes[VDEV_LABELS]; int cmds[VDEV_LABELS]; int errors[VDEV_LABELS]; - int l, len; + int l, nlabels; g_topology_assert_not(); @@ -444,6 +449,7 @@ vdev_geom_read_config(struct g_consumer VDEV_LABELS); /* Parse the labels */ + nlabels = 0; for (l = 0; l < VDEV_LABELS; l++) { if (errors[l] != 0) continue; @@ -469,14 +475,14 @@ vdev_geom_read_config(struct g_consumer continue; } - break; + nlabels++; } /* Free the label storage */ for (l = 0; l < VDEV_LABELS; l++) kmem_free(vdev_lists[l], size); - return (*config == NULL ? ENOENT : 0); + return (nlabels); } static void @@ -559,7 +565,7 @@ vdev_geom_read_pool_label(const char *na struct g_consumer *zcp; nvlist_t *vdev_cfg; uint64_t pool_guid; - int error; + int error, nlabels; DROP_GIANT(); g_topology_lock(); @@ -580,10 +586,10 @@ vdev_geom_read_pool_label(const char *na if (zcp == NULL) continue; g_topology_unlock(); - error = vdev_geom_read_config(zcp, &vdev_cfg); + nlabels = vdev_geom_read_config(zcp, &vdev_cfg); g_topology_lock(); vdev_geom_detach(zcp, B_TRUE); - if (error) + if (nlabels == 0) continue; ZFS_LOG(1, "successfully read vdev config"); @@ -599,9 +605,13 @@ vdev_geom_read_pool_label(const char *na } enum match { - NO_MATCH, - TOP_MATCH, - FULL_MATCH + NO_MATCH = 0, /* No matching labels found */ + TOPGUID_MATCH = 1, /* Labels match top guid, not vdev guid*/ + ZERO_MATCH = 1, /* Should never be returned */ + ONE_MATCH = 2, /* 1 label matching the vdev_guid */ + TWO_MATCH = 3, /* 2 label matching the vdev_guid */ + THREE_MATCH = 4, /* 3 label matching the vdev_guid */ + FULL_MATCH = 5 /* all labels match the vdev_guid */ }; static enum match @@ -610,6 +620,7 @@ vdev_attach_ok(vdev_t *vd, struct g_prov nvlist_t *config; uint64_t pool_guid, top_guid, vdev_guid; struct g_consumer *cp; + int nlabels; cp = vdev_geom_attach(pp, NULL); if (cp == NULL) { @@ -618,7 +629,8 @@ vdev_attach_ok(vdev_t *vd, struct g_prov return (NO_MATCH); } g_topology_unlock(); - if (vdev_geom_read_config(cp, &config) != 0) { + nlabels = vdev_geom_read_config(cp, &config); + if (nlabels == 0) { g_topology_lock(); vdev_geom_detach(cp, B_TRUE); ZFS_LOG(1, "Unable to read config from %s.", pp->name); @@ -653,10 +665,10 @@ vdev_attach_ok(vdev_t *vd, struct g_prov */ if (vdev_guid == vd->vdev_guid) { ZFS_LOG(1, "guids match for provider %s.", pp->name); - return (FULL_MATCH); + return (ZERO_MATCH + nlabels); } else if (top_guid == vd->vdev_guid && vd == vd->vdev_top) { ZFS_LOG(1, "top vdev guid match for provider %s.", pp->name); - return (TOP_MATCH); + return (TOPGUID_MATCH); } ZFS_LOG(1, "vdev guid mismatch for provider %s: %ju != %ju.", pp->name, (uintmax_t)vd->vdev_guid, (uintmax_t)vdev_guid); @@ -668,13 +680,15 @@ vdev_geom_attach_by_guids(vdev_t *vd) { struct g_class *mp; struct g_geom *gp; - struct g_provider *pp; + struct g_provider *pp, *best_pp; struct g_consumer *cp; - enum match m; + enum match match, best_match; g_topology_assert(); cp = NULL; + best_pp = NULL; + best_match = NO_MATCH; LIST_FOREACH(mp, &g_classes, class) { if (mp == &zfs_vdev_class) continue; @@ -682,26 +696,25 @@ vdev_geom_attach_by_guids(vdev_t *vd) if (gp->flags & G_GEOM_WITHER) continue; LIST_FOREACH(pp, &gp->provider, provider) { - m = vdev_attach_ok(vd, pp); - if (m == NO_MATCH) - continue; - if (cp != NULL) { - if (m == FULL_MATCH) - vdev_geom_detach(cp, B_TRUE); - else - continue; + match = vdev_attach_ok(vd, pp); + if (match > best_match) { + best_match = match; + best_pp = pp; } - cp = vdev_geom_attach(pp, vd); - if (cp == NULL) { - printf("ZFS WARNING: Unable to " - "attach to %s.\n", pp->name); - continue; - } - if (m == FULL_MATCH) - return (cp); + if (match == FULL_MATCH) + goto out; } } } + +out: + if (best_pp) { + cp = vdev_geom_attach(best_pp, vd); + if (cp == NULL) { + printf("ZFS WARNING: Unable to attach to %s.\n", + best_pp->name); + } + } return (cp); } From owner-svn-src-all@freebsd.org Thu Apr 13 15:03:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFB46D3B8C7; Thu, 13 Apr 2017 15:03:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A207A236; Thu, 13 Apr 2017 15:03:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DF3314086791; Thu, 13 Apr 2017 15:03:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DF33cS086790; Thu, 13 Apr 2017 15:03:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704131503.v3DF33cS086790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 13 Apr 2017 15:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316761 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 15:03:05 -0000 Author: andrew Date: Thu Apr 13 15:03:03 2017 New Revision: 316761 URL: https://svnweb.freebsd.org/changeset/base/316761 Log: Set the arm64 Execute-never bits in more places. We need to set the Execute-never bits when mapping device memory as the hardware may perform speculative instruction fetches. Set the Privileged Execute-ever bit on userspace memory to stop the kernel if it is tricked into executing it. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10382 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Apr 13 14:51:34 2017 (r316760) +++ head/sys/arm64/arm64/pmap.c Thu Apr 13 15:03:03 2017 (r316761) @@ -1127,7 +1127,7 @@ static void pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode) { pd_entry_t *pde; - pt_entry_t *pte; + pt_entry_t *pte, attr; vm_offset_t va; int lvl; @@ -1138,6 +1138,10 @@ pmap_kenter(vm_offset_t sva, vm_size_t s KASSERT((size & PAGE_MASK) == 0, ("pmap_kenter: Mapping is not page-sized")); + attr = ATTR_DEFAULT | ATTR_IDX(mode) | L3_PAGE; + if (mode == DEVICE_MEMORY) + attr |= ATTR_XN; + va = sva; while (size != 0) { pde = pmap_pde(kernel_pmap, va, &lvl); @@ -1146,8 +1150,7 @@ pmap_kenter(vm_offset_t sva, vm_size_t s KASSERT(lvl == 2, ("pmap_kenter: Invalid level %d", lvl)); pte = pmap_l2_to_l3(pde, va); - pmap_load_store(pte, (pa & ~L3_OFFSET) | ATTR_DEFAULT | - ATTR_IDX(mode) | L3_PAGE); + pmap_load_store(pte, (pa & ~L3_OFFSET) | attr); PTE_SYNC(pte); va += PAGE_SIZE; @@ -1259,6 +1262,8 @@ pmap_qenter(vm_offset_t sva, vm_page_t * m = ma[i]; pa = VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_AP(ATTR_AP_RW) | ATTR_IDX(m->md.pv_memattr) | L3_PAGE; + if (m->md.pv_memattr == DEVICE_MEMORY) + pa |= ATTR_XN; pte = pmap_l2_to_l3(pde, va); pmap_load_store(pte, pa); PTE_SYNC(pte); @@ -2719,12 +2724,12 @@ pmap_enter(pmap_t pmap, vm_offset_t va, L3_PAGE); if ((prot & VM_PROT_WRITE) == 0) new_l3 |= ATTR_AP(ATTR_AP_RO); - if ((prot & VM_PROT_EXECUTE) == 0) + if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == DEVICE_MEMORY) new_l3 |= ATTR_XN; if ((flags & PMAP_ENTER_WIRED) != 0) new_l3 |= ATTR_SW_WIRED; if ((va >> 63) == 0) - new_l3 |= ATTR_AP(ATTR_AP_USER); + new_l3 |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; CTR2(KTR_PMAP, "pmap_enter: %.16lx -> %.16lx", va, pa); @@ -3127,8 +3132,10 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ pa = VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_IDX(m->md.pv_memattr) | ATTR_AP(ATTR_AP_RO) | L3_PAGE; - if ((prot & VM_PROT_EXECUTE) == 0) + if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == DEVICE_MEMORY) pa |= ATTR_XN; + else if (va < VM_MAXUSER_ADDRESS) + pa |= ATTR_PXN; /* * Now validate mapping with RO protection @@ -4263,6 +4270,8 @@ pmap_change_attr_locked(vm_offset_t va, l3 = pmap_load(pte); l3 &= ~ATTR_IDX_MASK; l3 |= ATTR_IDX(mode); + if (mode == DEVICE_MEMORY) + l3 |= ATTR_XN; pmap_update_entry(kernel_pmap, pte, l3, tmpva, PAGE_SIZE); From owner-svn-src-all@freebsd.org Thu Apr 13 15:39:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6174BD3C3AF; Thu, 13 Apr 2017 15:39:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 257A3AD7; Thu, 13 Apr 2017 15:39:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DFdgj4099411; Thu, 13 Apr 2017 15:39:42 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DFdg5A099410; Thu, 13 Apr 2017 15:39:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704131539.v3DFdg5A099410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 13 Apr 2017 15:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316762 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 15:39:43 -0000 Author: pfg Date: Thu Apr 13 15:39:42 2017 New Revision: 316762 URL: https://svnweb.freebsd.org/changeset/base/316762 Log: MFC r316695, MFV r316693: 8046 Let calloc() do the multiplication in libzfs_fru_refresh https://github.com/illumos/illumos-gate/commit/5697e03e6e3e2697f56ae341c7c8ce79680d6a2e https://www.illumos.org/issues/8046 Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Approved by: Robert Mustacchi Author: Pedro Giffuni Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c Thu Apr 13 15:03:03 2017 (r316761) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c Thu Apr 13 15:39:42 2017 (r316762) @@ -282,7 +282,7 @@ libzfs_fru_refresh(libzfs_handle_t *hdl) if (hdl->libzfs_fru_hash == NULL && (hdl->libzfs_fru_hash = - calloc(ZFS_FRU_HASH_SIZE * sizeof (void *), 1)) == NULL) + calloc(ZFS_FRU_HASH_SIZE, sizeof (void *))) == NULL) return; /* From owner-svn-src-all@freebsd.org Thu Apr 13 15:40:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E965D3C451; Thu, 13 Apr 2017 15:40:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B050D9C; Thu, 13 Apr 2017 15:40:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DFevKB001930; Thu, 13 Apr 2017 15:40:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DFev8b001929; Thu, 13 Apr 2017 15:40:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704131540.v3DFev8b001929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 13 Apr 2017 15:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316763 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 15:40:58 -0000 Author: pfg Date: Thu Apr 13 15:40:57 2017 New Revision: 316763 URL: https://svnweb.freebsd.org/changeset/base/316763 Log: MFC r316695, MFV r316693: 8046 Let calloc() do the multiplication in libzfs_fru_refresh https://github.com/illumos/illumos-gate/commit/5697e03e6e3e2697f56ae341c7c8ce79680d6a2e https://www.illumos.org/issues/8046 Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Approved by: Robert Mustacchi Author: Pedro Giffuni Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c Thu Apr 13 15:39:42 2017 (r316762) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c Thu Apr 13 15:40:57 2017 (r316763) @@ -282,7 +282,7 @@ libzfs_fru_refresh(libzfs_handle_t *hdl) if (hdl->libzfs_fru_hash == NULL && (hdl->libzfs_fru_hash = - calloc(ZFS_FRU_HASH_SIZE * sizeof (void *), 1)) == NULL) + calloc(ZFS_FRU_HASH_SIZE, sizeof (void *))) == NULL) return; /* From owner-svn-src-all@freebsd.org Thu Apr 13 15:43:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE05BD3C6AC; Thu, 13 Apr 2017 15:43:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E639C6; Thu, 13 Apr 2017 15:43:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DFhiWe003485; Thu, 13 Apr 2017 15:43:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DFhiHB003484; Thu, 13 Apr 2017 15:43:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704131543.v3DFhiHB003484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 13 Apr 2017 15:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316764 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 15:43:45 -0000 Author: andrew Date: Thu Apr 13 15:43:44 2017 New Revision: 316764 URL: https://svnweb.freebsd.org/changeset/base/316764 Log: Don't prefix zero with 0x in assym.s. The arm64 binutils only accepts 0 as an offset to the Load-Acquire Register instructions where llvm will acceps both 0 and 0x0. The thread switching code uses these with SCHED_ULE to block waiting for a lock to be released. As the offset of the data to be loaded is zero this is safe, however it is useful to keep the offset in the instruction to document what is being loaded. To work around this issue in binutils only generate the 0x prefix for non-zero values. Reported by: kan Sponsored by: DARPA, AFRL Modified: head/sys/kern/genassym.sh Modified: head/sys/kern/genassym.sh ============================================================================== --- head/sys/kern/genassym.sh Thu Apr 13 15:40:57 2017 (r316763) +++ head/sys/kern/genassym.sh Thu Apr 13 15:43:44 2017 (r316764) @@ -32,12 +32,15 @@ work() sub("^0*", "", w) if (w == "") w = "0" + hex = "" + if (w != "0") + hex = "0x" sub("w3$", "", $3) # This still has minor problems representing INT_MIN, etc. # E.g., # with 32-bit 2''s complement ints, this prints -0x80000000, # which has the wrong type (unsigned int). - printf("#define\t%s\t%s0x%s\n", $3, sign, w) + printf("#define\t%s\t%s%s%s\n", $3, sign, hex, w) } ' } From owner-svn-src-all@freebsd.org Thu Apr 13 15:47:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE65AD3C771; Thu, 13 Apr 2017 15:47:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9041A373; Thu, 13 Apr 2017 15:47:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DFlwGE003872; Thu, 13 Apr 2017 15:47:58 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DFlw8H003870; Thu, 13 Apr 2017 15:47:58 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201704131547.v3DFlw8H003870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 13 Apr 2017 15:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316765 - stable/10/release/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 15:47:59 -0000 Author: gjb Date: Thu Apr 13 15:47:58 2017 New Revision: 316765 URL: https://svnweb.freebsd.org/changeset/base/316765 Log: MFC r316617 (partial): - Use the 'conv=sync' dd(1) option to fix writing the u-boot.imx file to the md(4) device for IMX6-based boards. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/arm/CUBOX-HUMMINGBOARD.conf stable/10/release/arm/WANDBOARD.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- stable/10/release/arm/CUBOX-HUMMINGBOARD.conf Thu Apr 13 15:43:44 2017 (r316764) +++ stable/10/release/arm/CUBOX-HUMMINGBOARD.conf Thu Apr 13 15:47:58 2017 (r316765) @@ -24,7 +24,7 @@ arm_install_uboot() { FATMOUNT="${DESTDIR%${KERNEL}}/fat" UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ - of=/dev/${mddev} bs=512 seek=2 + of=/dev/${mddev} bs=512 seek=2 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} Modified: stable/10/release/arm/WANDBOARD.conf ============================================================================== --- stable/10/release/arm/WANDBOARD.conf Thu Apr 13 15:43:44 2017 (r316764) +++ stable/10/release/arm/WANDBOARD.conf Thu Apr 13 15:47:58 2017 (r316765) @@ -24,7 +24,7 @@ arm_install_uboot() { FATMOUNT="${DESTDIR%${KERNEL}}/fat" UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ - of=/dev/${mddev} bs=512 seek=2 + of=/dev/${mddev} bs=512 seek=2 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} From owner-svn-src-all@freebsd.org Thu Apr 13 15:49:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21129D3C814; Thu, 13 Apr 2017 15:49:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E586D762; Thu, 13 Apr 2017 15:49:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DFnXYq003991; Thu, 13 Apr 2017 15:49:33 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DFnXNa003990; Thu, 13 Apr 2017 15:49:33 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201704131549.v3DFnXNa003990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 13 Apr 2017 15:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316766 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 15:49:34 -0000 Author: brooks Date: Thu Apr 13 15:49:32 2017 New Revision: 316766 URL: https://svnweb.freebsd.org/changeset/base/316766 Log: Correct an out of bounds read with HN_AUTOSCALE and very large numbers. The maximum scale is 6 (K, M, G, T, P, E) (B is 0). Overly large explict scales were checked correctly, but for sufficently large numbers HN_AUTOSCALE would get to 7 resulting in an out of bounds read. Found with humanize_number_test and CHERI bounds checking. Reviewed by: emaste Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10376 Modified: head/lib/libutil/humanize_number.c Modified: head/lib/libutil/humanize_number.c ============================================================================== --- head/lib/libutil/humanize_number.c Thu Apr 13 15:47:58 2017 (r316765) +++ head/lib/libutil/humanize_number.c Thu Apr 13 15:49:32 2017 (r316766) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -static const int maxscale = 7; +static const int maxscale = 6; int humanize_number(char *buf, size_t len, int64_t quotient, @@ -64,7 +64,7 @@ humanize_number(char *buf, size_t len, i return (-1); if (scale < 0) return (-1); - else if (scale >= maxscale && + else if (scale > maxscale && ((scale & ~(HN_AUTOSCALE|HN_GETSCALE)) != 0)) return (-1); if ((flags & HN_DIVISOR_1000) && (flags & HN_IEC_PREFIXES)) From owner-svn-src-all@freebsd.org Thu Apr 13 15:49:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51968D3C85E; Thu, 13 Apr 2017 15:49:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23D168B5; Thu, 13 Apr 2017 15:49:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DFntlm004051; Thu, 13 Apr 2017 15:49:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DFnt9I004050; Thu, 13 Apr 2017 15:49:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704131549.v3DFnt9I004050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 13 Apr 2017 15:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316767 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 15:49:56 -0000 Author: kib Date: Thu Apr 13 15:49:55 2017 New Revision: 316767 URL: https://svnweb.freebsd.org/changeset/base/316767 Log: Map DMAP as nx. Demotions preserve PG_NX, so it is enough to set nx bit for initial lowest-level paging entries. Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Apr 13 15:49:32 2017 (r316766) +++ head/sys/amd64/amd64/pmap.c Thu Apr 13 15:49:55 2017 (r316767) @@ -933,14 +933,14 @@ create_pagetables(vm_paddr_t *firstaddr) pd_p[j] = (vm_paddr_t)i << PDRSHIFT; /* Preset PG_M and PG_A because demotion expects it. */ pd_p[j] |= X86_PG_RW | X86_PG_V | PG_PS | X86_PG_G | - X86_PG_M | X86_PG_A; + X86_PG_M | X86_PG_A | pg_nx; } pdp_p = (pdp_entry_t *)DMPDPphys; for (i = 0; i < ndm1g; i++) { pdp_p[i] = (vm_paddr_t)i << PDPSHIFT; /* Preset PG_M and PG_A because demotion expects it. */ pdp_p[i] |= X86_PG_RW | X86_PG_V | PG_PS | X86_PG_G | - X86_PG_M | X86_PG_A; + X86_PG_M | X86_PG_A | pg_nx; } for (j = 0; i < ndmpdp; i++, j++) { pdp_p[i] = DMPDphys + ptoa(j); From owner-svn-src-all@freebsd.org Thu Apr 13 15:52:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D35CD3CA2A; Thu, 13 Apr 2017 15:52:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E9FBCC5; Thu, 13 Apr 2017 15:52:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DFqjXM008034; Thu, 13 Apr 2017 15:52:45 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DFqjZ3008033; Thu, 13 Apr 2017 15:52:45 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201704131552.v3DFqjZ3008033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 13 Apr 2017 15:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316768 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 15:52:46 -0000 Author: brooks Date: Thu Apr 13 15:52:45 2017 New Revision: 316768 URL: https://svnweb.freebsd.org/changeset/base/316768 Log: Fix an out-of-bounds write when a zero-length buffer is passed. Found with ttyname_test and CHERI bounds checking. Reviewed by: emaste Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10377 Modified: head/lib/libc/gen/ttyname.c Modified: head/lib/libc/gen/ttyname.c ============================================================================== --- head/lib/libc/gen/ttyname.c Thu Apr 13 15:49:55 2017 (r316767) +++ head/lib/libc/gen/ttyname.c Thu Apr 13 15:52:45 2017 (r316768) @@ -61,6 +61,10 @@ ttyname_r(int fd, char *buf, size_t len) { size_t used; + /* Don't write off the end of a zero-length buffer. */ + if (len < 1) + return (ERANGE); + *buf = '\0'; /* Must be a terminal. */ From owner-svn-src-all@freebsd.org Thu Apr 13 16:14:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1387D3CEB9; Thu, 13 Apr 2017 16:14:20 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB3E5910; Thu, 13 Apr 2017 16:14:20 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9D9675A9F14; Thu, 13 Apr 2017 16:14:19 +0000 (UTC) Date: Thu, 13 Apr 2017 16:14:19 +0000 From: Brooks Davis To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316766 - head/lib/libutil Message-ID: <20170413161419.GC95141@spindle.one-eyed-alien.net> References: <201704131549.v3DFnXNa003990@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qtZFehHsKgwS5rPz" Content-Disposition: inline In-Reply-To: <201704131549.v3DFnXNa003990@repo.freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 16:14:20 -0000 --qtZFehHsKgwS5rPz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 13, 2017 at 03:49:33PM +0000, Brooks Davis wrote: > Author: brooks > Date: Thu Apr 13 15:49:32 2017 > New Revision: 316766 > URL: https://svnweb.freebsd.org/changeset/base/316766 >=20 > Log: > Correct an out of bounds read with HN_AUTOSCALE and very large numbers. > =20 > The maximum scale is 6 (K, M, G, T, P, E) (B is 0). > =20 > Overly large explict scales were checked correctly, but for sufficently > large numbers HN_AUTOSCALE would get to 7 resulting in an out of bounds > read. > =20 > Found with humanize_number_test and CHERI bounds checking. IMO the real cause of this off-by-one error is the failure to use a proper array of prefixes. FreeBSD makes the case worse than the NetBSD code we started from by adding Ki, Mi, etc so the prefixes strings are all three characters per suffix making the code unreadable. -- Brooks --qtZFehHsKgwS5rPz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJY76PaAAoJEKzQXbSebgfAs38H/Agg6l9/n2+ZCRHuIWQmWb0L EZbQ708MZKhHM5tXVodIB2V2eqAOtTV+NzZI5UvtjIe4nwMJ7gFfjRg06hput0Lv alaKU4cloFkb1pjA9io+HZEc2J+ezt2UZseKYk0enqLaJtcYqHbQBKoelKRPnNnP PT5oeawfKvcEdDQ15C5GbKnnmmerfF/HNHPl6SrqIcht6OrO/qDG8vzqRU8wA8PU Mf47U6+sDIH8AxNA4LuPW8vAXQBXC0moa56aDrSiWG5+hrBcPcR994C2MXXPxExZ hNFAs0ZA3a6o83S6RoEndxxrKeZj1yku7HeYqNJ8NOHOJBDX55TAGH2VoZlluEI= =iRvC -----END PGP SIGNATURE----- --qtZFehHsKgwS5rPz-- From owner-svn-src-all@freebsd.org Thu Apr 13 16:57:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93118D3CE0C; Thu, 13 Apr 2017 16:57:03 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 636F2617; Thu, 13 Apr 2017 16:57:03 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DGv2LQ033396; Thu, 13 Apr 2017 16:57:02 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DGv2mB033394; Thu, 13 Apr 2017 16:57:02 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704131657.v3DGv2mB033394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 13 Apr 2017 16:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316769 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 16:57:03 -0000 Author: andrew Date: Thu Apr 13 16:57:02 2017 New Revision: 316769 URL: https://svnweb.freebsd.org/changeset/base/316769 Log: Rather than checking if the top bit in a virtual address is a 0 or 1 compare against VM_MAXUSER_ADDRESS as we should have been doing. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Apr 13 15:52:45 2017 (r316768) +++ head/sys/arm64/arm64/pmap.c Thu Apr 13 16:57:02 2017 (r316769) @@ -2728,7 +2728,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, new_l3 |= ATTR_XN; if ((flags & PMAP_ENTER_WIRED) != 0) new_l3 |= ATTR_SW_WIRED; - if ((va >> 63) == 0) + if (va < VM_MAXUSER_ADDRESS) new_l3 |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; CTR2(KTR_PMAP, "pmap_enter: %.16lx -> %.16lx", va, pa); Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Thu Apr 13 15:52:45 2017 (r316768) +++ head/sys/arm64/arm64/trap.c Thu Apr 13 16:57:02 2017 (r316769) @@ -184,7 +184,7 @@ data_abort(struct trapframe *frame, uint map = &p->p_vmspace->vm_map; else { /* The top bit tells us which range to use */ - if ((far >> 63) == 1) { + if (far >= VM_MAXUSER_ADDRESS) { map = kernel_map; } else { map = &p->p_vmspace->vm_map; From owner-svn-src-all@freebsd.org Thu Apr 13 17:03:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBDA0D3B0BE; Thu, 13 Apr 2017 17:03:58 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92912C50; Thu, 13 Apr 2017 17:03:58 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DH3ve2037563; Thu, 13 Apr 2017 17:03:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DH3v4P037561; Thu, 13 Apr 2017 17:03:57 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704131703.v3DH3v4P037561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 13 Apr 2017 17:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316770 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 17:03:59 -0000 Author: ae Date: Thu Apr 13 17:03:57 2017 New Revision: 316770 URL: https://svnweb.freebsd.org/changeset/base/316770 Log: Clear h/w csum flags on mbuf handled by UDP. When checksums of received IP and UDP header already checked, UDP uses sbappendaddr_locked() to pass received data to the socket. sbappendaddr_locked() uses given mbuf as is, and if NIC supports checksum offloading, mbuf contains csum_data and csum_flags that were calculated for already stripped headers. Some NICs support only limited checksums offloading and do not use CSUM_PSEUDO_HDR flag, and csum_data contains some value that UDP/TCP should use for pseudo header checksum calculation. When L2TP is used for tunneling with mpd5, ng_ksocket receives mbuf with filled csum_flags and csum_data, that were calculated for outer headers. When L2TP header is stripped, a packet that was tunneled goes to the IP layer and due to presence of csum_flags (without CSUM_PSEUDO_HDR) and csum_data, the UDP/TCP checksum check fails for this packet. Reported by: Irina Liakh Tested by: Irina Liakh MFC after: 1 week Modified: head/sys/netinet/udp_usrreq.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Apr 13 16:57:02 2017 (r316769) +++ head/sys/netinet/udp_usrreq.c Thu Apr 13 17:03:57 2017 (r316770) @@ -372,6 +372,9 @@ udp_append(struct inpcb *inp, struct ip append_sa = (struct sockaddr *)&udp_in[0]; m_adj(n, off); + /* Clear any h/w csum flags as they are no longer valid. */ + n->m_pkthdr.csum_flags &= ~(CSUM_DATA_VALID | CSUM_IP_VALID); + so = inp->inp_socket; SOCKBUF_LOCK(&so->so_rcv); if (sbappendaddr_locked(&so->so_rcv, append_sa, n, opts) == 0) { Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Apr 13 16:57:02 2017 (r316769) +++ head/sys/netinet6/udp6_usrreq.c Thu Apr 13 17:03:57 2017 (r316770) @@ -187,6 +187,9 @@ udp6_append(struct inpcb *inp, struct mb } m_adj(n, off + sizeof(struct udphdr)); + /* Clear any h/w csum flags as they are no longer valid. */ + n->m_pkthdr.csum_flags &= ~CSUM_DATA_VALID; + so = inp->inp_socket; SOCKBUF_LOCK(&so->so_rcv); if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)&fromsa[0], n, From owner-svn-src-all@freebsd.org Thu Apr 13 17:11:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 474FAD3B2D7; Thu, 13 Apr 2017 17:11:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E909A2; Thu, 13 Apr 2017 17:11:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DHBoeZ039289; Thu, 13 Apr 2017 17:11:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DHBoOh039288; Thu, 13 Apr 2017 17:11:50 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704131711.v3DHBoOh039288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 13 Apr 2017 17:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316771 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 17:11:51 -0000 Author: cem Date: Thu Apr 13 17:11:49 2017 New Revision: 316771 URL: https://svnweb.freebsd.org/changeset/base/316771 Log: loader: Avoid possible overflow via environment variable Reported by: Coverity (CWE-120) CID: 1006704 Sponsored by: Dell EMC Isilon Modified: head/sys/boot/common/commands.c Modified: head/sys/boot/common/commands.c ============================================================================== --- head/sys/boot/common/commands.c Thu Apr 13 17:03:57 2017 (r316770) +++ head/sys/boot/common/commands.c Thu Apr 13 17:11:49 2017 (r316771) @@ -132,7 +132,7 @@ command_help(int argc, char *argv[]) char *topic, *subtopic, *t, *s, *d; /* page the help text from our load path */ - sprintf(buf, "%s/boot/loader.help", getenv("loaddev")); + snprintf(buf, sizeof(buf), "%s/boot/loader.help", getenv("loaddev")); if ((hfd = open(buf, O_RDONLY)) < 0) { printf("Verbose help not available, use '?' to list commands\n"); return(CMD_OK); From owner-svn-src-all@freebsd.org Thu Apr 13 17:11:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CE63D3B2DC; Thu, 13 Apr 2017 17:11:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E28DFA7; Thu, 13 Apr 2017 17:11:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DHBpth039332; Thu, 13 Apr 2017 17:11:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DHBpY9039331; Thu, 13 Apr 2017 17:11:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704131711.v3DHBpY9039331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Apr 2017 17:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316772 - in stable: 10/sbin/newfs_nandfs 11/sbin/newfs_nandfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 17:11:52 -0000 Author: dim Date: Thu Apr 13 17:11:50 2017 New Revision: 316772 URL: https://svnweb.freebsd.org/changeset/base/316772 Log: MFC r314671 (by cem): newfs_nandfs: Fix unaligned pointer warning PR: 217532 Submitted by: Trond Endrestol Modified: stable/11/sbin/newfs_nandfs/newfs_nandfs.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/newfs_nandfs/newfs_nandfs.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sbin/newfs_nandfs/newfs_nandfs.c ============================================================================== --- stable/11/sbin/newfs_nandfs/newfs_nandfs.c Thu Apr 13 17:11:49 2017 (r316771) +++ stable/11/sbin/newfs_nandfs/newfs_nandfs.c Thu Apr 13 17:11:50 2017 (r316772) @@ -520,6 +520,7 @@ save_segsum(struct nandfs_segment_summar static void create_fsdata(void) { + struct uuid tmp; memset(&fsdata, 0, sizeof(struct nandfs_fsdata)); @@ -540,7 +541,8 @@ create_fsdata(void) fsdata.f_checkpoint_size = sizeof(struct nandfs_checkpoint); fsdata.f_segment_usage_size = sizeof(struct nandfs_segment_usage); - uuidgen(&fsdata.f_uuid, 1); + uuidgen(&tmp, 1); + fsdata.f_uuid = tmp; if (volumelabel) memcpy(fsdata.f_volume_name, volumelabel, 16); From owner-svn-src-all@freebsd.org Thu Apr 13 17:11:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5304ED3B2E2; Thu, 13 Apr 2017 17:11:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24C1AA8; Thu, 13 Apr 2017 17:11:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DHBprD039338; Thu, 13 Apr 2017 17:11:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DHBp73039337; Thu, 13 Apr 2017 17:11:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704131711.v3DHBp73039337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Apr 2017 17:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316772 - in stable: 10/sbin/newfs_nandfs 11/sbin/newfs_nandfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 17:11:52 -0000 Author: dim Date: Thu Apr 13 17:11:50 2017 New Revision: 316772 URL: https://svnweb.freebsd.org/changeset/base/316772 Log: MFC r314671 (by cem): newfs_nandfs: Fix unaligned pointer warning PR: 217532 Submitted by: Trond Endrestol Modified: stable/10/sbin/newfs_nandfs/newfs_nandfs.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sbin/newfs_nandfs/newfs_nandfs.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sbin/newfs_nandfs/newfs_nandfs.c ============================================================================== --- stable/10/sbin/newfs_nandfs/newfs_nandfs.c Thu Apr 13 17:11:49 2017 (r316771) +++ stable/10/sbin/newfs_nandfs/newfs_nandfs.c Thu Apr 13 17:11:50 2017 (r316772) @@ -520,6 +520,7 @@ save_segsum(struct nandfs_segment_summar static void create_fsdata(void) { + struct uuid tmp; memset(&fsdata, 0, sizeof(struct nandfs_fsdata)); @@ -540,7 +541,8 @@ create_fsdata(void) fsdata.f_checkpoint_size = sizeof(struct nandfs_checkpoint); fsdata.f_segment_usage_size = sizeof(struct nandfs_segment_usage); - uuidgen(&fsdata.f_uuid, 1); + uuidgen(&tmp, 1); + fsdata.f_uuid = tmp; if (volumelabel) memcpy(fsdata.f_volume_name, volumelabel, 16); From owner-svn-src-all@freebsd.org Thu Apr 13 17:16:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA8CDD3B7A4; Thu, 13 Apr 2017 17:16:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0E05BED; Thu, 13 Apr 2017 17:16:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DHGabe041847; Thu, 13 Apr 2017 17:16:36 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DHGa4D041844; Thu, 13 Apr 2017 17:16:36 GMT (envelope-from np@FreeBSD.org) Message-Id: <201704131716.v3DHGa4D041844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 13 Apr 2017 17:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316774 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 17:16:38 -0000 Author: np Date: Thu Apr 13 17:16:36 2017 New Revision: 316774 URL: https://svnweb.freebsd.org/changeset/base/316774 Log: cxgbe: Query some more RDMA related parameters from the firmware. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Thu Apr 13 17:13:08 2017 (r316773) +++ head/sys/dev/cxgbe/common/common.h Thu Apr 13 17:16:36 2017 (r316774) @@ -366,6 +366,9 @@ struct adapter_params { unsigned int ofldq_wr_cred; unsigned int eo_wr_cred; + + unsigned int max_ordird_qp; + unsigned int max_ird_adapter; }; #define CHELSIO_T4 0x4 Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Thu Apr 13 17:13:08 2017 (r316773) +++ head/sys/dev/cxgbe/offload.h Thu Apr 13 17:16:36 2017 (r316774) @@ -121,6 +121,7 @@ struct t4_virt_res { struct t4_range pbl; struct t4_range qp; struct t4_range cq; + struct t4_range srq; struct t4_range ocq; struct t4_range l2t; }; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Apr 13 17:13:08 2017 (r316773) +++ head/sys/dev/cxgbe/t4_main.c Thu Apr 13 17:16:36 2017 (r316774) @@ -3494,6 +3494,21 @@ get_params__post_init(struct adapter *sc sc->vres.cq.size = val[3] - val[2] + 1; sc->vres.ocq.start = val[4]; sc->vres.ocq.size = val[5] - val[4] + 1; + + param[0] = FW_PARAM_PFVF(SRQ_START); + param[1] = FW_PARAM_PFVF(SRQ_END); + param[2] = FW_PARAM_DEV(MAXORDIRD_QP); + param[3] = FW_PARAM_DEV(MAXIRD_ADAPTER); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 4, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query RDMA parameters(3): %d.\n", rc); + return (rc); + } + sc->vres.srq.start = val[0]; + sc->vres.srq.size = val[1] - val[0] + 1; + sc->params.max_ordird_qp = val[2]; + sc->params.max_ird_adapter = val[3]; } if (sc->iscsicaps) { param[0] = FW_PARAM_PFVF(ISCSI_START); From owner-svn-src-all@freebsd.org Thu Apr 13 17:34:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49F54D3BFC7; Thu, 13 Apr 2017 17:34:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02107CF1; Thu, 13 Apr 2017 17:34:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DHYqMO050434; Thu, 13 Apr 2017 17:34:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DHYqAm050433; Thu, 13 Apr 2017 17:34:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704131734.v3DHYqAm050433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 13 Apr 2017 17:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316776 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 17:34:53 -0000 Author: cem Date: Thu Apr 13 17:34:51 2017 New Revision: 316776 URL: https://svnweb.freebsd.org/changeset/base/316776 Log: linux_ioctl: Refactor some v4l2 struct converters According to the C standard, it is invalid to copy beyond the end of an object, even if that object is obviously a member of a larger object (a struct, in this case). Appease the standard and Coverity by refactoring the copy in a straightforward way. No functional change. Reported by: Coverity (CWE-120) CIDs: 1007819, 1007820, 1007821, 1007822, 1009668, 1009669 Security: no (false positive detection) Sponsored by: Dell EMC Isilon Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Thu Apr 13 17:30:33 2017 (r316775) +++ head/sys/compat/linux/linux_ioctl.c Thu Apr 13 17:34:51 2017 (r316776) @@ -3185,7 +3185,12 @@ linux_to_bsd_v4l2_standard(struct l_v4l2 { vstd->index = lvstd->index; vstd->id = lvstd->id; - memcpy(&vstd->name, &lvstd->name, sizeof(*lvstd) - offsetof(struct l_v4l2_standard, name)); + CTASSERT(sizeof(vstd->name) == sizeof(lvstd->name)); + memcpy(vstd->name, lvstd->name, sizeof(vstd->name)); + vstd->frameperiod = lvstd->frameperiod; + vstd->framelines = lvstd->framelines; + CTASSERT(sizeof(vstd->reserved) == sizeof(lvstd->reserved)); + memcpy(vstd->reserved, lvstd->reserved, sizeof(vstd->reserved)); return (0); } @@ -3194,7 +3199,12 @@ bsd_to_linux_v4l2_standard(struct v4l2_s { lvstd->index = vstd->index; lvstd->id = vstd->id; - memcpy(&lvstd->name, &vstd->name, sizeof(*lvstd) - offsetof(struct l_v4l2_standard, name)); + CTASSERT(sizeof(vstd->name) == sizeof(lvstd->name)); + memcpy(lvstd->name, vstd->name, sizeof(lvstd->name)); + lvstd->frameperiod = vstd->frameperiod; + lvstd->framelines = vstd->framelines; + CTASSERT(sizeof(vstd->reserved) == sizeof(lvstd->reserved)); + memcpy(lvstd->reserved, vstd->reserved, sizeof(lvstd->reserved)); return (0); } From owner-svn-src-all@freebsd.org Thu Apr 13 17:47:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33FC4D3C54B; Thu, 13 Apr 2017 17:47:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00FC76BA; Thu, 13 Apr 2017 17:47:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DHljxa054435; Thu, 13 Apr 2017 17:47:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DHli6R054433; Thu, 13 Apr 2017 17:47:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704131747.v3DHli6R054433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 13 Apr 2017 17:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316777 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 17:47:46 -0000 Author: cem Date: Thu Apr 13 17:47:44 2017 New Revision: 316777 URL: https://svnweb.freebsd.org/changeset/base/316777 Log: dummynet: Use strlcpy to appease static checkers Some dummynet modules used strcpy() to copy from a larger buffer (dn_aqm->name) to a smaller buffer (dn_extra_parms->name). It happens that the lengths of the strings in the dn_aqm buffers were always hardcoded to be smaller than the dn_extra_parms buffer ("CODEL", "PIE"). Use strlcpy() instead, to appease static checkers. No functional change. Reported by: Coverity CIDs: 1356163, 1356165 Sponsored by: Dell EMC Isilon Modified: head/sys/netpfil/ipfw/dn_aqm_codel.c head/sys/netpfil/ipfw/dn_aqm_pie.c Modified: head/sys/netpfil/ipfw/dn_aqm_codel.c ============================================================================== --- head/sys/netpfil/ipfw/dn_aqm_codel.c Thu Apr 13 17:34:51 2017 (r316776) +++ head/sys/netpfil/ipfw/dn_aqm_codel.c Thu Apr 13 17:47:44 2017 (r316777) @@ -416,7 +416,7 @@ aqm_codel_getconfig(struct dn_fsk *fs, s struct dn_aqm_codel_parms *ccfg; if (fs->aqmcfg) { - strcpy(ep->name, codel_desc.name); + strlcpy(ep->name, codel_desc.name, sizeof(ep->name)); ccfg = fs->aqmcfg; ep->par[0] = ccfg->target / AQM_TIME_1US; ep->par[1] = ccfg->interval / AQM_TIME_1US; Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c ============================================================================== --- head/sys/netpfil/ipfw/dn_aqm_pie.c Thu Apr 13 17:34:51 2017 (r316776) +++ head/sys/netpfil/ipfw/dn_aqm_pie.c Thu Apr 13 17:47:44 2017 (r316777) @@ -755,7 +755,7 @@ aqm_pie_getconfig (struct dn_fsk *fs, st { struct dn_aqm_pie_parms *pcfg; if (fs->aqmcfg) { - strcpy(ep->name, pie_desc.name); + strlcpy(ep->name, pie_desc.name, sizeof(ep->name)); pcfg = fs->aqmcfg; ep->par[0] = pcfg->qdelay_ref / AQM_TIME_1US; ep->par[1] = pcfg->tupdate / AQM_TIME_1US; From owner-svn-src-all@freebsd.org Thu Apr 13 18:13:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12C9BD3CFA3; Thu, 13 Apr 2017 18:13:12 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8F15BC3; Thu, 13 Apr 2017 18:13:11 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DIDBSZ066697; Thu, 13 Apr 2017 18:13:11 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DIDAm0066695; Thu, 13 Apr 2017 18:13:10 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201704131813.v3DIDAm0066695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Thu, 13 Apr 2017 18:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316778 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 18:13:12 -0000 Author: maxim Date: Thu Apr 13 18:13:10 2017 New Revision: 316778 URL: https://svnweb.freebsd.org/changeset/base/316778 Log: o Redundant assignments removed. Found by: PVS-Stdio, V519 Reviewed by: ae Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Apr 13 17:47:44 2017 (r316777) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Apr 13 18:13:10 2017 (r316778) @@ -978,7 +978,6 @@ ipfw_install_state(struct ip_fw_chain *c if (parent->count >= conn_limit) { if (V_fw_verbose && last_log != time_uptime) { - last_log = time_uptime; char sbuf[24]; last_log = time_uptime; snprintf(sbuf, sizeof(sbuf), Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_algo.c Thu Apr 13 17:47:44 2017 (r316777) +++ head/sys/netpfil/ipfw/ip_fw_table_algo.c Thu Apr 13 18:13:10 2017 (r316778) @@ -2319,7 +2319,6 @@ ta_del_ifidx(void *ta_state, struct tabl tb = (struct ta_buf_ifidx *)ta_buf; ifname = (char *)tei->paddr; icfg = (struct iftable_cfg *)ta_state; - ife = tb->ife; ife = (struct ifentry *)ipfw_objhash_lookup_name(icfg->ii, 0, ifname); From owner-svn-src-all@freebsd.org Thu Apr 13 18:28:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CE6DD3C657; Thu, 13 Apr 2017 18:28:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E97299F; Thu, 13 Apr 2017 18:28:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DISeAa070999; Thu, 13 Apr 2017 18:28:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DISeph070998; Thu, 13 Apr 2017 18:28:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704131828.v3DISeph070998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 13 Apr 2017 18:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316779 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 18:28:41 -0000 Author: pfg Date: Thu Apr 13 18:28:40 2017 New Revision: 316779 URL: https://svnweb.freebsd.org/changeset/base/316779 Log: Temporarily revert r315602. Bring back the definition for the GCC __nonnull() attribute. Old versions of GCC, including the version installed the latest 11-stable snapshot with pkg(8), still carry the old attributes. The issue is easily fixed by rebuilding GCC but there is no need to cause havoc in our user base. The definition by itself is harmless but it should be removed again in the near future. Modified: stable/11/sys/sys/cdefs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/cdefs.h ============================================================================== --- stable/11/sys/sys/cdefs.h Thu Apr 13 18:13:10 2017 (r316778) +++ stable/11/sys/sys/cdefs.h Thu Apr 13 18:28:40 2017 (r316779) @@ -376,6 +376,14 @@ #define __noinline #endif +#if __GNUC_PREREQ__(3, 3) +#define __nonnull(x) __attribute__((__nonnull__(x))) +#define __nonnull_all __attribute__((__nonnull__)) +#else +#define __nonnull(x) +#define __nonnull_all +#endif + #if __GNUC_PREREQ__(3, 4) #define __fastcall __attribute__((__fastcall__)) #define __result_use_check __attribute__((__warn_unused_result__)) From owner-svn-src-all@freebsd.org Thu Apr 13 19:27:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DB1AD3CB5E; Thu, 13 Apr 2017 19:27:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48A9FECD; Thu, 13 Apr 2017 19:27:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DJRkMK095663; Thu, 13 Apr 2017 19:27:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DJRkXe095662; Thu, 13 Apr 2017 19:27:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704131927.v3DJRkXe095662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 19:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316780 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 19:27:47 -0000 Author: bdrewery Date: Thu Apr 13 19:27:46 2017 New Revision: 316780 URL: https://svnweb.freebsd.org/changeset/base/316780 Log: Pass COMPILER_FEATURES down to submakes for installworld. This is for WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, external compiler, etc. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 13 18:28:40 2017 (r316779) +++ head/Makefile.inc1 Thu Apr 13 19:27:46 2017 (r316780) @@ -135,7 +135,8 @@ TEST_SYSTEM_COMPILER_VARS= \ MK_CROSS_COMPILER MK_CLANG_BOOTSTRAP MK_GCC_BOOTSTRAP \ WANT_COMPILER_TYPE WANT_COMPILER_VERSION WANT_COMPILER_VERSION_FILE \ WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \ - CC COMPILER_TYPE COMPILER_VERSION COMPILER_FREEBSD_VERSION + CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \ + COMPILER_FREEBSD_VERSION test-system-compiler: .PHONY .for v in ${TEST_SYSTEM_COMPILER_VARS} ${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}" @@ -153,9 +154,11 @@ test-system-compiler: .PHONY .if !defined(X_COMPILER_TYPE) CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ COMPILER_TYPE=${COMPILER_TYPE} \ + COMPILER_FEATURES=${COMPILER_FEATURES} \ COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} .else CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \ + COMPILER_FEATURES=${X_COMPILER_FEATURES} \ COMPILER_TYPE=${X_COMPILER_TYPE} \ COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION} .endif From owner-svn-src-all@freebsd.org Thu Apr 13 19:48:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 167D5D3C534; Thu, 13 Apr 2017 19:48:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDBF8AE6; Thu, 13 Apr 2017 19:48:46 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DJmjeD005359; Thu, 13 Apr 2017 19:48:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DJmjFh005356; Thu, 13 Apr 2017 19:48:45 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704131948.v3DJmjFh005356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 13 Apr 2017 19:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316781 - in stable/10: include sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 19:48:47 -0000 Author: ian Date: Thu Apr 13 19:48:45 2017 New Revision: 316781 URL: https://svnweb.freebsd.org/changeset/base/316781 Log: MFC r291310: Stop building vers.c in include/ and only build the needed osreldate.h. Because of how osreldate.h was being built with newvers.sh, which always spat out a vers.c dependent on SVN or git, the meta mode build was considering osreldate.h to depend on the current git or SVN index. This would lead to entire tree rebuilds when modifying git's index. There's no reason to be generating vers.c here so just skip it. While here, in mk-osreldate.sh rename PARAM_H to proper PARAMFILE (which newvers.sh already has a default for) and remove unneeded export. Sponsored by: EMC / Isilon Storage Division Modified: stable/10/include/Makefile stable/10/include/mk-osreldate.sh stable/10/sys/conf/newvers.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/include/Makefile ============================================================================== --- stable/10/include/Makefile Thu Apr 13 19:27:46 2017 (r316780) +++ stable/10/include/Makefile Thu Apr 13 19:48:45 2017 (r316781) @@ -5,7 +5,7 @@ .include -CLEANFILES= osreldate.h version vers.c +CLEANFILES= osreldate.h version SUBDIR= arpa protocols rpcsvc rpc xlocale SUBDIR_PARALLEL= INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ @@ -110,12 +110,8 @@ NEWVERS_SH= ${SYSDIR}/conf/newvers.sh PARAM_H= ${SYSDIR}/sys/param.h MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh -osreldate.h vers.c: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH} - env ECHO="${ECHO}" \ - MAKE="${MAKE}" \ - NEWVERS_SH=${NEWVERS_SH} \ - PARAM_H=${PARAM_H} \ - SYSDIR=${SYSDIR} \ +osreldate.h: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH} + env NEWVERS_SH=${NEWVERS_SH} PARAMFILE=${PARAM_H} SYSDIR=${SYSDIR} \ sh ${MK_OSRELDATE_SH} .for i in ${LHDRS} Modified: stable/10/include/mk-osreldate.sh ============================================================================== --- stable/10/include/mk-osreldate.sh Thu Apr 13 19:27:46 2017 (r316780) +++ stable/10/include/mk-osreldate.sh Thu Apr 13 19:48:45 2017 (r316781) @@ -35,8 +35,8 @@ trap "rm -f $tmpfile" EXIT ${ECHO} creating osreldate.h from newvers.sh -export PARAMFILE="${PARAM_H:=$CURDIR/../sys/sys/param.h}" set +e +VARS_ONLY=1 . "${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh}" || exit 1 set -e cat > $tmpfile < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E364D3CDEE; Thu, 13 Apr 2017 20:16:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4492CD3; Thu, 13 Apr 2017 20:16:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DKGUQZ017622; Thu, 13 Apr 2017 20:16:30 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DKGU3x017621; Thu, 13 Apr 2017 20:16:30 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704132016.v3DKGU3x017621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 13 Apr 2017 20:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316782 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 20:16:31 -0000 Author: rmacklem Date: Thu Apr 13 20:16:29 2017 New Revision: 316782 URL: https://svnweb.freebsd.org/changeset/base/316782 Log: Add call to svcpool_close() for the NFSv4 callback pool (svcpool_nfscbd). A function called svcpool_close() was added to the server side krpc by r313735, so that a pool could be closed without destroying the data structures. This little patch adds a call to it for the callback pool (svcpool_nfscbd), so that the nfscbd daemon can be killed/restarted and continue to work correctly. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clkrpc.c Modified: head/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clkrpc.c Thu Apr 13 19:48:45 2017 (r316781) +++ head/sys/fs/nfsclient/nfs_clkrpc.c Thu Apr 13 20:16:29 2017 (r316782) @@ -278,6 +278,11 @@ nfsrvd_cbinit(int terminating) while (nfs_numnfscbd > 0) msleep(&nfs_numnfscbd, NFSDLOCKMUTEXPTR, PZERO, "nfscbdt", 0); + if (nfscbd_pool != NULL) { + NFSD_UNLOCK(); + svcpool_close(nfscbd_pool); + NFSD_LOCK(); + } } if (nfscbd_pool == NULL) { From owner-svn-src-all@freebsd.org Thu Apr 13 20:31:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65EF1D3C4B1; Thu, 13 Apr 2017 20:31:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35BFAA57; Thu, 13 Apr 2017 20:31:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DKVNjZ025666; Thu, 13 Apr 2017 20:31:23 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DKVNme025665; Thu, 13 Apr 2017 20:31:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704132031.v3DKVNme025665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 20:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316783 - stable/11/sys/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 20:31:24 -0000 Author: bdrewery Date: Thu Apr 13 20:31:23 2017 New Revision: 316783 URL: https://svnweb.freebsd.org/changeset/base/316783 Log: MFC r315460: kmod: Fix building assym.o not building missing dependencies. Modified: stable/11/sys/conf/kmod.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kmod.mk ============================================================================== --- stable/11/sys/conf/kmod.mk Thu Apr 13 20:16:29 2017 (r316782) +++ stable/11/sys/conf/kmod.mk Thu Apr 13 20:31:23 2017 (r316783) @@ -453,6 +453,7 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quir .if !empty(SRCS:Massym.s) CLEANFILES+= assym.s genassym.o +DEPENDOBJS+= genassym.o assym.s: genassym.o .if defined(KERNBUILDDIR) genassym.o: opt_global.h From owner-svn-src-all@freebsd.org Thu Apr 13 20:32:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F272D3C6F3; Thu, 13 Apr 2017 20:32:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10A38CBD; Thu, 13 Apr 2017 20:32:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DKWIsS025748; Thu, 13 Apr 2017 20:32:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DKWIoC025747; Thu, 13 Apr 2017 20:32:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704132032.v3DKWIoC025747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 20:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316784 - stable/11/share/man/man7 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 20:32:19 -0000 Author: bdrewery Date: Thu Apr 13 20:32:18 2017 New Revision: 316784 URL: https://svnweb.freebsd.org/changeset/base/316784 Log: MFC r315211: hier(7): Fix entry location for /usr/share/vt. Modified: stable/11/share/man/man7/hier.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/hier.7 ============================================================================== --- stable/11/share/man/man7/hier.7 Thu Apr 13 20:31:23 2017 (r316783) +++ stable/11/share/man/man7/hier.7 Thu Apr 13 20:32:18 2017 (r316784) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd March 8, 2017 +.Dd March 13, 2017 .Dt HIER 7 .Os .Sh NAME @@ -644,11 +644,6 @@ and .It Pa vi/ localization support and utilities for .Xr vi 1 -.It Pa zoneinfo/ -timezone configuration information; -see -.Xr tzfile 5 -.El .It Pa vt/ files used by vt; see @@ -669,6 +664,11 @@ and .\" .It Pa scrnmaps/ .\" console screen maps .El +.It Pa zoneinfo/ +timezone configuration information; +see +.Xr tzfile 5 +.El .It Pa src/ .Bx , third-party, and/or local source files From owner-svn-src-all@freebsd.org Thu Apr 13 20:32:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D66BD3C752; Thu, 13 Apr 2017 20:32:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C6D8DED; Thu, 13 Apr 2017 20:32:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DKWYwd025803; Thu, 13 Apr 2017 20:32:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DKWYeR025802; Thu, 13 Apr 2017 20:32:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704132032.v3DKWYeR025802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 20:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316785 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 20:32:35 -0000 Author: bdrewery Date: Thu Apr 13 20:32:34 2017 New Revision: 316785 URL: https://svnweb.freebsd.org/changeset/base/316785 Log: MFC r315211: hier(7): Fix entry location for /usr/share/vt. Modified: stable/10/share/man/man7/hier.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/hier.7 ============================================================================== --- stable/10/share/man/man7/hier.7 Thu Apr 13 20:32:18 2017 (r316784) +++ stable/10/share/man/man7/hier.7 Thu Apr 13 20:32:34 2017 (r316785) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 24, 2015 +.Dd March 13, 2017 .Dt HIER 7 .Os .Sh NAME @@ -653,11 +653,6 @@ and .It Pa vi/ localization support and utilities for .Xr vi 1 -.It Pa zoneinfo/ -timezone configuration information; -see -.Xr tzfile 5 -.El .It Pa vt/ files used by vt; see @@ -678,6 +673,11 @@ and .\" .It Pa scrnmaps/ .\" console screen maps .El +.It Pa zoneinfo/ +timezone configuration information; +see +.Xr tzfile 5 +.El .It Pa src/ .Bx , third-party, and/or local source files From owner-svn-src-all@freebsd.org Thu Apr 13 20:33:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E616D3C80F; Thu, 13 Apr 2017 20:33:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4280F6D; Thu, 13 Apr 2017 20:33:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DKXB3l025892; Thu, 13 Apr 2017 20:33:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DKXBna025891; Thu, 13 Apr 2017 20:33:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704132033.v3DKXBna025891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 20:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316786 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 20:33:12 -0000 Author: bdrewery Date: Thu Apr 13 20:33:10 2017 New Revision: 316786 URL: https://svnweb.freebsd.org/changeset/base/316786 Log: MFC r315691: Rename _cc to _gcc to be more clear. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Thu Apr 13 20:32:34 2017 (r316785) +++ stable/11/Makefile.inc1 Thu Apr 13 20:33:10 2017 (r316786) @@ -1815,7 +1815,7 @@ _clang= usr.bin/clang _clang_libs= lib/clang .endif .if ${MK_GCC_BOOTSTRAP} != "no" -_cc= gnu/usr.bin/cc +_gcc= gnu/usr.bin/cc .endif .if ${MK_USB} != "no" _usb_tools= sys/boot/usb/tools @@ -1829,7 +1829,7 @@ cross-tools: .MAKE .PHONY ${_binutils} \ ${_elftctools} \ ${_dtrace_tools} \ - ${_cc} \ + ${_gcc} \ ${_btxld} \ ${_usb_tools} ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ @@ -1901,7 +1901,7 @@ native-xtools: .PHONY usr.bin/ar \ ${_binutils} \ ${_elftctools} \ - ${_cc} \ + ${_gcc} \ ${_gcc_tools} \ ${_clang_libs} \ ${_clang} \ @@ -2536,7 +2536,7 @@ _xb-cross-tools: .PHONY usr.bin/ar \ ${_clang_libs} \ ${_clang} \ - ${_cc} + ${_gcc} ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,all)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ @@ -2573,7 +2573,7 @@ _xi-cross-tools: .PHONY usr.bin/ar \ ${_clang_libs} \ ${_clang} \ - ${_cc} + ${_gcc} ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} From owner-svn-src-all@freebsd.org Thu Apr 13 20:34:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AF1FD3C8EC; Thu, 13 Apr 2017 20:34:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6775F11A0; Thu, 13 Apr 2017 20:34:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DKY2eL025964; Thu, 13 Apr 2017 20:34:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DKY2ic025963; Thu, 13 Apr 2017 20:34:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704132034.v3DKY2ic025963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 20:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316787 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 20:34:03 -0000 Author: bdrewery Date: Thu Apr 13 20:34:02 2017 New Revision: 316787 URL: https://svnweb.freebsd.org/changeset/base/316787 Log: MFC r315691: Rename _cc to _gcc to be more clear. Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Thu Apr 13 20:33:10 2017 (r316786) +++ stable/10/Makefile.inc1 Thu Apr 13 20:34:02 2017 (r316787) @@ -1528,12 +1528,12 @@ _binutils= gnu/usr.bin/binutils _clang= usr.bin/clang _clang_libs= lib/clang .else -_cc= gnu/usr.bin/cc +_gcc= gnu/usr.bin/cc .endif # The boot2 for pc98 requires gcc. .if ${TARGET} == "pc98" -_cc= gnu/usr.bin/cc +_gcc= gnu/usr.bin/cc .endif .endif @@ -1542,7 +1542,7 @@ cross-tools: .MAKE .PHONY ${_clang_libs} \ ${_clang} \ ${_binutils} \ - ${_cc} \ + ${_gcc} \ usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ ${_btxld} \ ${_crunchide} \ @@ -1598,7 +1598,7 @@ native-xtools: .PHONY ${_clang_tblgen} \ usr.bin/ar \ ${_binutils} \ - ${_cc} \ + ${_gcc} \ ${_gcc_tools} \ ${_clang_libs} \ ${_clang} \ @@ -2188,7 +2188,7 @@ _xb-cross-tools: .PHONY usr.bin/ar \ ${_clang_libs} \ ${_clang} \ - ${_cc} + ${_gcc} ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ @@ -2221,7 +2221,7 @@ _xi-cross-tools: .PHONY usr.bin/ar \ ${_clang_libs} \ ${_clang} \ - ${_cc} + ${_gcc} ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} From owner-svn-src-all@freebsd.org Thu Apr 13 20:34:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20A49D3C962; Thu, 13 Apr 2017 20:34:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E657E1334; Thu, 13 Apr 2017 20:34:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DKYrlA026035; Thu, 13 Apr 2017 20:34:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DKYres026034; Thu, 13 Apr 2017 20:34:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704132034.v3DKYres026034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 20:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316788 - stable/11/share/mk X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 20:34:54 -0000 Author: bdrewery Date: Thu Apr 13 20:34:52 2017 New Revision: 316788 URL: https://svnweb.freebsd.org/changeset/base/316788 Log: MFC r315461: META_MODE: Fix not using .depend files when no OBJDIR is present. Modified: stable/11/share/mk/bsd.dep.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.dep.mk ============================================================================== --- stable/11/share/mk/bsd.dep.mk Thu Apr 13 20:34:02 2017 (r316787) +++ stable/11/share/mk/bsd.dep.mk Thu Apr 13 20:34:52 2017 (r316788) @@ -75,6 +75,13 @@ tags: ${SRCS} .if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon) _meta_filemon= 1 .endif +# By default META_MODE is disabled in bmake if there is no OBJDIR +# unless .MAKE.MODE contains "curdirOk=[^0nNfF]" +.if defined(_meta_filemon) && ${.OBJDIR} == ${.CURDIR} && \ + (empty(.MAKE.MODE:tl:Mcurdirok=*) || \ + !empty(.MAKE.MODE:tl:Mcurdirok=[0NnFf]*)) +.undef _meta_filemon +.endif # Skip reading .depend when not needed to speed up tree-walks and simple # lookups. See _SKIP_BUILD logic in bsd.init.mk for more details. From owner-svn-src-all@freebsd.org Thu Apr 13 20:35:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AC7BD3C9C3; Thu, 13 Apr 2017 20:35:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29CD414B4; Thu, 13 Apr 2017 20:35:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DKZXIS026115; Thu, 13 Apr 2017 20:35:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DKZX5Q026114; Thu, 13 Apr 2017 20:35:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704132035.v3DKZX5Q026114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 20:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316789 - stable/11/sys/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 20:35:34 -0000 Author: bdrewery Date: Thu Apr 13 20:35:33 2017 New Revision: 316789 URL: https://svnweb.freebsd.org/changeset/base/316789 Log: MFC r315459: kmod: Fix depending on ILINKS for tracked DEPENDOBJS. Modified: stable/11/sys/conf/kmod.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kmod.mk ============================================================================== --- stable/11/sys/conf/kmod.mk Thu Apr 13 20:34:52 2017 (r316788) +++ stable/11/sys/conf/kmod.mk Thu Apr 13 20:35:33 2017 (r316789) @@ -274,7 +274,7 @@ beforebuild: ${_ILINKS} # causes all the modules to be rebuilt when the directory pointed to changes. .for _link in ${_ILINKS} .if !exists(${.OBJDIR}/${_link}) -${OBJS}: ${_link} +OBJS_DEPEND_GUESS+= ${_link} .endif .endfor From owner-svn-src-all@freebsd.org Thu Apr 13 20:36:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAE1FD3CA69; Thu, 13 Apr 2017 20:36:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA98D1638; Thu, 13 Apr 2017 20:36:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DKaM8J026193; Thu, 13 Apr 2017 20:36:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DKaM5J026192; Thu, 13 Apr 2017 20:36:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704132036.v3DKaM5J026192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 20:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316790 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 20:36:24 -0000 Author: bdrewery Date: Thu Apr 13 20:36:22 2017 New Revision: 316790 URL: https://svnweb.freebsd.org/changeset/base/316790 Log: MFC r316066: Release ccb if mode_buffer allocation fails. Modified: stable/11/sys/cam/scsi/scsi_ch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_ch.c Thu Apr 13 20:35:33 2017 (r316789) +++ stable/11/sys/cam/scsi/scsi_ch.c Thu Apr 13 20:36:22 2017 (r316790) @@ -1569,6 +1569,7 @@ chgetparams(struct cam_periph *periph) if (mode_buffer == NULL) { printf("chgetparams: couldn't malloc mode sense data\n"); + xpt_release_ccb(ccb); return(ENOSPC); } From owner-svn-src-all@freebsd.org Thu Apr 13 20:36:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F225D3CAE3; Thu, 13 Apr 2017 20:36:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BC68175B; Thu, 13 Apr 2017 20:36:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DKaeEr026246; Thu, 13 Apr 2017 20:36:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DKae6C026245; Thu, 13 Apr 2017 20:36:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704132036.v3DKae6C026245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 20:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316791 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 20:36:41 -0000 Author: bdrewery Date: Thu Apr 13 20:36:40 2017 New Revision: 316791 URL: https://svnweb.freebsd.org/changeset/base/316791 Log: MFC r316066: Release ccb if mode_buffer allocation fails. Modified: stable/10/sys/cam/scsi/scsi_ch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_ch.c Thu Apr 13 20:36:22 2017 (r316790) +++ stable/10/sys/cam/scsi/scsi_ch.c Thu Apr 13 20:36:40 2017 (r316791) @@ -1569,6 +1569,7 @@ chgetparams(struct cam_periph *periph) if (mode_buffer == NULL) { printf("chgetparams: couldn't malloc mode sense data\n"); + xpt_release_ccb(ccb); return(ENOSPC); } From owner-svn-src-all@freebsd.org Thu Apr 13 21:54:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDBACD3CB05; Thu, 13 Apr 2017 21:54:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CD5FA82; Thu, 13 Apr 2017 21:54:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DLsKJq058643; Thu, 13 Apr 2017 21:54:20 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DLsKp7058635; Thu, 13 Apr 2017 21:54:20 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704132154.v3DLsKp7058635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 13 Apr 2017 21:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316792 - in head/sys: fs/nfs fs/nfsclient nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 21:54:21 -0000 Author: rmacklem Date: Thu Apr 13 21:54:19 2017 New Revision: 316792 URL: https://svnweb.freebsd.org/changeset/base/316792 Log: Add an NFSv4.1 mount option for "use one openowner". Some NFSv4.1 servers such as AmazonEFS can only support a small fixed number of open_owner4s. This patch adds a mount option called "oneopenown" that can be used for NFSv4.1 mounts to make the client do all Opens with the same open_owner4 string. This option can only be used with NFSv4.1 and may not work correctly when Delegations are is use. Reported by: cperciva Tested by: cperciva MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D8988 Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/nfsclient/nfsargs.h Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Thu Apr 13 20:36:40 2017 (r316791) +++ head/sys/fs/nfs/nfs_var.h Thu Apr 13 21:54:19 2017 (r316792) @@ -502,8 +502,8 @@ int nfscl_open(vnode_t, u_int8_t *, int, int *, int *, int); int nfscl_getstateid(vnode_t, u_int8_t *, int, u_int32_t, int, struct ucred *, NFSPROC_T *, nfsv4stateid_t *, void **); -void nfscl_ownerrelease(struct nfsclowner *, int, int, int); -void nfscl_openrelease(struct nfsclopen *, int, int); +void nfscl_ownerrelease(struct nfsmount *, struct nfsclowner *, int, int, int); +void nfscl_openrelease(struct nfsmount *, struct nfsclopen *, int, int); int nfscl_getcl(struct mount *, struct ucred *, NFSPROC_T *, int, struct nfsclclient **); struct nfsclclient *nfscl_findcl(struct nfsmount *); Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Thu Apr 13 20:36:40 2017 (r316791) +++ head/sys/fs/nfs/nfsport.h Thu Apr 13 21:54:19 2017 (r316792) @@ -929,6 +929,8 @@ int newnfs_realign(struct mbuf **, int); #define NFSHASNOLAYOUTCOMMIT(n) ((n)->nm_state & NFSSTA_NOLAYOUTCOMMIT) #define NFSHASSESSPERSIST(n) ((n)->nm_state & NFSSTA_SESSPERSIST) #define NFSHASPNFS(n) ((n)->nm_state & NFSSTA_PNFS) +#define NFSHASONEOPENOWN(n) (((n)->nm_flag & NFSMNT_ONEOPENOWN) != 0 && \ + (n)->nm_minorvers > 0) /* * Gets the stats field out of the mount structure. Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Thu Apr 13 20:36:40 2017 (r316791) +++ head/sys/fs/nfsclient/nfs_clport.c Thu Apr 13 21:54:19 2017 (r316792) @@ -634,7 +634,7 @@ nfscl_filllockowner(void *id, u_int8_t * struct proc *p; if (id == NULL) { - printf("NULL id\n"); + /* Return the single open_owner of all 0 bytes. */ bzero(cp, NFSV4CL_LOCKNAMELEN); return; } @@ -1255,7 +1255,14 @@ nfscl_procdoesntexist(u_int8_t *own) } tl; struct proc *p; pid_t pid; - int ret = 0; + int i, ret = 0; + + /* For the single open_owner of all 0 bytes, just return 0. */ + for (i = 0; i < NFSV4CL_LOCKNAMELEN; i++) + if (own[i] != 0) + break; + if (i == NFSV4CL_LOCKNAMELEN) + return (0); tl.cval[0] = *own++; tl.cval[1] = *own++; Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Thu Apr 13 20:36:40 2017 (r316791) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Thu Apr 13 21:54:19 2017 (r316792) @@ -347,7 +347,7 @@ else printf(" fhl=0\n"); */ if (!error) op->nfso_opencnt++; - nfscl_openrelease(op, error, newone); + nfscl_openrelease(nmp, op, error, newone); if (error == NFSERR_GRACE || error == NFSERR_STALECLIENTID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || error == NFSERR_BADSESSION) { @@ -1893,7 +1893,7 @@ nfsrpc_create(vnode_t dvp, char *name, i if (dp != NULL) (void) nfscl_deleg(nmp->nm_mountp, owp->nfsow_clp, (*nfhpp)->nfh_fh, (*nfhpp)->nfh_len, cred, p, &dp); - nfscl_ownerrelease(owp, error, newone, unlocked); + nfscl_ownerrelease(nmp, owp, error, newone, unlocked); if (error == NFSERR_GRACE || error == NFSERR_STALECLIENTID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || error == NFSERR_BADSESSION) { @@ -2198,7 +2198,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, error = ret; } } - nfscl_openrelease(op, error, newone); + nfscl_openrelease(nmp, op, error, newone); *unlockedp = 1; } if (nd->nd_repstat != 0 && error == 0) Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Thu Apr 13 20:36:40 2017 (r316791) +++ head/sys/fs/nfsclient/nfs_clstate.c Thu Apr 13 21:54:19 2017 (r316792) @@ -247,7 +247,6 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i * If none found, add the new one or return error, depending upon * "create". */ - nfscl_filllockowner(p->td_proc, own, F_POSIX); NFSLOCKCLSTATE(); dp = NULL; /* First check the delegation list */ @@ -264,10 +263,17 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i } } - if (dp != NULL) + if (dp != NULL) { + nfscl_filllockowner(p->td_proc, own, F_POSIX); ohp = &dp->nfsdl_owner; - else + } else { + /* For NFSv4.1 and this option, use a single open_owner. */ + if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) + nfscl_filllockowner(NULL, own, F_POSIX); + else + nfscl_filllockowner(p->td_proc, own, F_POSIX); ohp = &clp->nfsc_owner; + } /* Now, search for an openowner */ LIST_FOREACH(owp, ohp, nfsow_list) { if (!NFSBCMP(owp->nfsow_owner, own, NFSV4CL_LOCKNAMELEN)) @@ -300,9 +306,24 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i /* * Serialize modifications to the open owner for multiple threads * within the same process using a read/write sleep lock. + * For NFSv4.1 and a single OpenOwner, allow concurrent open operations + * by acquiring a shared lock. The close operations still use an + * exclusive lock for this case. */ - if (lockit) - nfscl_lockexcl(&owp->nfsow_rwlock, NFSCLSTATEMUTEXPTR); + if (lockit != 0) { + if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) { + /* + * Get a shared lock on the OpenOwner, but first + * wait for any pending exclusive lock, so that the + * exclusive locker gets priority. + */ + nfsv4_lock(&owp->nfsow_rwlock, 0, NULL, + NFSCLSTATEMUTEXPTR, NULL); + nfsv4_getref(&owp->nfsow_rwlock, NULL, + NFSCLSTATEMUTEXPTR, NULL); + } else + nfscl_lockexcl(&owp->nfsow_rwlock, NFSCLSTATEMUTEXPTR); + } NFSUNLOCKCLSTATE(); if (nowp != NULL) FREE((caddr_t)nowp, M_NFSCLOWNER); @@ -545,7 +566,10 @@ nfscl_getstateid(vnode_t vp, u_int8_t *n * If p != NULL, we want to search the parentage tree * for a matching OpenOwner and use that. */ - nfscl_filllockowner(p->td_proc, own, F_POSIX); + if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) + nfscl_filllockowner(NULL, own, F_POSIX); + else + nfscl_filllockowner(p->td_proc, own, F_POSIX); lp = NULL; error = nfscl_getopen(&clp->nfsc_owner, nfhp, fhlen, own, own, mode, &lp, &op); @@ -679,15 +703,19 @@ nfscl_getopen(struct nfsclownerhead *ohp * with the open owner. */ APPLESTATIC void -nfscl_ownerrelease(struct nfsclowner *owp, __unused int error, - __unused int candelete, int unlocked) +nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclowner *owp, + __unused int error, __unused int candelete, int unlocked) { if (owp == NULL) return; NFSLOCKCLSTATE(); - if (!unlocked) - nfscl_lockunlock(&owp->nfsow_rwlock); + if (unlocked == 0) { + if (NFSHASONEOPENOWN(nmp)) + nfsv4_relref(&owp->nfsow_rwlock); + else + nfscl_lockunlock(&owp->nfsow_rwlock); + } nfscl_clrelease(owp->nfsow_clp); NFSUNLOCKCLSTATE(); } @@ -696,7 +724,8 @@ nfscl_ownerrelease(struct nfsclowner *ow * Release use of an open structure under an open owner. */ APPLESTATIC void -nfscl_openrelease(struct nfsclopen *op, int error, int candelete) +nfscl_openrelease(struct nfsmount *nmp, struct nfsclopen *op, int error, + int candelete) { struct nfsclclient *clp; struct nfsclowner *owp; @@ -705,7 +734,10 @@ nfscl_openrelease(struct nfsclopen *op, return; NFSLOCKCLSTATE(); owp = op->nfso_own; - nfscl_lockunlock(&owp->nfsow_rwlock); + if (NFSHASONEOPENOWN(nmp)) + nfsv4_relref(&owp->nfsow_rwlock); + else + nfscl_lockunlock(&owp->nfsow_rwlock); clp = owp->nfsow_clp; if (error && candelete && op->nfso_opencnt == 0) nfscl_freeopen(op, 0); @@ -997,7 +1029,10 @@ nfscl_getbytelock(vnode_t vp, u_int64_t } else { nfscl_filllockowner(id, own, flags); ownp = own; - nfscl_filllockowner(p->td_proc, openown, F_POSIX); + if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) + nfscl_filllockowner(NULL, openown, F_POSIX); + else + nfscl_filllockowner(p->td_proc, openown, F_POSIX); openownp = openown; } if (!recovery) { @@ -1725,6 +1760,7 @@ nfscl_cleanupkext(struct nfsclclient *cl struct nfsclowner *owp, *nowp; struct nfsclopen *op; struct nfscllockowner *lp, *nlp; + struct nfscldeleg *dp; NFSPROCLISTLOCK(); NFSLOCKCLSTATE(); @@ -1738,6 +1774,20 @@ nfscl_cleanupkext(struct nfsclclient *cl if (nfscl_procdoesntexist(owp->nfsow_owner)) nfscl_cleanup_common(clp, owp->nfsow_owner); } + + /* + * For the single open_owner case, these lock owners need to be + * checked to see if they still exist separately. + * This is because nfscl_procdoesntexist() never returns true for + * the single open_owner so that the above doesn't ever call + * nfscl_cleanup_common(). + */ + TAILQ_FOREACH(dp, &clp->nfsc_deleg, nfsdl_list) { + LIST_FOREACH_SAFE(lp, &dp->nfsdl_lock, nfsl_list, nlp) { + if (nfscl_procdoesntexist(lp->nfsl_owner)) + nfscl_cleanup_common(clp, lp->nfsl_owner); + } + } NFSUNLOCKCLSTATE(); NFSPROCLISTUNLOCK(); } Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Thu Apr 13 20:36:40 2017 (r316791) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Thu Apr 13 21:54:19 2017 (r316792) @@ -592,6 +592,12 @@ nfs_decode_args(struct mount *mp, struct nmp->nm_flag &= ~NFSMNT_RDIRPLUS; } + /* Clear ONEOPENOWN for NFSv2, 3 and 4.0. */ + if (nmp->nm_minorvers == 0) { + argp->flags &= ~NFSMNT_ONEOPENOWN; + nmp->nm_flag &= ~NFSMNT_ONEOPENOWN; + } + /* Re-bind if rsrvd port requested and wasn't on one */ adjsock = !(nmp->nm_flag & NFSMNT_RESVPORT) && (argp->flags & NFSMNT_RESVPORT); @@ -727,7 +733,7 @@ static const char *nfs_opts[] = { "from" "resvport", "readahead", "hostname", "timeo", "timeout", "addr", "fh", "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", "minorversion", "nametimeo", "negnametimeo", "nocto", "noncontigwr", - "pnfs", "wcommitsize", + "pnfs", "wcommitsize", "oneopenown", NULL }; /* @@ -962,6 +968,8 @@ nfs_mount(struct mount *mp) args.flags |= NFSMNT_NONCONTIGWR; if (vfs_getopt(mp->mnt_optnew, "pnfs", NULL, NULL) == 0) args.flags |= NFSMNT_PNFS; + if (vfs_getopt(mp->mnt_optnew, "oneopenown", NULL, NULL) == 0) + args.flags |= NFSMNT_ONEOPENOWN; if (vfs_getopt(mp->mnt_optnew, "readdirsize", (void **)&opt, NULL) == 0) { if (opt == NULL) { vfs_mount_error(mp, "illegal readdirsize"); @@ -1172,8 +1180,8 @@ nfs_mount(struct mount *mp) /* * When doing an update, we can't change version, - * security, switch lockd strategies or change cookie - * translation + * security, switch lockd strategies, change cookie + * translation or switch oneopenown. */ args.flags = (args.flags & ~(NFSMNT_NFSV3 | @@ -1181,6 +1189,7 @@ nfs_mount(struct mount *mp) NFSMNT_KERB | NFSMNT_INTEGRITY | NFSMNT_PRIVACY | + NFSMNT_ONEOPENOWN | NFSMNT_NOLOCKD /*|NFSMNT_XLATECOOKIE*/)) | (nmp->nm_flag & (NFSMNT_NFSV3 | @@ -1188,6 +1197,7 @@ nfs_mount(struct mount *mp) NFSMNT_KERB | NFSMNT_INTEGRITY | NFSMNT_PRIVACY | + NFSMNT_ONEOPENOWN | NFSMNT_NOLOCKD /*|NFSMNT_XLATECOOKIE*/)); nfs_decode_args(mp, nmp, &args, NULL, td->td_ucred, td); goto out; @@ -1946,6 +1956,8 @@ void nfscl_retopts(struct nfsmount *nmp, &blen); nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_PNFS) != 0, ",pnfs", &buf, &blen); + nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_ONEOPENOWN) != 0 && + nmp->nm_minorvers > 0, ",oneopenown", &buf, &blen); } nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_NFSV3) != 0, "nfsv3", &buf, &blen); Modified: head/sys/nfsclient/nfsargs.h ============================================================================== --- head/sys/nfsclient/nfsargs.h Thu Apr 13 20:36:40 2017 (r316791) +++ head/sys/nfsclient/nfsargs.h Thu Apr 13 21:54:19 2017 (r316792) @@ -76,7 +76,7 @@ struct nfs_args { #define NFSMNT_MAXGRPS 0x00000020 /* set maximum grouplist size */ #define NFSMNT_INT 0x00000040 /* allow interrupts on hard mount */ #define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */ -/* 0x100 free, was NFSMNT_NQNFS */ +#define NFSMNT_ONEOPENOWN 0x00000100 /* Use one OpenOwner for NFSv4.1 */ #define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */ #define NFSMNT_KERB 0x00000400 /* Use RPCSEC_GSS/Krb5 */ #define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */ From owner-svn-src-all@freebsd.org Thu Apr 13 22:05:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B1C6D3CD8C; Thu, 13 Apr 2017 22:05:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CFCCF4B; Thu, 13 Apr 2017 22:05:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DM5OMK062862; Thu, 13 Apr 2017 22:05:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DM5Okw062861; Thu, 13 Apr 2017 22:05:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704132205.v3DM5Okw062861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 13 Apr 2017 22:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316793 - head/sbin/mount_nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 22:05:25 -0000 Author: rmacklem Date: Thu Apr 13 22:05:24 2017 New Revision: 316793 URL: https://svnweb.freebsd.org/changeset/base/316793 Log: Document the "oneopenown" option added by r316792. This is a content change. MFC after: 2 weeks Modified: head/sbin/mount_nfs/mount_nfs.8 Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Thu Apr 13 21:54:19 2017 (r316792) +++ head/sbin/mount_nfs/mount_nfs.8 Thu Apr 13 22:05:24 2017 (r316793) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd September 10, 2016 +.Dd April 13, 2017 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -201,6 +201,14 @@ The only minor version currently support This option is only meaningful when used with the .Cm nfsv4 option. +.It Cm oneopenown +Make a minor version 1 of the NFS Version 4 protocol mount use a single OpenOwner +for all Opens. +This may be useful for a server with a very low limit on OpenOwners, such as +AmazonEFS. +It can only be used with an NFSv4.1 mount. +It may not work correctly when Delegations are being issued by a server, +but note that the AmazonEFS server does not issued delegations at this time. .It Cm pnfs Enable support for parallel NFS (pNFS) for minor version 1 of the NFS Version 4 protocol. From owner-svn-src-all@freebsd.org Thu Apr 13 22:07:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50750D3CE6B; Thu, 13 Apr 2017 22:07:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B65C10EA; Thu, 13 Apr 2017 22:07:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DM7ZuR062981; Thu, 13 Apr 2017 22:07:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DM7Z8a062979; Thu, 13 Apr 2017 22:07:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201704132207.v3DM7Z8a062979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 13 Apr 2017 22:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316794 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 22:07:36 -0000 Author: bdrewery Date: Thu Apr 13 22:07:34 2017 New Revision: 316794 URL: https://svnweb.freebsd.org/changeset/base/316794 Log: Cache compiler metadata and reuse it at installworld time. Right after cross-tools, a compiler-metadata.mk file is created that stores all of the bsd.compiler.mk metadata. It is then read in with a fail-safe during installworld time. The file is explicitly removed when invoking cross-tools to ensure that a stale file is not left around from odd manual 'make _cross-tools' -> 'make installworld' invocations. This fixes several issues: - With WITH_SYSTEM_COMPILER (default yes on head and no on releng/11.0): If you build on a system where the bootstrap compiler does not build due to the host compiler matching the in-tree one, but then installworld on another system where that logic fails (a bootstrap compiler is needed), the installworld immediately fails with: sh: cc: not found Note that fixing this logic may then hit a case where a rebuild is attempted in installworld. Normally cc would be ran with 'CFLAGS+=ERROR-tried-to-rebuild-during-make-install' to cause an error such as: cc: error: no such file or directory: 'ERROR-tried-to-rebuild-during-make-install' However, now it will just fail with the 'cc: not found' error. Inspection of the compile line will show 'ERROR-tried-to-rebuild-during-make-install'; It's not useful to set CC to anything other than 'cc' during install as it is more helpful to see the attempted compile rather than some other bogus error. - This now avoids running bsd.compiler.mk (cc executions) even more during installworld. There are compiler-dependent SUBDIR in the tree which required having a compiler during install. There is at least 1 case where CC is still executed in the install, such as from a LOOKUP!= in secure/lib/libcrypto/Makefile.inc checking for 'vzeroall' support. This is not significant for installworld as the lookup has a fallback (and hides its error) and only modifies CFLAGS, thus it's not worth fixing. PR: 212877 MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Thu Apr 13 22:05:24 2017 (r316793) +++ head/Makefile Thu Apr 13 22:07:34 2017 (r316794) @@ -127,7 +127,7 @@ TGTS= all all-man buildenv buildenvvars installworld kernel-toolchain libraries lint maninstall \ obj objlink rerelease showconfig tags toolchain update \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ - _build-tools _cross-tools _includes _libraries \ + _build-tools _compiler-metadata _cross-tools _includes _libraries \ build32 distribute32 install32 buildsoft distributesoft installsoft \ builddtb xdev xdev-build xdev-install \ xdev-links native-xtools stageworld stagekernel stage-packages \ Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 13 22:05:24 2017 (r316793) +++ head/Makefile.inc1 Thu Apr 13 22:07:34 2017 (r316794) @@ -78,6 +78,19 @@ MK_CLANG_BOOTSTRAP= no MK_GCC_BOOTSTRAP= no .endif +MAKEOBJDIRPREFIX?= /usr/obj +.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING) +OBJTREE= ${MAKEOBJDIRPREFIX} +.else +OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} +.endif + +# Pull in compiler metadata from buildworld/toolchain if possible to avoid +# running CC from bsd.compiler.mk. +.if make(installworld) || make(install) +.-include "${OBJTREE}${.CURDIR}/compiler-metadata.mk" +.endif + # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. .include .include "share/mk/src.opts.mk" @@ -163,6 +176,20 @@ CROSSENV+= COMPILER_VERSION=${X_COMPILER COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION} .endif .endif +# Store some compiler metadata for use in installworld where we don't +# want to invoke CC at all. +_COMPILER_METADATA_VARS= COMPILER_VERSION \ + COMPILER_TYPE \ + COMPILER_FEATURES \ + COMPILER_FREEBSD_VERSION +compiler-metadata.mk: .PHONY .META + @: > ${.TARGET} + @echo ".info Using cached compiler metadata from build at $$(hostname) on $$(date)" \ + > ${.TARGET} +.for v in ${_COMPILER_METADATA_VARS} + @echo "${v}=${${v}}" >> ${.TARGET} +.endfor + @echo ".export ${_COMPILER_METADATA_VARS}" >> ${.TARGET} # Handle external binutils. .if defined(CROSS_TOOLCHAIN_PREFIX) @@ -304,7 +331,6 @@ SVN= ${_P}/${_S} .endif SVNFLAGS?= -r HEAD -MAKEOBJDIRPREFIX?= /usr/obj .if !defined(OSRELDATE) .if exists(/usr/include/osreldate.h) OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ @@ -401,11 +427,6 @@ BUILD_ARCH!= uname -p .error To cross-build, set TARGET_ARCH. .endif .endif -.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING) -OBJTREE= ${MAKEOBJDIRPREFIX} -.else -OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} -.endif WORLDTMP= ${OBJTREE}${.CURDIR}/tmp BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin @@ -766,8 +787,15 @@ _cross-tools: @echo "--------------------------------------------------------------" @echo ">>> stage 3: cross tools" @echo "--------------------------------------------------------------" + @rm -f ${.OBJDIR}/compiler-metadata.mk ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools +_compiler-metadata: + @echo + @echo "--------------------------------------------------------------" + @echo ">>> stage 3.1: recording compiler metadata" + @echo "--------------------------------------------------------------" + ${_+_}cd ${.CURDIR}; ${WMAKE} compiler-metadata.mk _includes: @echo @echo "--------------------------------------------------------------" @@ -801,6 +829,7 @@ WMAKE_TGTS+= _worldtmp _legacy WMAKE_TGTS+= _bootstrap-tools .endif WMAKE_TGTS+= _cleanobj _obj _build-tools _cross-tools +WMAKE_TGTS+= _compiler-metadata WMAKE_TGTS+= _includes _libraries WMAKE_TGTS+= everything .if defined(LIBCOMPAT) && empty(SUBDIR_OVERRIDE) From owner-svn-src-all@freebsd.org Thu Apr 13 22:59:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30E81D3D2F5; Thu, 13 Apr 2017 22:59:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCFD1F33; Thu, 13 Apr 2017 22:59:18 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DMxIos083418; Thu, 13 Apr 2017 22:59:18 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DMxHPs083416; Thu, 13 Apr 2017 22:59:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704132259.v3DMxHPs083416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 13 Apr 2017 22:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316795 - in head/usr.sbin/ctm: ctm_dequeue ctm_smail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 22:59:19 -0000 Author: cem Date: Thu Apr 13 22:59:17 2017 New Revision: 316795 URL: https://svnweb.freebsd.org/changeset/base/316795 Log: ctm: Fix some trivial argv buffer overruns It may not do the right thing with these obviously wrong inputs, but at least it won't smash the stack. Reported by: Coverity (CWE-120) CIDs: 1006697, 1006698 Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c head/usr.sbin/ctm/ctm_smail/ctm_smail.c Modified: head/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c ============================================================================== --- head/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c Thu Apr 13 22:07:34 2017 (r316794) +++ head/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c Thu Apr 13 22:59:17 2017 (r316795) @@ -115,7 +115,8 @@ main(int argc, char **argv) if (ftsent->fts_info != FTS_F || ftsent->fts_name[0] == '.') continue; - sprintf(filename, "%s/%s", queue_dir, ftsent->fts_name); + snprintf(filename, sizeof(filename), "%s/%s", queue_dir, + ftsent->fts_name); fd = open(filename, O_RDONLY); if (fd < 0) { Modified: head/usr.sbin/ctm/ctm_smail/ctm_smail.c ============================================================================== --- head/usr.sbin/ctm/ctm_smail/ctm_smail.c Thu Apr 13 22:07:34 2017 (r316794) +++ head/usr.sbin/ctm/ctm_smail/ctm_smail.c Thu Apr 13 22:59:17 2017 (r316795) @@ -190,13 +190,13 @@ chop_and_send(FILE *dfp, char *delta, lo * Construct the tmp queue file name of a delta piece. */ #define mk_tmp_name(fn,qd,p) \ - sprintf((fn), "%s/.%08ld.%03d", (qd), (long)getpid(), (p)) + snprintf((fn), sizeof(fn), "%s/.%08ld.%03d", (qd), (long)getpid(), (p)) /* * Construct the final queue file name of a delta piece. */ #define mk_queue_name(fn,qd,d,p,n) \ - sprintf((fn), "%s/%s+%03d-%03d", (qd), (d), (p), (n)) + snprintf((fn), sizeof(fn), "%s/%s+%03d-%03d", (qd), (d), (p), (n)) /* * Carve our CTM delta into pieces, encode them, and queue them. From owner-svn-src-all@freebsd.org Thu Apr 13 23:00:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8239CD3D376; Thu, 13 Apr 2017 23:00:27 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 546CAF9; Thu, 13 Apr 2017 23:00:27 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DN0QxK083540; Thu, 13 Apr 2017 23:00:26 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DN0QGN083539; Thu, 13 Apr 2017 23:00:26 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201704132300.v3DN0QGN083539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 13 Apr 2017 23:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316796 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 23:00:27 -0000 Author: jkim Date: Thu Apr 13 23:00:26 2017 New Revision: 316796 URL: https://svnweb.freebsd.org/changeset/base/316796 Log: Attempt to clear logos more thoroughly. PR: 202288 Reviewed by: cem Modified: head/sys/dev/vt/vt_cpulogos.c Modified: head/sys/dev/vt/vt_cpulogos.c ============================================================================== --- head/sys/dev/vt/vt_cpulogos.c Thu Apr 13 22:59:17 2017 (r316795) +++ head/sys/dev/vt/vt_cpulogos.c Thu Apr 13 23:00:26 2017 (r316796) @@ -153,6 +153,7 @@ vt_fini_logos(void *dummy __unused) struct winsize wsz; term_pos_t size; unsigned int i; + int row; if (!vt_draw_logo_cpus) return; @@ -170,7 +171,7 @@ vt_fini_logos(void *dummy __unused) vt_draw_logo_cpus = 0; VT_UNLOCK(vd); - for (i = 0; i < VT_MAXWINDOWS; i++) { + for (i = row = 0; i < VT_MAXWINDOWS; i++) { vw = vd->vd_windows[i]; if (vw == NULL) continue; @@ -193,11 +194,16 @@ vt_fini_logos(void *dummy __unused) vt_compute_drawable_area(vw); if (vd->vd_curwindow == vw) { + row = vw->vw_draw_area.tr_begin.tp_row; vd->vd_flags |= VDF_INVALID; vt_resume_flush_timer(vd, 0); } VT_UNLOCK(vd); } + + if (row > 0 && vd->vd_driver->vd_drawrect != NULL) + vd->vd_driver->vd_drawrect(vd, 0, 0, vd->vd_width, row - 1, + 1, TC_BLACK); } static void From owner-svn-src-all@freebsd.org Thu Apr 13 23:22:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 576F0D3DA14; Thu, 13 Apr 2017 23:22:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2995DFE7; Thu, 13 Apr 2017 23:22:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DNMIHk095363; Thu, 13 Apr 2017 23:22:18 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DNMIWh095362; Thu, 13 Apr 2017 23:22:18 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704132322.v3DNMIWh095362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 13 Apr 2017 23:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316797 - head/usr.bin/banner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 23:22:19 -0000 Author: cem Date: Thu Apr 13 23:22:18 2017 New Revision: 316797 URL: https://svnweb.freebsd.org/changeset/base/316797 Log: banner(6): Squash a harmless coverity warning The destination buffer is sized as the sum of program argument lengths, so it has plenty of room for *argv. Appease Coverity by using strlcpy instead of strcpy. Similar to a nearby cleanup performed in r316500. No functional change. Reported by: Coverity (CWE-120) CID: 1006703 Sponsored by: Dell EMC Isilon Modified: head/usr.bin/banner/banner.c Modified: head/usr.bin/banner/banner.c ============================================================================== --- head/usr.bin/banner/banner.c Thu Apr 13 23:00:26 2017 (r316796) +++ head/usr.bin/banner/banner.c Thu Apr 13 23:22:18 2017 (r316797) @@ -1062,7 +1062,7 @@ main(int argc, char *argv[]) j += strlen(argv[i]) + 1; if ((message = malloc((size_t)j)) == NULL) err(1, "malloc"); - strcpy(message, *argv); + strlcpy(message, *argv, j); while (*++argv) { strlcat(message, " ", j); strlcat(message, *argv, j); From owner-svn-src-all@freebsd.org Fri Apr 14 00:13:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF082D3CB8A; Fri, 14 Apr 2017 00:13:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AD1BD5B; Fri, 14 Apr 2017 00:13:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E0DXTi015551; Fri, 14 Apr 2017 00:13:33 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E0DX1J015550; Fri, 14 Apr 2017 00:13:33 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201704140013.v3E0DX1J015550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 14 Apr 2017 00:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316798 - stable/11/usr.sbin/makefs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 00:13:34 -0000 Author: brooks Date: Fri Apr 14 00:13:33 2017 New Revision: 316798 URL: https://svnweb.freebsd.org/changeset/base/316798 Log: MFC r316593: Point out that -F probably does not do what the user expects. Users attempting to create images from mtree METALOG files created by installworld often use -F when they should be passing the METALOG file in place of a directory. This is often produces difficult to debug error reports. Reviewed by: emaste Sponsored by: DARPA, AFRL Modified: stable/11/usr.sbin/makefs/makefs.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/11/usr.sbin/makefs/makefs.8 Thu Apr 13 23:22:18 2017 (r316797) +++ stable/11/usr.sbin/makefs/makefs.8 Fri Apr 14 00:13:33 2017 (r316798) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2016 +.Dd April 6, 2017 .Dt MAKEFS 8 .Os .Sh NAME @@ -116,6 +116,12 @@ set in .Ar debug-mask . XXX: document these .It Fl F Ar mtree-specfile +.Em This is almost certainly not the option you are looking for. +To create an image from a list of files in an mtree format manifest, +specify it as the last argument on the commandline, not as a the +argument to +.Fl F . +.Pp Use .Ar mtree-specfile as an From owner-svn-src-all@freebsd.org Fri Apr 14 00:14:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14321D3CC23; Fri, 14 Apr 2017 00:14:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0A54EA8; Fri, 14 Apr 2017 00:14:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E0EeBE015640; Fri, 14 Apr 2017 00:14:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E0EeC2015639; Fri, 14 Apr 2017 00:14:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704140014.v3E0EeC2015639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 14 Apr 2017 00:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316799 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 00:14:42 -0000 Author: cem Date: Fri Apr 14 00:14:40 2017 New Revision: 316799 URL: https://svnweb.freebsd.org/changeset/base/316799 Log: restore(8): Prevent some heap overflows The environment variable TMPDIR was copied unchecked into a fixed-size heap buffer. Use a length-limiting snprintf in place of ordinary sprintf to prevent the overflow. Long TMPDIR variables can still cause odd truncated filenames, which may be undesirable. Reported by: Coverity (CWE-120) CIDs: 1006706, 1006707 Sponsored by: Dell EMC Isilon Modified: head/sbin/restore/dirs.c Modified: head/sbin/restore/dirs.c ============================================================================== --- head/sbin/restore/dirs.c Fri Apr 14 00:13:33 2017 (r316798) +++ head/sbin/restore/dirs.c Fri Apr 14 00:14:40 2017 (r316799) @@ -140,7 +140,8 @@ extractdirs(int genmode) vprintf(stdout, "Extract directories from tape\n"); if ((tmpdir = getenv("TMPDIR")) == NULL || tmpdir[0] == '\0') tmpdir = _PATH_TMP; - (void) sprintf(dirfile, "%s/rstdir%jd", tmpdir, (intmax_t)dumpdate); + (void) snprintf(dirfile, sizeof(dirfile), "%s/rstdir%jd", tmpdir, + (intmax_t)dumpdate); if (command != 'r' && command != 'R') { (void) strcat(dirfile, "-XXXXXX"); fd = mkstemp(dirfile); @@ -153,8 +154,8 @@ extractdirs(int genmode) done(1); } if (genmode != 0) { - (void) sprintf(modefile, "%s/rstmode%jd", tmpdir, - (intmax_t)dumpdate); + (void) snprintf(modefile, sizeof(modefile), "%s/rstmode%jd", + tmpdir, (intmax_t)dumpdate); if (command != 'r' && command != 'R') { (void) strcat(modefile, "-XXXXXX"); fd = mkstemp(modefile); @@ -568,8 +569,8 @@ setdirmodes(int flags) if ((tmpdir = getenv("TMPDIR")) == NULL || tmpdir[0] == '\0') tmpdir = _PATH_TMP; if (command == 'r' || command == 'R') - (void) sprintf(modefile, "%s/rstmode%jd", tmpdir, - (intmax_t)dumpdate); + (void) snprintf(modefile, sizeof(modefile), "%s/rstmode%jd", + tmpdir, (intmax_t)dumpdate); if (modefile[0] == '#') { panic("modefile not defined\n"); fprintf(stderr, "directory mode, owner, and times not set\n"); From owner-svn-src-all@freebsd.org Fri Apr 14 00:15:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13880D3CCB1; Fri, 14 Apr 2017 00:15:36 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D441C16; Fri, 14 Apr 2017 00:15:35 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E0FYde015720; Fri, 14 Apr 2017 00:15:34 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E0FYVO015719; Fri, 14 Apr 2017 00:15:34 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201704140015.v3E0FYVO015719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 14 Apr 2017 00:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316800 - stable/10/usr.sbin/makefs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 00:15:36 -0000 Author: brooks Date: Fri Apr 14 00:15:34 2017 New Revision: 316800 URL: https://svnweb.freebsd.org/changeset/base/316800 Log: MFC r316593: Point out that -F probably does not do what the user expects. Users attempting to create images from mtree METALOG files created by installworld often use -F when they should be passing the METALOG file in place of a directory. This is often produces difficult to debug error reports. Reviewed by: emaste Sponsored by: DARPA, AFRL Modified: stable/10/usr.sbin/makefs/makefs.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/10/usr.sbin/makefs/makefs.8 Fri Apr 14 00:14:40 2017 (r316799) +++ stable/10/usr.sbin/makefs/makefs.8 Fri Apr 14 00:15:34 2017 (r316800) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 15, 2015 +.Dd April 6, 2017 .Dt MAKEFS 8 .Os .Sh NAME @@ -115,6 +115,12 @@ set in .Ar debug-mask . XXX: document these .It Fl F Ar mtree-specfile +.Em This is almost certainly not the option you are looking for. +To create an image from a list of files in an mtree format manifest, +specify it as the last argument on the commandline, not as a the +argument to +.Fl F . +.Pp Use .Ar mtree-specfile as an From owner-svn-src-all@freebsd.org Fri Apr 14 00:20:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF3D0D3CE71; Fri, 14 Apr 2017 00:20:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A7C9B28C; Fri, 14 Apr 2017 00:20:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v3E0KtiZ048427 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 13 Apr 2017 17:20:55 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v3E0KtjJ048426; Thu, 13 Apr 2017 17:20:55 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 13 Apr 2017 17:20:55 -0700 From: Gleb Smirnoff To: Julian Elischer Cc: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316435 - in head: sbin/ipfw sys/conf sys/modules sys/modules/ipfw_pmod sys/netpfil/ipfw/pmod Message-ID: <20170414002055.GG1033@FreeBSD.org> References: <201704030307.v3337mfs039014@repo.freebsd.org> <2fb0e146-8486-09c3-0c44-75c71a74fc2f@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2fb0e146-8486-09c3-0c44-75c71a74fc2f@freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 00:20:56 -0000 On Mon, Apr 03, 2017 at 10:12:11PM +0800, Julian Elischer wrote: J> On 3/4/17 11:07 am, Andrey V. Elsukov wrote: J> > Author: ae J> > Date: Mon Apr 3 03:07:48 2017 J> > New Revision: 316435 J> > URL: https://svnweb.freebsd.org/changeset/base/316435 J> J> it was always my intention to hook netgraph modules into ipfw in this way Yes, ng_tcpmss (written in 2004) and ng_ipfw (written in 2005) allow to do that. However, this comes with extra CPU cycles, and design flaws. Packet filter is functional and synchronous, while netgraph isn't. Coupling them requires hacks. So nothing wrong in ipfw module. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Fri Apr 14 00:22:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C02B0D3A045; Fri, 14 Apr 2017 00:22:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 909E18AD; Fri, 14 Apr 2017 00:22:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E0MSRl019703; Fri, 14 Apr 2017 00:22:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E0MSZC019702; Fri, 14 Apr 2017 00:22:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704140022.v3E0MSZC019702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 14 Apr 2017 00:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316801 - head/sbin/fsck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 00:22:29 -0000 Author: cem Date: Fri Apr 14 00:22:28 2017 New Revision: 316801 URL: https://svnweb.freebsd.org/changeset/base/316801 Log: fsck(8): Don't overrun mount device buffer Apply a very similar fix to r299460 (fsck_ffs) to apparently duplicated code in fsck. Reported by: Coverity CID: 1006789 Sponsored by: Dell EMC Isilon Modified: head/sbin/fsck/fsutil.c Modified: head/sbin/fsck/fsutil.c ============================================================================== --- head/sbin/fsck/fsutil.c Fri Apr 14 00:15:34 2017 (r316800) +++ head/sbin/fsck/fsutil.c Fri Apr 14 00:22:28 2017 (r316801) @@ -172,6 +172,9 @@ getmntpt(const char *name) statfsp = &mntbuf[i]; dev_name = statfsp->f_mntfromname; if (*dev_name != '/') { + if (strlen(_PATH_DEV) + strlen(dev_name) + 1 > + sizeof(statfsp->f_mntfromname)) + continue; strcpy(device, _PATH_DEV); strcat(device, dev_name); strcpy(statfsp->f_mntfromname, device); From owner-svn-src-all@freebsd.org Fri Apr 14 00:36:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3ABED3A466; Fri, 14 Apr 2017 00:36:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93FAAE31; Fri, 14 Apr 2017 00:36:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E0ajHl024021; Fri, 14 Apr 2017 00:36:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E0aja0024020; Fri, 14 Apr 2017 00:36:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704140036.v3E0aja0024020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 14 Apr 2017 00:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316802 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 00:36:46 -0000 Author: cem Date: Fri Apr 14 00:36:45 2017 New Revision: 316802 URL: https://svnweb.freebsd.org/changeset/base/316802 Log: bsdinstall(8): Sprinkle a snprintf to fixed size buffer Use a snprintf to write an environment variable to a fixed-size buffer to avoid stack overflow. Reported by: Coverity (CWE-120) CID: 1238926 Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri Apr 14 00:22:28 2017 (r316801) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri Apr 14 00:36:45 2017 (r316802) @@ -146,7 +146,7 @@ newfs_command(const char *fstype, char * strcpy(command, "zpool create -f -m none "); if (getenv("BSDINSTALL_TMPBOOT") != NULL) { char zfsboot_path[MAXPATHLEN]; - sprintf(zfsboot_path, "%s/zfs", + snprintf(zfsboot_path, sizeof(zfsboot_path), "%s/zfs", getenv("BSDINSTALL_TMPBOOT")); mkdir(zfsboot_path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); From owner-svn-src-all@freebsd.org Fri Apr 14 00:45:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42A27D3A803; Fri, 14 Apr 2017 00:45:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F2183CE; Fri, 14 Apr 2017 00:45:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E0j9Mf027846; Fri, 14 Apr 2017 00:45:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E0j9je027845; Fri, 14 Apr 2017 00:45:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704140045.v3E0j9je027845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 14 Apr 2017 00:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316803 - head/contrib/tcp_wrappers X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 00:45:10 -0000 Author: cem Date: Fri Apr 14 00:45:09 2017 New Revision: 316803 URL: https://svnweb.freebsd.org/changeset/base/316803 Log: tcp_wrappers: Sprinkle some bounds-checked string copying It isn't clear if tcpd.c is even compiled in FreeBSD. Reported by: Coverity CIDs: 1006710, 1006804 Sponsored by: Dell EMC Isilon Modified: head/contrib/tcp_wrappers/tcpd.c Modified: head/contrib/tcp_wrappers/tcpd.c ============================================================================== --- head/contrib/tcp_wrappers/tcpd.c Fri Apr 14 00:36:45 2017 (r316802) +++ head/contrib/tcp_wrappers/tcpd.c Fri Apr 14 00:45:09 2017 (r316803) @@ -62,10 +62,10 @@ char **argv; */ if (argv[0][0] == '/') { - strcpy(path, argv[0]); + strlcpy(path, argv[0], sizeof(path)); argv[0] = strrchr(argv[0], '/') + 1; } else { - sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]); + snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]); } /* From owner-svn-src-all@freebsd.org Fri Apr 14 01:56:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD75AD3DBE3; Fri, 14 Apr 2017 01:56:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D91491D; Fri, 14 Apr 2017 01:56:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E1uFD1057115; Fri, 14 Apr 2017 01:56:15 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E1uFNi057114; Fri, 14 Apr 2017 01:56:15 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201704140156.v3E1uFNi057114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 14 Apr 2017 01:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316804 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 01:56:16 -0000 Author: glebius Date: Fri Apr 14 01:56:15 2017 New Revision: 316804 URL: https://svnweb.freebsd.org/changeset/base/316804 Log: Fix potential NULL deref. Found by: PVS Studio Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Apr 14 00:45:09 2017 (r316803) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Apr 14 01:56:15 2017 (r316804) @@ -2428,11 +2428,12 @@ DIOCGETSTATES_full: #undef ERROUT DIOCCHANGEADDR_error: - if (newpa->kif) - pfi_kif_unref(newpa->kif); - PF_RULES_WUNLOCK(); - if (newpa != NULL) + if (newpa != NULL) { + if (newpa->kif) + pfi_kif_unref(newpa->kif); free(newpa, M_PFRULE); + } + PF_RULES_WUNLOCK(); if (kif != NULL) free(kif, PFI_MTYPE); break; From owner-svn-src-all@freebsd.org Fri Apr 14 02:24:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E2D8D3D44D; Fri, 14 Apr 2017 02:24:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 403EF8CD; Fri, 14 Apr 2017 02:24:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E2O26V069084; Fri, 14 Apr 2017 02:24:02 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E2O2R0069083; Fri, 14 Apr 2017 02:24:02 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201704140224.v3E2O2R0069083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 14 Apr 2017 02:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316805 - head/sys/dev/ae X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 02:24:03 -0000 Author: yongari Date: Fri Apr 14 02:24:02 2017 New Revision: 316805 URL: https://svnweb.freebsd.org/changeset/base/316805 Log: Fix a potentially forever loop. Found by: PVS-Studio Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Fri Apr 14 01:56:15 2017 (r316804) +++ head/sys/dev/ae/if_ae.c Fri Apr 14 02:24:02 2017 (r316805) @@ -1696,7 +1696,7 @@ ae_stop_txmac(ae_softc_t *sc) /* * Wait for IDLE state. */ - for (i = 0; i < AE_IDLE_TIMEOUT; i--) { + for (i = 0; i < AE_IDLE_TIMEOUT; i++) { val = AE_READ_4(sc, AE_IDLE_REG); if ((val & (AE_IDLE_TXMAC | AE_IDLE_DMAREAD)) == 0) break; From owner-svn-src-all@freebsd.org Fri Apr 14 02:33:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F28BD3D7B8; Fri, 14 Apr 2017 02:33:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10FABF0F; Fri, 14 Apr 2017 02:33:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E2XQlG072937; Fri, 14 Apr 2017 02:33:26 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E2XQCh072936; Fri, 14 Apr 2017 02:33:26 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201704140233.v3E2XQCh072936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 14 Apr 2017 02:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316806 - head/sys/dev/fxp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 02:33:27 -0000 Author: yongari Date: Fri Apr 14 02:33:26 2017 New Revision: 316806 URL: https://svnweb.freebsd.org/changeset/base/316806 Log: Remove unnecessary comparison. Found by: PVS-Studio Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Fri Apr 14 02:24:02 2017 (r316805) +++ head/sys/dev/fxp/if_fxp.c Fri Apr 14 02:33:26 2017 (r316806) @@ -2212,18 +2212,15 @@ fxp_stop(struct fxp_softc *sc) * Release any xmit buffers. */ txp = sc->fxp_desc.tx_list; - if (txp != NULL) { - for (i = 0; i < FXP_NTXCB; i++) { - if (txp[i].tx_mbuf != NULL) { - bus_dmamap_sync(sc->fxp_txmtag, txp[i].tx_map, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->fxp_txmtag, - txp[i].tx_map); - m_freem(txp[i].tx_mbuf); - txp[i].tx_mbuf = NULL; - /* clear this to reset csum offload bits */ - txp[i].tx_cb->tbd[0].tb_addr = 0; - } + for (i = 0; i < FXP_NTXCB; i++) { + if (txp[i].tx_mbuf != NULL) { + bus_dmamap_sync(sc->fxp_txmtag, txp[i].tx_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->fxp_txmtag, txp[i].tx_map); + m_freem(txp[i].tx_mbuf); + txp[i].tx_mbuf = NULL; + /* clear this to reset csum offload bits */ + txp[i].tx_cb->tbd[0].tb_addr = 0; } } bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, From owner-svn-src-all@freebsd.org Fri Apr 14 03:20:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EE6CD3D390; Fri, 14 Apr 2017 03:20:35 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E4E6776; Fri, 14 Apr 2017 03:20:35 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E3KYsQ089788; Fri, 14 Apr 2017 03:20:34 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E3KY03089787; Fri, 14 Apr 2017 03:20:34 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201704140320.v3E3KY03089787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 14 Apr 2017 03:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316807 - head/contrib/gcc/config/rs6000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 03:20:35 -0000 Author: jhibbits Date: Fri Apr 14 03:20:34 2017 New Revision: 316807 URL: https://svnweb.freebsd.org/changeset/base/316807 Log: Default powerpcspe processor target to 8540 This prevents internal compiler errors when -mcpu is omitted. Modified: head/contrib/gcc/config/rs6000/freebsdspe.h Modified: head/contrib/gcc/config/rs6000/freebsdspe.h ============================================================================== --- head/contrib/gcc/config/rs6000/freebsdspe.h Fri Apr 14 02:33:26 2017 (r316806) +++ head/contrib/gcc/config/rs6000/freebsdspe.h Fri Apr 14 03:20:34 2017 (r316807) @@ -28,6 +28,7 @@ #undef TARGET_DEFAULT #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN) +#undef PROCESSOR_DEFAULT #undef TARGET_SPE_ABI #undef TARGET_SPE #undef TARGET_E500 @@ -36,6 +37,7 @@ #undef TARGET_E500_SINGLE #undef TARGET_E500_DOUBLE +#define PROCESSOR_DEFAULT PROCESSOR_PPC8540 #define TARGET_SPE_ABI rs6000_spe_abi #define TARGET_SPE rs6000_spe #define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540) From owner-svn-src-all@freebsd.org Fri Apr 14 03:23:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB857D3D618; Fri, 14 Apr 2017 03:23:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBCABBA7; Fri, 14 Apr 2017 03:23:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E3N3Tc093705; Fri, 14 Apr 2017 03:23:03 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E3N3M0093704; Fri, 14 Apr 2017 03:23:03 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201704140323.v3E3N3M0093704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 14 Apr 2017 03:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316808 - head/sys/dev/txp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 03:23:05 -0000 Author: yongari Date: Fri Apr 14 03:23:03 2017 New Revision: 316808 URL: https://svnweb.freebsd.org/changeset/base/316808 Log: Remove unnecessary check aginst NULL. txp_ext_command() with TXP_CMD_WAIT argument allocates a response buffer. If the allocation fails, txp_ext_command() returns an error and it's handed in caller. Found by: PVS-Studio Modified: head/sys/dev/txp/if_txp.c Modified: head/sys/dev/txp/if_txp.c ============================================================================== --- head/sys/dev/txp/if_txp.c Fri Apr 14 03:20:34 2017 (r316807) +++ head/sys/dev/txp/if_txp.c Fri Apr 14 03:23:03 2017 (r316808) @@ -400,8 +400,7 @@ txp_attach(device_t dev) "Unknown Typhoon sleep image version: %u:0x%08x\n", rsp->rsp_numdesc, p2); } - if (rsp != NULL) - free(rsp, M_DEVBUF); + free(rsp, M_DEVBUF); sc->sc_xcvr = TXP_XCVR_AUTO; txp_command(sc, TXP_CMD_XCVR_SELECT, TXP_XCVR_AUTO, 0, 0, From owner-svn-src-all@freebsd.org Fri Apr 14 03:54:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3FBBD3DD34; Fri, 14 Apr 2017 03:54:37 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4551D09; Fri, 14 Apr 2017 03:54:37 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E3saZr005933; Fri, 14 Apr 2017 03:54:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E3sawZ005932; Fri, 14 Apr 2017 03:54:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704140354.v3E3sawZ005932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 14 Apr 2017 03:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316809 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 03:54:38 -0000 Author: cy Date: Fri Apr 14 03:54:36 2017 New Revision: 316809 URL: https://svnweb.freebsd.org/changeset/base/316809 Log: Fix a use after free panic in ipfilter's fragment processing. Memory is malloc'd, then a search for a match in the fragment table is made and if the fragment matches, the wrong fragment table is freed, causing a use after free panic. This commit fixes this. A symptom of the problem is a kernel page fault in bcopy() called by ipf_frag_lookup() at line 715 in ip_frag.c. Another symptom is a kernel page fault in ipf_frag_delete() when called by ipf_frag_expire() via ipf_slowtimer(). MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_frag.c Fri Apr 14 03:23:03 2017 (r316808) +++ head/sys/contrib/ipfilter/netinet/ip_frag.c Fri Apr 14 03:54:36 2017 (r316809) @@ -474,7 +474,7 @@ ipfr_frag_new(softc, softf, fin, pass, t IPFR_CMPSZ)) { RWLOCK_EXIT(lock); FBUMPD(ifs_exists); - KFREE(fra); + KFREE(fran); return NULL; } From owner-svn-src-all@freebsd.org Fri Apr 14 04:11:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A541D38042; Fri, 14 Apr 2017 04:11:21 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 41617767; Fri, 14 Apr 2017 04:11:20 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id ysV2cyvQ1C3JIysV3c8uUc; Thu, 13 Apr 2017 22:06:22 -0600 X-Authority-Analysis: v=2.2 cv=XbT59Mx5 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=AzvcPWV-tVgA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=xWCwz7DcOcEKQ8ft5MQA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 0CBFE2124; Thu, 13 Apr 2017 21:06:20 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v3E46JOb017269; Thu, 13 Apr 2017 21:06:19 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201704140406.v3E46JOb017269@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316809 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message from Cy Schubert of "Fri, 14 Apr 2017 03:54:36 -0000." <201704140354.v3E3sawZ005932@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 13 Apr 2017 21:06:19 -0700 X-CMAE-Envelope: MS4wfHppKTTm7OjMT1D+bGn27TSyxJBRd9efzprQQmGtxN5j4QgXETI8J5jPf8+zpmId+k2rYU9ePcmV1CigwDQ2sibdRk7BOW24RAv1DxRxxqAE+/ai5+GL fOYF4JZufQWePkjYvDwKQYWJvYnFX5m0CZX0cZv2v6IJJopReVRuyPcxHl2GWKAqF4RwCm63xd/XvxWxLMsZVqjtQlUsF7WiG8i91ek21WzztPLnJo7P6KGo k4IIKr1WoGM0laxblEQnYrCQEJmBtX+1n/i8jmQ4MXkGwf3pDDBfx2x/IvdAKRiK X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 04:11:21 -0000 In message <201704140354.v3E3sawZ005932@repo.freebsd.org>, Cy Schubert writes: > Author: cy > Date: Fri Apr 14 03:54:36 2017 > New Revision: 316809 > URL: https://svnweb.freebsd.org/changeset/base/316809 > > Log: > Fix a use after free panic in ipfilter's fragment processing. > Memory is malloc'd, then a search for a match in the fragment table > is made and if the fragment matches, the wrong fragment table is > freed, causing a use after free panic. This commit fixes this. > > A symptom of the problem is a kernel page fault in bcopy() called by > ipf_frag_lookup() at line 715 in ip_frag.c. Another symptom is a > kernel page fault in ipf_frag_delete() when called by ipf_frag_expire() > via ipf_slowtimer(). > > MFC after: 1 week > > Modified: > head/sys/contrib/ipfilter/netinet/ip_frag.c > > Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c > ============================================================================= > = > --- head/sys/contrib/ipfilter/netinet/ip_frag.c Fri Apr 14 03:23:03 201 > 7 (r316808) > +++ head/sys/contrib/ipfilter/netinet/ip_frag.c Fri Apr 14 03:54:36 201 > 7 (r316809) > @@ -474,7 +474,7 @@ ipfr_frag_new(softc, softf, fin, pass, t > IPFR_CMPSZ)) { > RWLOCK_EXIT(lock); > FBUMPD(ifs_exists); > - KFREE(fra); > + KFREE(fran); > return NULL; > } > > It's surprising how few people/sites have encountered this panic. I only encounter this problem on the ShawOpen network anywhere in Edmonton, AB, Canada. However all other networks, including ShawOpen networks in other cities in Canada don't pass fragments that cause this panic, which by looking at the code should happen frequently. There is a similar panic, with a sometimes similar backtrace to the panics I experiences in FreeBSD, documented in NetBSD-7. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Fri Apr 14 05:12:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C84DCD3D2AA; Fri, 14 Apr 2017 05:12:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED091B0; Fri, 14 Apr 2017 05:12:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E5C1gX038999; Fri, 14 Apr 2017 05:12:01 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E5C1Ug038997; Fri, 14 Apr 2017 05:12:01 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704140512.v3E5C1Ug038997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 14 Apr 2017 05:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316810 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 05:12:02 -0000 Author: cy Date: Fri Apr 14 05:12:01 2017 New Revision: 316810 URL: https://svnweb.freebsd.org/changeset/base/316810 Log: Keep state incorrectly assumes keep frags. This is counter to the ipfilter man pages. This also currently restricts keep frags to only when keep state is used, which is redundant because keep state currently assumes keep frags. This commit fixes this. To the user this change means that to maintain the current behaviour one must add keep frags to any ipfilter keep state rule (as documented in the man pages). This patch also allows the flexability to specify and use keep frags separate from keep state, as documented in an example in ipf.conf.5, instead of the currently broken behaviour. Relnotes: yes Modified: head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/ip_state.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Fri Apr 14 03:54:36 2017 (r316809) +++ head/sys/contrib/ipfilter/netinet/fil.c Fri Apr 14 05:12:01 2017 (r316810) @@ -2786,7 +2786,7 @@ ipf_firewall(fin, passp) * If the rule has "keep frag" and the packet is actually a fragment, * then create a fragment state entry. */ - if ((pass & (FR_KEEPFRAG|FR_KEEPSTATE)) == FR_KEEPFRAG) { + if (pass & FR_KEEPFRAG) { if (fin->fin_flx & FI_FRAG) { if (ipf_frag_new(softc, fin, pass) == -1) { LBUMP(ipf_stats[out].fr_bnfr); Modified: head/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_state.c Fri Apr 14 03:54:36 2017 (r316809) +++ head/sys/contrib/ipfilter/netinet/ip_state.c Fri Apr 14 05:12:01 2017 (r316810) @@ -3414,7 +3414,8 @@ ipf_state_check(fin, passp) * If this packet is a fragment and the rule says to track fragments, * then create a new fragment cache entry. */ - if ((fin->fin_flx & FI_FRAG) && FR_ISPASS(is->is_pass)) + if (((fin->fin_flx & FI_FRAG) && FR_ISPASS(is->is_pass)) && + ((is->is_pass & FR_KEEPFRAG))) (void) ipf_frag_new(softc, fin, is->is_pass); /* From owner-svn-src-all@freebsd.org Fri Apr 14 05:13:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B157D3D36D; Fri, 14 Apr 2017 05:13:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF9CA6F1; Fri, 14 Apr 2017 05:13:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E5DpES039092; Fri, 14 Apr 2017 05:13:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E5Dp7v039091; Fri, 14 Apr 2017 05:13:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704140513.v3E5Dp7v039091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 14 Apr 2017 05:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316811 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 05:13:52 -0000 Author: cy Date: Fri Apr 14 05:13:50 2017 New Revision: 316811 URL: https://svnweb.freebsd.org/changeset/base/316811 Log: Add missing free()'s after calls to randomize(). PR: NetBSD PR/50559 Obtained from: Netbsd radix_ipf.c r1.6 MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/radix_ipf.c Fri Apr 14 05:12:01 2017 (r316810) +++ head/sys/contrib/ipfilter/netinet/radix_ipf.c Fri Apr 14 05:13:50 2017 (r316811) @@ -38,7 +38,7 @@ static void buildnodes __P((addrfamily_t static ipf_rdx_node_t *ipf_rx_find_addr __P((ipf_rdx_node_t *, u_32_t *)); static ipf_rdx_node_t *ipf_rx_lookup __P((ipf_rdx_head_t *, addrfamily_t *, addrfamily_t *)); -static ipf_rdx_node_t *ipf_rx_match __P((ipf_rdx_head_t *, addrfamily_t *)); +/* $NetBSD: radix_ipf.c,v 1.6 2015/12/15 12:30:34 christos Exp $ */ /* * Foreword. @@ -1509,6 +1509,8 @@ random_add(rnh) add_addr(rnh, i, order[i]); checktree(rnh); } + + free(order); } @@ -1526,5 +1528,7 @@ random_delete(rnh) delete_addr(rnh, i); checktree(rnh); } + + free(order); } #endif /* RDX_DEBUG */ From owner-svn-src-all@freebsd.org Fri Apr 14 05:18:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4EF6D3D403; Fri, 14 Apr 2017 05:18:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76FE58C7; Fri, 14 Apr 2017 05:18:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E5IgP8039392; Fri, 14 Apr 2017 05:18:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E5IgQ6039391; Fri, 14 Apr 2017 05:18:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201704140518.v3E5IgQ6039391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 14 Apr 2017 05:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316812 - head/sys/dev/hyperv/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 05:18:43 -0000 Author: sephe Date: Fri Apr 14 05:18:42 2017 New Revision: 316812 URL: https://svnweb.freebsd.org/changeset/base/316812 Log: hyperv/kbd: Remove unnecessary assignment. Reported by: PVS MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/input/hv_kbdc.c Modified: head/sys/dev/hyperv/input/hv_kbdc.c ============================================================================== --- head/sys/dev/hyperv/input/hv_kbdc.c Fri Apr 14 05:13:50 2017 (r316811) +++ head/sys/dev/hyperv/input/hv_kbdc.c Fri Apr 14 05:18:42 2017 (r316812) @@ -298,7 +298,6 @@ hv_kbd_read_channel(struct vmbus_channel int ret = 0; hv_kbd_sc *sc = (hv_kbd_sc*)context; - channel = vmbus_get_channel(sc->dev); buf = sc->buf; buflen = sc->buflen; for (;;) { From owner-svn-src-all@freebsd.org Fri Apr 14 05:25:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 220E3D3D701; Fri, 14 Apr 2017 05:25:23 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E85A8E4A; Fri, 14 Apr 2017 05:25:22 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E5PMVd043289; Fri, 14 Apr 2017 05:25:22 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E5PMer043288; Fri, 14 Apr 2017 05:25:22 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201704140525.v3E5PMer043288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 14 Apr 2017 05:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316813 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 05:25:23 -0000 Author: sephe Date: Fri Apr 14 05:25:21 2017 New Revision: 316813 URL: https://svnweb.freebsd.org/changeset/base/316813 Log: hyperv/storvsc: Use ULL for 64bits value shift. Reported by: PVS MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Apr 14 05:18:42 2017 (r316812) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Apr 14 05:25:21 2017 (r316813) @@ -1771,7 +1771,7 @@ storvsc_check_bounce_buffer_sgl(bus_dma_ } pre_aligned = TRUE; } else { - tmp_bits |= 1 << i; + tmp_bits |= 1ULL << i; if (!pre_aligned) { if (phys_addr != vtophys(sgl[i-1].ds_addr + sgl[i-1].ds_len)) { From owner-svn-src-all@freebsd.org Fri Apr 14 05:25:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73F1AD3D764; Fri, 14 Apr 2017 05:25:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 422ACFB6; Fri, 14 Apr 2017 05:25:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E5Pest043344; Fri, 14 Apr 2017 05:25:40 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E5Pebv043343; Fri, 14 Apr 2017 05:25:40 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704140525.v3E5Pebv043343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 14 Apr 2017 05:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316814 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 05:25:41 -0000 Author: cy Date: Fri Apr 14 05:25:40 2017 New Revision: 316814 URL: https://svnweb.freebsd.org/changeset/base/316814 Log: Document change in (incorrect) ipfilter behaviour fixed by r316810. Keep frags can be used with keep state independently. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 14 05:25:21 2017 (r316813) +++ head/UPDATING Fri Apr 14 05:25:40 2017 (r316814) @@ -51,6 +51,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 ****************************** SPECIAL WARNING: ****************************** +20170413: + As of r316810 for ipfilter, keep frags is no longer assumed when + keep state is specified in a rule. r316810 aligns ipfilter with + documentation in man pages separating keep frags from keep state. + This allows keep state to specified without forcing keep frags + and allows keep frags to be specified independently of keep state. + To maintain previous behaviour, also specify keep frags with + keep state (as documented in ipf.conf.5. + 20170407: arm64 builds now use the base system LLD 4.0.0 linker by default, instead of requiring that the aarch64-binutils port or package be From owner-svn-src-all@freebsd.org Fri Apr 14 05:29:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 841FBD3D840; Fri, 14 Apr 2017 05:29:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D4BC1B8; Fri, 14 Apr 2017 05:29:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E5TRYi043507; Fri, 14 Apr 2017 05:29:27 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E5TRbd043506; Fri, 14 Apr 2017 05:29:27 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201704140529.v3E5TRbd043506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 14 Apr 2017 05:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316815 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 05:29:28 -0000 Author: sephe Date: Fri Apr 14 05:29:27 2017 New Revision: 316815 URL: https://svnweb.freebsd.org/changeset/base/316815 Log: hyperv/kvp: Remove always false condition. Reported by: PVS MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/utilities/hv_kvp.c Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Fri Apr 14 05:25:40 2017 (r316814) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Fri Apr 14 05:29:27 2017 (r316815) @@ -516,7 +516,7 @@ hv_kvp_convert_usermsg_to_hostmsg(struct /* Use values by string */ host_exchg_data->value_type = HV_REG_SZ; - if ((hkey_len < 0) || (hvalue_len < 0)) + if (hvalue_len < 0) return (EINVAL); return (0); From owner-svn-src-all@freebsd.org Fri Apr 14 05:32:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25EDBD3DA3F; Fri, 14 Apr 2017 05:32:05 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAAE090B; Fri, 14 Apr 2017 05:32:04 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E5W4ha045363; Fri, 14 Apr 2017 05:32:04 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E5W4EE045362; Fri, 14 Apr 2017 05:32:04 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704140532.v3E5W4EE045362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 14 Apr 2017 05:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316816 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 05:32:05 -0000 Author: cy Date: Fri Apr 14 05:32:03 2017 New Revision: 316816 URL: https://svnweb.freebsd.org/changeset/base/316816 Log: Add missing bracket (typo). Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 14 05:29:27 2017 (r316815) +++ head/UPDATING Fri Apr 14 05:32:03 2017 (r316816) @@ -58,7 +58,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 This allows keep state to specified without forcing keep frags and allows keep frags to be specified independently of keep state. To maintain previous behaviour, also specify keep frags with - keep state (as documented in ipf.conf.5. + keep state (as documented in ipf.conf.5). 20170407: arm64 builds now use the base system LLD 4.0.0 linker by default, From owner-svn-src-all@freebsd.org Fri Apr 14 06:33:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E587D3D841; Fri, 14 Apr 2017 06:33:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 508C32E5; Fri, 14 Apr 2017 06:33:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E6XFoZ072894; Fri, 14 Apr 2017 06:33:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E6XFf3072893; Fri, 14 Apr 2017 06:33:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704140633.v3E6XFf3072893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 14 Apr 2017 06:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316817 - head/etc/pam.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 06:33:16 -0000 Author: ngie Date: Fri Apr 14 06:33:15 2017 New Revision: 316817 URL: https://svnweb.freebsd.org/changeset/base/316817 Log: Derive {AT,RCMDS}{DIR,MODE} from FILE{DIR,MODE} This reduces duplicity a bit. MFC after: 7 weeks Sponsored by: Dell EMC Isilon Modified: head/etc/pam.d/Makefile Modified: head/etc/pam.d/Makefile ============================================================================== --- head/etc/pam.d/Makefile Fri Apr 14 05:32:03 2017 (r316816) +++ head/etc/pam.d/Makefile Fri Apr 14 06:33:15 2017 (r316817) @@ -17,24 +17,25 @@ FILES= README \ telnetd \ xdm +FILESDIR= /etc/pam.d +FILESMODE= 644 + .if ${MK_AT} != "no" FILESGROUPS+= AT AT+= atrun ATPACKAGE+= at -ATDIR= /etc/pam.d -ATMODE= 644 +ATDIR= ${FILESDIR} +ATMODE= ${FILESMODE} .endif .if ${MK_RCMDS} != "no" FILESGROUPS+= RCMDS RCMDS+= rsh RCMDSPACKAGE+= rcmds -RCMDSDIR= /etc/pam.d -RCMDSMODE= 644 +RCMDSDIR= ${FILESDIR} +RCMDSMODE= ${FILESMODE} .endif -FILESDIR= /etc/pam.d -FILESMODE= 644 FILESMODE_README= 444 LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp From owner-svn-src-all@freebsd.org Fri Apr 14 06:42:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CFF8D3DA82; Fri, 14 Apr 2017 06:42:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDEE899A; Fri, 14 Apr 2017 06:42:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E6glMF076752; Fri, 14 Apr 2017 06:42:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E6gkOi076750; Fri, 14 Apr 2017 06:42:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704140642.v3E6gkOi076750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 14 Apr 2017 06:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316818 - in head: etc/pam.d tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 06:42:48 -0000 Author: ngie Date: Fri Apr 14 06:42:46 2017 New Revision: 316818 URL: https://svnweb.freebsd.org/changeset/base/316818 Log: Conditionally install /etc/pam.d/ftp* and /etc/pam.d/telnetd /etc/pam.d/ftp* should be installed with MK_FTP != no and /etc/pam.d/telnetd should be installed when MK_TELNET != no. MFC after: 7 weeks Sponsored by: Dell EMC Isilon Modified: head/etc/pam.d/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/pam.d/Makefile ============================================================================== --- head/etc/pam.d/Makefile Fri Apr 14 06:33:15 2017 (r316817) +++ head/etc/pam.d/Makefile Fri Apr 14 06:42:46 2017 (r316818) @@ -8,13 +8,11 @@ FILESGROUPS= FILES FILES= README \ cron \ - ftpd \ imap \ login \ other \ passwd pop3 \ sshd su system \ - telnetd \ xdm FILESDIR= /etc/pam.d @@ -28,6 +26,15 @@ ATDIR= ${FILESDIR} ATMODE= ${FILESMODE} .endif +.if ${MK_FTP} != "no" +FILESGROUPS+= FTP +FTP+= ftpd +FTPPACKAGE+= ftp +FTPDIR= ${FILESDIR} +FTPMODE= ${FILESMODE} +LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp +.endif + .if ${MK_RCMDS} != "no" FILESGROUPS+= RCMDS RCMDS+= rsh @@ -36,7 +43,14 @@ RCMDSDIR= ${FILESDIR} RCMDSMODE= ${FILESMODE} .endif +.if ${MK_TELNET} != "no" +FILESGROUPS+= TELNET +TELNET+= telnetd +TELNETPACKAGE+= telnet +TELNETDIR= ${FILESDIR} +TELNETMODE= ${FILESMODE} +.endif + FILESMODE_README= 444 -LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Apr 14 06:33:15 2017 (r316817) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Apr 14 06:42:46 2017 (r316818) @@ -1613,6 +1613,8 @@ OLD_FILES+=usr/share/man/man8/fmtree.8.g .if ${MK_FTP} == no OLD_FILES+=etc/ftpusers +OLD_FILES+=etc/pam.d/ftp +OLD_FILES+=etc/pam.d/ftpd OLD_FILES+=etc/rc.d/ftpd OLD_FILES+=usr/bin/ftp OLD_FILES+=usr/bin/gate-ftp @@ -8037,6 +8039,7 @@ OLD_FILES+=usr/share/nls/uk_UA.UTF-8/tcs .endif .if ${MK_TELNET} == no +OLD_FILES+=etc/pam.d/telnetd OLD_FILES+=usr/bin/telnet OLD_FILES+=usr/libexec/telnetd OLD_FILES+=usr/share/man/man1/telnet.1.gz From owner-svn-src-all@freebsd.org Fri Apr 14 07:27:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A0FAD3D49F; Fri, 14 Apr 2017 07:27:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE3F7C59; Fri, 14 Apr 2017 07:27:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E7RO4T093115; Fri, 14 Apr 2017 07:27:24 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E7ROsb093114; Fri, 14 Apr 2017 07:27:24 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201704140727.v3E7ROsb093114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 14 Apr 2017 07:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316819 - head/sys/dev/msk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 07:27:25 -0000 Author: yongari Date: Fri Apr 14 07:27:23 2017 New Revision: 316819 URL: https://svnweb.freebsd.org/changeset/base/316819 Log: Remove unnecessary assignment. Found by: PVS-Studio Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Apr 14 06:42:46 2017 (r316818) +++ head/sys/dev/msk/if_msk.c Fri Apr 14 07:27:23 2017 (r316819) @@ -4493,7 +4493,7 @@ msk_sysctl_node(struct msk_if_softc *sc_ tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, NULL, "MSK Statistics"); - schild = child = SYSCTL_CHILDREN(tree); + schild = SYSCTL_CHILDREN(tree); tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "rx", CTLFLAG_RD, NULL, "MSK RX Statistics"); child = SYSCTL_CHILDREN(tree); From owner-svn-src-all@freebsd.org Fri Apr 14 08:11:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58A9DD3C2BE; Fri, 14 Apr 2017 08:11:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3AF149E; Fri, 14 Apr 2017 08:11:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E8BoPW011806; Fri, 14 Apr 2017 08:11:50 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E8BoSa011805; Fri, 14 Apr 2017 08:11:50 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201704140811.v3E8BoSa011805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 14 Apr 2017 08:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316820 - head/sys/dev/jme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 08:11:51 -0000 Author: yongari Date: Fri Apr 14 08:11:50 2017 New Revision: 316820 URL: https://svnweb.freebsd.org/changeset/base/316820 Log: Don't overwrite mapped bits. Found by: PVS-Studio Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Fri Apr 14 07:27:23 2017 (r316819) +++ head/sys/dev/jme/if_jme.c Fri Apr 14 08:11:50 2017 (r316820) @@ -557,7 +557,7 @@ jme_map_intr_vector(struct jme_softc *sc bzero(map, sizeof(map)); /* Map Tx interrupts source to MSI/MSIX vector 2. */ - map[MSINUM_REG_INDEX(N_INTR_TXQ0_COMP)] = + map[MSINUM_REG_INDEX(N_INTR_TXQ0_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ0_COMP); map[MSINUM_REG_INDEX(N_INTR_TXQ1_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ1_COMP); @@ -579,37 +579,37 @@ jme_map_intr_vector(struct jme_softc *sc MSINUM_INTR_SOURCE(2, N_INTR_TXQ_COAL_TO); /* Map Rx interrupts source to MSI/MSIX vector 1. */ - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COMP)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COMP)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COMP)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COMP)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COMP)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COMP)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COMP)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COMP)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_DESC_EMPTY)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ0_DESC_EMPTY)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_DESC_EMPTY)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ1_DESC_EMPTY)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_DESC_EMPTY)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ2_DESC_EMPTY)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_DESC_EMPTY)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ3_DESC_EMPTY)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL_TO)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL_TO)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL_TO)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL_TO)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL_TO)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL_TO)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL_TO)] = + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL_TO)] |= MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COAL_TO); /* Map all other interrupts source to MSI/MSIX vector 0. */ From owner-svn-src-all@freebsd.org Fri Apr 14 08:27:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BF32D3C6EA; Fri, 14 Apr 2017 08:27:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 601C31D09; Fri, 14 Apr 2017 08:27:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E8Rgvl018534; Fri, 14 Apr 2017 08:27:42 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E8RgRK018533; Fri, 14 Apr 2017 08:27:42 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201704140827.v3E8RgRK018533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 14 Apr 2017 08:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316821 - head/sys/dev/age X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 08:27:43 -0000 Author: yongari Date: Fri Apr 14 08:27:42 2017 New Revision: 316821 URL: https://svnweb.freebsd.org/changeset/base/316821 Log: Remove dead code. Modified: head/sys/dev/age/if_age.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Fri Apr 14 08:11:50 2017 (r316820) +++ head/sys/dev/age/if_age.c Fri Apr 14 08:27:42 2017 (r316821) @@ -2161,11 +2161,6 @@ age_int_task(void *arg, int pending) sc->age_cdata.age_cmb_block_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); -#if 0 - printf("INTR: 0x%08x\n", status); - status &= ~INTR_DIS_DMA; - CSR_WRITE_4(sc, AGE_INTR_STATUS, status | INTR_DIS_INT); -#endif ifp = sc->age_ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if ((status & INTR_CMB_RX) != 0) From owner-svn-src-all@freebsd.org Fri Apr 14 09:00:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA2EBD3D437; Fri, 14 Apr 2017 09:00:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A07B4DB3; Fri, 14 Apr 2017 09:00:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E90mni030552; Fri, 14 Apr 2017 09:00:48 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E90mJU030549; Fri, 14 Apr 2017 09:00:48 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704140900.v3E90mJU030549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 14 Apr 2017 09:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316822 - in head/sys: kern netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 09:00:50 -0000 Author: ae Date: Fri Apr 14 09:00:48 2017 New Revision: 316822 URL: https://svnweb.freebsd.org/changeset/base/316822 Log: Rework r316770 to make it protocol independent and general, like we do for streaming sockets. And do more cleanup in the sbappendaddr_locked_internal() to prevent leak information from existing mbuf to the one, that will be possible created later by netgraph. Suggested by: glebius Tested by: Irina Liakh MFC after: 1 week Modified: head/sys/kern/uipc_sockbuf.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Fri Apr 14 08:27:42 2017 (r316821) +++ head/sys/kern/uipc_sockbuf.c Fri Apr 14 09:00:48 2017 (r316822) @@ -794,8 +794,20 @@ sbappendaddr_locked_internal(struct sock return (0); m->m_len = asa->sa_len; bcopy(asa, mtod(m, caddr_t), asa->sa_len); - if (m0) + if (m0) { m_clrprotoflags(m0); + m_tag_delete_chain(m0); + /* + * Clear some persistent info from pkthdr. + * We don't use m_demote(), because some netgraph consumers + * expect M_PKTHDR presence. + */ + m0->m_pkthdr.rcvif = NULL; + m0->m_pkthdr.flowid = 0; + m0->m_pkthdr.csum_flags = 0; + m0->m_pkthdr.fibnum = 0; + m0->m_pkthdr.rsstype = 0; + } if (ctrl_last) ctrl_last->m_next = m0; /* concatenate data to control */ else Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Fri Apr 14 08:27:42 2017 (r316821) +++ head/sys/netinet/udp_usrreq.c Fri Apr 14 09:00:48 2017 (r316822) @@ -372,9 +372,6 @@ udp_append(struct inpcb *inp, struct ip append_sa = (struct sockaddr *)&udp_in[0]; m_adj(n, off); - /* Clear any h/w csum flags as they are no longer valid. */ - n->m_pkthdr.csum_flags &= ~(CSUM_DATA_VALID | CSUM_IP_VALID); - so = inp->inp_socket; SOCKBUF_LOCK(&so->so_rcv); if (sbappendaddr_locked(&so->so_rcv, append_sa, n, opts) == 0) { Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri Apr 14 08:27:42 2017 (r316821) +++ head/sys/netinet6/udp6_usrreq.c Fri Apr 14 09:00:48 2017 (r316822) @@ -187,9 +187,6 @@ udp6_append(struct inpcb *inp, struct mb } m_adj(n, off + sizeof(struct udphdr)); - /* Clear any h/w csum flags as they are no longer valid. */ - n->m_pkthdr.csum_flags &= ~CSUM_DATA_VALID; - so = inp->inp_socket; SOCKBUF_LOCK(&so->so_rcv); if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)&fromsa[0], n, From owner-svn-src-all@freebsd.org Fri Apr 14 10:21:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6B3ED3C122; Fri, 14 Apr 2017 10:21:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7121B8A; Fri, 14 Apr 2017 10:21:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EALcvI065857; Fri, 14 Apr 2017 10:21:38 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EALcX1065856; Fri, 14 Apr 2017 10:21:38 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704141021.v3EALcX1065856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 14 Apr 2017 10:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316823 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 10:21:39 -0000 Author: ae Date: Fri Apr 14 10:21:38 2017 New Revision: 316823 URL: https://svnweb.freebsd.org/changeset/base/316823 Log: Fix the build. Reported by: lwhsu Modified: head/sys/kern/uipc_sockbuf.c Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Fri Apr 14 09:00:48 2017 (r316822) +++ head/sys/kern/uipc_sockbuf.c Fri Apr 14 10:21:38 2017 (r316823) @@ -796,7 +796,7 @@ sbappendaddr_locked_internal(struct sock bcopy(asa, mtod(m, caddr_t), asa->sa_len); if (m0) { m_clrprotoflags(m0); - m_tag_delete_chain(m0); + m_tag_delete_chain(m0, NULL); /* * Clear some persistent info from pkthdr. * We don't use m_demote(), because some netgraph consumers From owner-svn-src-all@freebsd.org Fri Apr 14 11:19:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87F79D3D6B7; Fri, 14 Apr 2017 11:19:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FFB8AB6; Fri, 14 Apr 2017 11:19:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EBJ9cM086894; Fri, 14 Apr 2017 11:19:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EBJ9dH086893; Fri, 14 Apr 2017 11:19:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704141119.v3EBJ9dH086893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 14 Apr 2017 11:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316824 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 11:19:10 -0000 Author: ae Date: Fri Apr 14 11:19:09 2017 New Revision: 316824 URL: https://svnweb.freebsd.org/changeset/base/316824 Log: The rule field in the ipfw_dyn_rule structure is used as storage to pass rule number and rule set to userland. In r272840 the kernel internal rule representation was changed and the rulenum field of struct ip_fw_rule got the type uint32_t, but userlevel representation still have the type uint16_t. To not overflow the size of pointer on the systems with 32-bit pointer size use separate variable to copy rulenum and set. Reported by: PVS-Studio MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Apr 14 10:21:38 2017 (r316823) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Apr 14 11:19:09 2017 (r316824) @@ -1709,15 +1709,17 @@ ipfw_dyn_get_count(void) static void export_dyn_rule(ipfw_dyn_rule *src, ipfw_dyn_rule *dst) { + uint16_t rulenum; + rulenum = (uint16_t)src->rule->rulenum; memcpy(dst, src, sizeof(*src)); - memcpy(&(dst->rule), &(src->rule->rulenum), sizeof(src->rule->rulenum)); + memcpy(&dst->rule, &rulenum, sizeof(rulenum)); /* * store set number into high word of * dst->rule pointer. */ - memcpy((char *)&dst->rule + sizeof(src->rule->rulenum), - &(src->rule->set), sizeof(src->rule->set)); + memcpy((char *)&dst->rule + sizeof(rulenum), &src->rule->set, + sizeof(src->rule->set)); /* * store a non-null value in "next". * The userland code will interpret a @@ -1725,8 +1727,8 @@ export_dyn_rule(ipfw_dyn_rule *src, ipfw * for the last dynamic rule. */ memcpy(&dst->next, &dst, sizeof(dst)); - dst->expire = - TIME_LEQ(dst->expire, time_uptime) ? 0 : dst->expire - time_uptime; + dst->expire = TIME_LEQ(dst->expire, time_uptime) ? 0: + dst->expire - time_uptime; } /* From owner-svn-src-all@freebsd.org Fri Apr 14 11:41:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D3FD3DDA2; Fri, 14 Apr 2017 11:41:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34C21876; Fri, 14 Apr 2017 11:41:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EBf9jr097086; Fri, 14 Apr 2017 11:41:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EBf9MC097085; Fri, 14 Apr 2017 11:41:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704141141.v3EBf9MC097085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 14 Apr 2017 11:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316825 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 11:41:10 -0000 Author: ae Date: Fri Apr 14 11:41:09 2017 New Revision: 316825 URL: https://svnweb.freebsd.org/changeset/base/316825 Log: Use address of specific union member instead of whole union address to fix PVS-Studio warnings. MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_algo.c Fri Apr 14 11:19:09 2017 (r316824) +++ head/sys/netpfil/ipfw/ip_fw_table_algo.c Fri Apr 14 11:41:09 2017 (r316825) @@ -526,7 +526,8 @@ ta_dump_radix_tentry(void *ta_state, str #ifdef INET6 } else { xn = (struct radix_addr_xentry *)e; - memcpy(&tent->k, &xn->addr6.sin6_addr, sizeof(struct in6_addr)); + memcpy(&tent->k.addr6, &xn->addr6.sin6_addr, + sizeof(struct in6_addr)); tent->masklen = xn->masklen; tent->subtype = AF_INET6; tent->v.kidx = xn->value; @@ -1381,7 +1382,7 @@ ta_dump_chash_tentry(void *ta_state, str tent->v.kidx = ent->value; #ifdef INET6 } else { - memcpy(&tent->k, &ent->a.a6, sizeof(struct in6_addr)); + memcpy(&tent->k.addr6, &ent->a.a6, sizeof(struct in6_addr)); tent->masklen = cfg->mask6; tent->subtype = AF_INET6; tent->v.kidx = ent->value; @@ -3983,7 +3984,8 @@ ta_dump_kfib_tentry_int(struct sockaddr if (paddr->sa_family == AF_INET6) { addr6 = (struct sockaddr_in6 *)paddr; mask6 = (struct sockaddr_in6 *)pmask; - memcpy(&tent->k, &addr6->sin6_addr, sizeof(struct in6_addr)); + memcpy(&tent->k.addr6, &addr6->sin6_addr, + sizeof(struct in6_addr)); len = 128; if (mask6 != NULL) len = contigmask((uint8_t *)&mask6->sin6_addr, 128); From owner-svn-src-all@freebsd.org Fri Apr 14 11:52:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50AD5D3C24C for ; Fri, 14 Apr 2017 11:52:48 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A73EFA for ; Fri, 14 Apr 2017 11:52:47 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22b.google.com with SMTP id k13so34977687ywk.1 for ; Fri, 14 Apr 2017 04:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VwYDLFPpsVaKzUuZyRVhhej9gYF68lHZQ2JrSR2w3gE=; b=bCs4rk2CMJqDEJLueXyPBvAV3PwSo3MFBm9XgZRLcB/0NN7XwfLHxt3oi0dD6oZX5l 5RJrl0bOxErO+nF2eBaqd0jcYnqvjoL1WJc/xC0NG1oHU0cykUvKCJIE4hOMay/2sSvp MY8jtKiJrN8V+6ivQwAm5qcJ1zH58L+wOhcJjWXJ4weRexm/neaj2HlwVyzUuwwxsJOd lf2W9rhPv4k765BwqR6CWJCY4D4hVIpvFWi3iBCTOQ3Kc9wTNtZdc9a6lmXE3sxvtidT No1cswCHl79qkqUwT+AyVryb3x+MoKCKaeBvJM9OModU84T9HvA9KeDxtXZ9s14asLdW dvYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VwYDLFPpsVaKzUuZyRVhhej9gYF68lHZQ2JrSR2w3gE=; b=Fcu3Zasi8QAbwMRq/YInWdgEiuSTvIMPMVahItOOCjd6Ho2gebRrSK/OlZIyqIded4 ShsZ9gJH+8xIKB8bbPnGsII0vXi6TWQNPmThXVUHnDvmpbh+nOdnjQefV15ZPBe5KeDn Qk7JNhf5/uZ0pEudp8Nm64Dn12Zz+GVkBACCOciK/9wB/baoUQj5n/3WI+TPEvf94m+v wXobyMMzBUUAzjaMwr2HcGCaRBsx2RBFnI5PbELybgE7w7u/oXY2cC3oIMAh4h3t0sj7 uabAd5RgyCosS6oK1TbOBkzoKvTdI1pWpoKrQWrWKCCp/3P+KIG8mhJKU/rXSa61XOCW EZvg== X-Gm-Message-State: AN3rC/5/jSzdSY5qsvtb5qcpqhCWwsBkW+Qf/r2YKWS0OderpVp1CQYZ YU3HMQlVETGI5ljOj3uL7QG/XkPM8A== X-Received: by 10.129.93.214 with SMTP id r205mr5669459ywb.95.1492170766731; Fri, 14 Apr 2017 04:52:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.105.198 with HTTP; Fri, 14 Apr 2017 04:52:16 -0700 (PDT) In-Reply-To: <201704141141.v3EBf9MC097085@repo.freebsd.org> References: <201704141141.v3EBf9MC097085@repo.freebsd.org> From: Ed Schouten Date: Fri, 14 Apr 2017 13:52:16 +0200 Message-ID: Subject: Re: svn commit: r316825 - head/sys/netpfil/ipfw To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 11:52:48 -0000 Hi there, 2017-04-14 13:41 GMT+02:00 Andrey V. Elsukov : > - memcpy(&tent->k, &xn->addr6.sin6_addr, sizeof(struct in6_addr)); > + memcpy(&tent->k.addr6, &xn->addr6.sin6_addr, > + sizeof(struct in6_addr)); In this case the code could be abbreviated by simply using assignment, right? tent->k.addr6 = xn->addr6.sin6_addr; -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-all@freebsd.org Fri Apr 14 11:56:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75B8ED3C40B; Fri, 14 Apr 2017 11:56:21 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward3m.cmail.yandex.net (forward3m.cmail.yandex.net [IPv6:2a02:6b8:b030::1a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2AA53B0; Fri, 14 Apr 2017 11:56:20 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1h.mail.yandex.net (smtp1h.mail.yandex.net [84.201.187.144]) by forward3m.cmail.yandex.net (Yandex) with ESMTP id 76AE82130D; Fri, 14 Apr 2017 14:56:08 +0300 (MSK) Received: from smtp1h.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1h.mail.yandex.net (Yandex) with ESMTP id E5E498C0D2D; Fri, 14 Apr 2017 14:55:54 +0300 (MSK) Received: by smtp1h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Z1Av2Xek1V-trka5dB5; Fri, 14 Apr 2017 14:55:53 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1492170953; bh=DMseF4lk8tqjZRJxC3+C8gX+YkYGl8GFQBrl8vtpOTA=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=J+iqEMY5ZJH+LlLCMsEQ6cmzv2QWihDeRcjSbAquztzfxKgytfEMgMzUDioLU/HMS R+rKAyGKLNCdfLaRIiFWpy242Ikc8sHu9ohV62L6mMVmJYPA4tHKN1qIvy4YIeMghf cUTTH76YCrO8WzZSaCMq/ugfO/eE++vQHYOaDPAs= Authentication-Results: smtp1h.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: svn commit: r316825 - head/sys/netpfil/ipfw To: Ed Schouten Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704141141.v3EBf9MC097085@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: <0be15fbe-ede3-804f-e844-dd75beef69ab@yandex.ru> Date: Fri, 14 Apr 2017 14:55:15 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MGD7QnffHXeINlkLRMdWm5h7vgjNVh2Be" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 11:56:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MGD7QnffHXeINlkLRMdWm5h7vgjNVh2Be Content-Type: multipart/mixed; boundary="VpFmwvFChMvEMHVqLwMkR4hVKeNccDpiX"; protected-headers="v1" From: "Andrey V. Elsukov" To: Ed Schouten Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <0be15fbe-ede3-804f-e844-dd75beef69ab@yandex.ru> Subject: Re: svn commit: r316825 - head/sys/netpfil/ipfw References: <201704141141.v3EBf9MC097085@repo.freebsd.org> In-Reply-To: --VpFmwvFChMvEMHVqLwMkR4hVKeNccDpiX Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 14.04.2017 14:52, Ed Schouten wrote: > Hi there, >=20 > 2017-04-14 13:41 GMT+02:00 Andrey V. Elsukov : >> - memcpy(&tent->k, &xn->addr6.sin6_addr, sizeof(struct i= n6_addr)); >> + memcpy(&tent->k.addr6, &xn->addr6.sin6_addr, >> + sizeof(struct in6_addr)); >=20 > In this case the code could be abbreviated by simply using assignment, = right? >=20 > tent->k.addr6 =3D xn->addr6.sin6_addr; Yes. --=20 WBR, Andrey V. Elsukov --VpFmwvFChMvEMHVqLwMkR4hVKeNccDpiX-- --MGD7QnffHXeINlkLRMdWm5h7vgjNVh2Be Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAljwuKMACgkQAcXqBBDI oXrPiAgAnu+BGS9OaGl1IgS33+keDSowl70bhtxUup2D/TKWY7Lb4aGDKFX/qsnF dNQw1xKUqGPnmKIFs9QJ6nb+uEzbBkiXbVuyDqkgBzvnt3EorKA9FL1HGMBe3AKY XpSW9T4fhZ9TzCUfmgp6hiY9jbzMb8agsOMu2QgLzZ8D/EAVMdR3wKdqeO/ZSJUe CRuyoW785Ojo4CU2HyptdVh8eA93zwXRUe+e2B8837IqHoDAayAnOgT3ivdRs/5k jMogTRRWUDSsZao9Gh4Hoao6ribg0No859deZOIevHXZ087qRRAxLSY3ISO11DlD EBBW5KnC8s9T/rdmxtUUyzN1nyqMBQ== =qy0D -----END PGP SIGNATURE----- --MGD7QnffHXeINlkLRMdWm5h7vgjNVh2Be-- From owner-svn-src-all@freebsd.org Fri Apr 14 11:58:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A45B5D3C545; Fri, 14 Apr 2017 11:58:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EA097CE; Fri, 14 Apr 2017 11:58:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EBwfBW003148; Fri, 14 Apr 2017 11:58:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EBwfLm003147; Fri, 14 Apr 2017 11:58:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201704141158.v3EBwfLm003147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 14 Apr 2017 11:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316826 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 11:58:42 -0000 Author: ae Date: Fri Apr 14 11:58:41 2017 New Revision: 316826 URL: https://svnweb.freebsd.org/changeset/base/316826 Log: Avoid undefined behavior. The 'pktid' variable is modified while being used twice between sequence points, probably due to htonl() is macro. Reported by: PVS-Studio MFC after: 1 week Modified: head/sys/netpfil/ipfw/nat64/nat64stl.c Modified: head/sys/netpfil/ipfw/nat64/nat64stl.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64stl.c Fri Apr 14 11:41:09 2017 (r316825) +++ head/sys/netpfil/ipfw/nat64/nat64stl.c Fri Apr 14 11:58:41 2017 (r316826) @@ -75,7 +75,8 @@ nat64stl_log(struct pfloghdr *plog, stru plog->action = PF_NAT; plog->dir = PF_IN; plog->rulenr = htonl(kidx); - plog->subrulenr = htonl(++pktid); + pktid++; + plog->subrulenr = htonl(pktid); plog->ruleset[0] = '\0'; strlcpy(plog->ifname, "NAT64STL", sizeof(plog->ifname)); ipfw_bpf_mtap2(plog, PFLOG_HDRLEN, m); From owner-svn-src-all@freebsd.org Fri Apr 14 12:03:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9384ED3D09E; Fri, 14 Apr 2017 12:03:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56487EEC; Fri, 14 Apr 2017 12:03:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EC3Ybo007154; Fri, 14 Apr 2017 12:03:34 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EC3YGn007153; Fri, 14 Apr 2017 12:03:34 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704141203.v3EC3YGn007153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 14 Apr 2017 12:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316827 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 12:03:35 -0000 Author: bde Date: Fri Apr 14 12:03:34 2017 New Revision: 316827 URL: https://svnweb.freebsd.org/changeset/base/316827 Log: Further unobfuscate the method of drawing the mouse cursor in vga planar mode. Don't manually unroll the 2 inner loops. On Haswell, doing so gave a speedup of about 0.5% (about 4 cycles per iteration out of 1400), but hard-coded a limit of width 9 and made better better optimizations harder to see. gcc-4.2.1 -O does the unrolling anyway, unless tricked with a volatile hack. gcc's unrolling is not very good and gives a a speedup of about half as much (about 2 cycles per iteration). (All timing on i386.) Manual unrolling was only feasible because the inner loop only iterates once or twice. Usually twice, but a dynamic check is needed to decide, and was not moved from the second-innermost loop manually or by gcc. This commit basically adds another dynamic check in the inner loop. Cursor widths of 10-17 require 3 iterations in the inner loop and this is not so easy to unroll -- even gcc stops at 2. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Fri Apr 14 11:58:41 2017 (r316826) +++ head/sys/dev/syscons/scvgarndr.c Fri Apr 14 12:03:34 2017 (r316827) @@ -1031,7 +1031,7 @@ draw_pxlmouse_planar(scr_stat *scp, int int xoff, yoff; int ymax; u_short m; - int i, j; + int i, j, k; line_width = scp->sc->adp->va_line_width; xoff = (x - scp->xoff*8)%8; @@ -1043,42 +1043,27 @@ draw_pxlmouse_planar(scr_stat *scp, int outw(GDCIDX, 0xff08); /* bit mask */ outw(GDCIDX, 0x0803); /* data rotate/function select (and) */ p = scp->sc->adp->va_window + line_width*y + x/8; - if (x < scp->xpixel - 8) { - for (i = y, j = 0; i < ymax; ++i, ++j) { - m = ~((mouse_and_mask[j] & ~mouse_or_mask[j]) >> xoff); - readb(p); - writeb(p, m >> 8); - readb(p + 1); - writeb(p + 1, m); - p += line_width; - } - } else { - xoff += 8; - for (i = y, j = 0; i < ymax; ++i, ++j) { - m = ~((mouse_and_mask[j] & ~mouse_or_mask[j]) >> xoff); - readb(p); - writeb(p, m); - p += line_width; + for (i = y, j = 0; i < ymax; ++i, ++j) { + m = ~((mouse_and_mask[j] & ~mouse_or_mask[j]) >> xoff); + for (k = 0; k < 2; ++k) { + if (x + 8 * k < scp->xpixel) { + readb(p + k); + writeb(p + k, m >> (8 * (1 - k))); + } } + p += line_width; } outw(GDCIDX, 0x1003); /* data rotate/function select (or) */ p = scp->sc->adp->va_window + line_width*y + x/8; - if (x < scp->xpixel - 8) { - for (i = y, j = 0; i < ymax; ++i, ++j) { - m = mouse_or_mask[j] >> xoff; - readb(p); - writeb(p, m >> 8); - readb(p + 1); - writeb(p + 1, m); - p += line_width; - } - } else { - for (i = y, j = 0; i < ymax; ++i, ++j) { - m = mouse_or_mask[j] >> xoff; - readb(p); - writeb(p, m); - p += line_width; + for (i = y, j = 0; i < ymax; ++i, ++j) { + m = mouse_or_mask[j] >> xoff; + for (k = 0; k < 2; ++k) { + if (x + 8 * k < scp->xpixel) { + readb(p + k); + writeb(p + k, m >> (8 * (1 - k))); + } } + p += line_width; } outw(GDCIDX, 0x0003); /* data rotate/function select */ } From owner-svn-src-all@freebsd.org Fri Apr 14 12:54:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F65DD3DFCE; Fri, 14 Apr 2017 12:54:40 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C5B7DE6; Fri, 14 Apr 2017 12:54:40 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3ECsdDI028561; Fri, 14 Apr 2017 12:54:39 GMT (envelope-from schweikh@FreeBSD.org) Received: (from schweikh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3ECsd5d028560; Fri, 14 Apr 2017 12:54:39 GMT (envelope-from schweikh@FreeBSD.org) Message-Id: <201704141254.v3ECsd5d028560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: schweikh set sender to schweikh@FreeBSD.org using -f From: Jens Schweikhardt Date: Fri, 14 Apr 2017 12:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316828 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 12:54:40 -0000 Author: schweikh Date: Fri Apr 14 12:54:39 2017 New Revision: 316828 URL: https://svnweb.freebsd.org/changeset/base/316828 Log: Correct minor grammos; minor white-space fixes. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 14 12:03:34 2017 (r316827) +++ head/UPDATING Fri Apr 14 12:54:39 2017 (r316828) @@ -55,7 +55,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 As of r316810 for ipfilter, keep frags is no longer assumed when keep state is specified in a rule. r316810 aligns ipfilter with documentation in man pages separating keep frags from keep state. - This allows keep state to specified without forcing keep frags + This allows keep state to be specified without forcing keep frags and allows keep frags to be specified independently of keep state. To maintain previous behaviour, also specify keep frags with keep state (as documented in ipf.conf.5). @@ -100,7 +100,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 20170311: The old drm (sys/dev/drm/) drivers for i915 and radeon have been removed as the userland we provide cannot use them. The KMS version - (sys/dev/drm2) support the same hardware. + (sys/dev/drm2) supports the same hardware. 20170302: Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 4.0.0. @@ -214,7 +214,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 20160818: Remove the openbsd_poll system call. - __FreeBSD_version has been bumped because of this. + __FreeBSD_version has been bumped because of this. 20160622: The libc stub for the pipe(2) system call has been replaced with @@ -256,7 +256,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 packages will be needed. To update an existing self-hosted armv6hf system, you must add - TARGET_ARCH=armv6 on the make command line for both the build + TARGET_ARCH=armv6 on the make command line for both the build and the install steps. 20160510: @@ -507,7 +507,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 # pw groupmod video -m $USER 20150806: - The menu.rc and loader.rc files will now be replaced during + The menu.rc and loader.rc files will now be replaced during upgrades. Please migrate local changes to menu.rc.local and loader.rc.local instead. @@ -1242,7 +1242,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 behavior in parallel build. 20130429: - Fix a bug that allows NFS clients to issue READDIR on files. + Fix a bug that allows NFS clients to issue READDIR on files. 20130426: The WITHOUT_IDEA option has been removed because From owner-svn-src-all@freebsd.org Fri Apr 14 13:25:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E630D3D6F4; Fri, 14 Apr 2017 13:25:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4B99DF5; Fri, 14 Apr 2017 13:25:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EDPkcs041185; Fri, 14 Apr 2017 13:25:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EDPj06041181; Fri, 14 Apr 2017 13:25:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704141325.v3EDPj06041181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 14 Apr 2017 13:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316829 - in head/sys/fs: nfs nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 13:25:47 -0000 Author: rmacklem Date: Fri Apr 14 13:25:45 2017 New Revision: 316829 URL: https://svnweb.freebsd.org/changeset/base/316829 Log: Remove unused "cred" argument to ncl_flush(). The "cred" argument of ncl_flush() is unused and it was confusing to have the code passing in NULL for this argument in some cases. This patch deletes this argument. There is no semantic change because of this patch. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Fri Apr 14 12:54:39 2017 (r316828) +++ head/sys/fs/nfs/nfs_var.h Fri Apr 14 13:25:45 2017 (r316829) @@ -592,7 +592,7 @@ int nfscl_maperr(NFSPROC_T *, int, uid_t void nfscl_init(void); /* nfs_clbio.c */ -int ncl_flush(vnode_t, int, struct ucred *, NFSPROC_T *, int, int); +int ncl_flush(vnode_t, int, NFSPROC_T *, int, int); /* nfs_clnode.c */ void ncl_invalcaches(vnode_t); Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Fri Apr 14 12:54:39 2017 (r316828) +++ head/sys/fs/nfsclient/nfs_clnode.c Fri Apr 14 13:25:45 2017 (r316829) @@ -248,7 +248,7 @@ ncl_inactive(struct vop_inactive_args *a } else retv = TRUE; if (retv == TRUE) { - (void)ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1, 0); + (void)ncl_flush(vp, MNT_WAIT, ap->a_td, 1, 0); (void)nfsrpc_close(vp, 1, ap->a_td); } } Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Fri Apr 14 12:54:39 2017 (r316828) +++ head/sys/fs/nfsclient/nfs_clstate.c Fri Apr 14 13:25:45 2017 (r316829) @@ -3878,8 +3878,7 @@ nfscl_recalldeleg(struct nfsclclient *cl if ((dp->nfsdl_flags & NFSCLDL_WRITE) && (np->n_flag & NMODIFIED)) { np->n_flag |= NDELEGRECALL; NFSUNLOCKNODE(np); - ret = ncl_flush(vp, MNT_WAIT, cred, p, 1, - called_from_renewthread); + ret = ncl_flush(vp, MNT_WAIT, p, 1, called_from_renewthread); NFSLOCKNODE(np); np->n_flag &= ~NDELEGRECALL; } Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri Apr 14 12:54:39 2017 (r316828) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri Apr 14 13:25:45 2017 (r316829) @@ -709,12 +709,12 @@ nfs_close(struct vop_close_args *ap) * traditional vnode locking implemented for Vnode Ops. */ int cm = newnfs_commit_on_close ? 1 : 0; - error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm, 0); + error = ncl_flush(vp, MNT_WAIT, ap->a_td, cm, 0); /* np->n_flag &= ~NMODIFIED; */ } else if (NFS_ISV4(vp)) { if (nfscl_mustflush(vp) != 0) { int cm = newnfs_commit_on_close ? 1 : 0; - error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, + error = ncl_flush(vp, MNT_WAIT, ap->a_td, cm, 0); /* * as above w.r.t races when clearing @@ -2631,7 +2631,7 @@ nfs_fsync(struct vop_fsync_args *ap) */ return (0); } - return (ncl_flush(ap->a_vp, ap->a_waitfor, NULL, ap->a_td, 1, 0)); + return (ncl_flush(ap->a_vp, ap->a_waitfor, ap->a_td, 1, 0)); } /* @@ -2643,7 +2643,7 @@ nfs_fsync(struct vop_fsync_args *ap) * waiting for a buffer write to complete. */ int -ncl_flush(struct vnode *vp, int waitfor, struct ucred *cred, struct thread *td, +ncl_flush(struct vnode *vp, int waitfor, struct thread *td, int commit, int called_from_renewthread) { struct nfsnode *np = VTONFS(vp); @@ -3024,7 +3024,7 @@ nfs_advlock(struct vop_advlock_args *ap) if (ap->a_op == F_UNLCK && nfscl_checkwritelocked(vp, ap->a_fl, cred, td, ap->a_id, ap->a_flags)) - (void) ncl_flush(vp, MNT_WAIT, cred, td, 1, 0); + (void) ncl_flush(vp, MNT_WAIT, td, 1, 0); /* * Loop around doing the lock op, while a blocking lock @@ -3404,7 +3404,7 @@ nfs_set_text(struct vop_set_text_args *a } /* Now, flush the buffer cache. */ - ncl_flush(vp, MNT_WAIT, NULL, curthread, 0, 0); + ncl_flush(vp, MNT_WAIT, curthread, 0, 0); /* And, finally, make sure that n_mtime is up to date. */ np = VTONFS(vp); From owner-svn-src-all@freebsd.org Fri Apr 14 14:00:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 441ABD3D129; Fri, 14 Apr 2017 14:00:15 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EED607D; Fri, 14 Apr 2017 14:00:14 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EE0El2053722; Fri, 14 Apr 2017 14:00:14 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EE0Eo8053721; Fri, 14 Apr 2017 14:00:14 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704141400.v3EE0Eo8053721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 14 Apr 2017 14:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316830 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:00:15 -0000 Author: bde Date: Fri Apr 14 14:00:13 2017 New Revision: 316830 URL: https://svnweb.freebsd.org/changeset/base/316830 Log: Optimize drawing of the mouse cursor in vga planar mode almost as much as possible, by avoiding null ANDs and ORs to the frame buffer. Mouse cursors are fairly sparse, especially for their frame. Pixels are written in groups of 8 in planar mode and the per-group sparseness is not as large, but it still averages about 40% with the current 9x13 mouse cursor. The average drawing time is reduced by about this amount (from 22 usec constant to 12.5 usec average on Haswell). This optimization is relatively larger with larger cursors. Width 10 requires 6 frame buffer accesses per line instead of 4 if not done sparsely, but rarely more than 4 if done sparsely. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Fri Apr 14 13:25:45 2017 (r316829) +++ head/sys/dev/syscons/scvgarndr.c Fri Apr 14 14:00:13 2017 (r316830) @@ -1032,6 +1032,7 @@ draw_pxlmouse_planar(scr_stat *scp, int int ymax; u_short m; int i, j, k; + uint8_t m1; line_width = scp->sc->adp->va_line_width; xoff = (x - scp->xoff*8)%8; @@ -1046,9 +1047,10 @@ draw_pxlmouse_planar(scr_stat *scp, int for (i = y, j = 0; i < ymax; ++i, ++j) { m = ~((mouse_and_mask[j] & ~mouse_or_mask[j]) >> xoff); for (k = 0; k < 2; ++k) { - if (x + 8 * k < scp->xpixel) { + m1 = m >> (8 * (1 - k)); + if (m1 != 0xff && x + 8 * k < scp->xpixel) { readb(p + k); - writeb(p + k, m >> (8 * (1 - k))); + writeb(p + k, m1); } } p += line_width; @@ -1058,9 +1060,10 @@ draw_pxlmouse_planar(scr_stat *scp, int for (i = y, j = 0; i < ymax; ++i, ++j) { m = mouse_or_mask[j] >> xoff; for (k = 0; k < 2; ++k) { - if (x + 8 * k < scp->xpixel) { + m1 = m >> (8 * (1 - k)); + if (m1 != 0 && x + 8 * k < scp->xpixel) { readb(p + k); - writeb(p + k, m >> (8 * (1 - k))); + writeb(p + k, m1); } } p += line_width; From owner-svn-src-all@freebsd.org Fri Apr 14 14:01:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F606D3D35A; Fri, 14 Apr 2017 14:01:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F76F61F; Fri, 14 Apr 2017 14:01:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EE1a0i054471; Fri, 14 Apr 2017 14:01:36 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EE1asd054468; Fri, 14 Apr 2017 14:01:36 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141401.v3EE1asd054468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316831 - in stable/11/sys/x86: include x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:01:37 -0000 Author: avg Date: Fri Apr 14 14:01:35 2017 New Revision: 316831 URL: https://svnweb.freebsd.org/changeset/base/316831 Log: MFC r314398: Local APIC: add support for extended LVT entries found in AMD processors Modified: stable/11/sys/x86/include/apicreg.h stable/11/sys/x86/include/apicvar.h stable/11/sys/x86/x86/local_apic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/include/apicreg.h ============================================================================== --- stable/11/sys/x86/include/apicreg.h Fri Apr 14 14:00:13 2017 (r316830) +++ stable/11/sys/x86/include/apicreg.h Fri Apr 14 14:01:35 2017 (r316831) @@ -241,17 +241,32 @@ enum LAPIC_REGISTERS { LAPIC_CCR_TIMER = 0x39, LAPIC_DCR_TIMER = 0x3e, LAPIC_SELF_IPI = 0x3f, /* Only in x2APIC */ + LAPIC_EXT_FEATURES = 0x40, /* AMD */ + LAPIC_EXT_CTRL = 0x41, /* AMD */ + LAPIC_EXT_SEOI = 0x42, /* AMD */ + LAPIC_EXT_IER0 = 0x48, /* AMD */ + LAPIC_EXT_IER1 = 0x49, /* AMD */ + LAPIC_EXT_IER2 = 0x4a, /* AMD */ + LAPIC_EXT_IER3 = 0x4b, /* AMD */ + LAPIC_EXT_IER4 = 0x4c, /* AMD */ + LAPIC_EXT_IER5 = 0x4d, /* AMD */ + LAPIC_EXT_IER6 = 0x4e, /* AMD */ + LAPIC_EXT_IER7 = 0x4f, /* AMD */ + LAPIC_EXT_LVT0 = 0x50, /* AMD */ + LAPIC_EXT_LVT1 = 0x51, /* AMD */ + LAPIC_EXT_LVT2 = 0x52, /* AMD */ + LAPIC_EXT_LVT3 = 0x53, /* AMD */ }; +#define LAPIC_MEM_MUL 0x10 + /* - * The LAPIC_SELF_IPI register only exists in x2APIC mode. The - * formula below is applicable only to reserve the memory region, - * i.e. for xAPIC mode, where LAPIC_SELF_IPI finely serves as the - * address past end of the region. + * Although some registers are available on AMD processors only, + * it's not a big waste to reserve them on all platforms. + * However, we need to watch out for this space being assigned for + * non-APIC purposes in the future processor models. */ -#define LAPIC_MEM_REGION (LAPIC_SELF_IPI * 0x10) - -#define LAPIC_MEM_MUL 0x10 +#define LAPIC_MEM_REGION ((LAPIC_EXT_LVT3 + 1) * LAPIC_MEM_MUL) /****************************************************************************** * I/O APIC structure @@ -295,6 +310,7 @@ typedef struct IOAPIC ioapic_t; #define APIC_VER_MAXLVT 0x00ff0000 #define MAXLVTSHIFT 16 #define APIC_VER_EOI_SUPPRESSION 0x01000000 +#define APIC_VER_AMD_EXT_SPACE 0x80000000 /* fields in LDR */ #define APIC_LDR_RESERVED 0x00ffffff @@ -418,6 +434,13 @@ typedef struct IOAPIC ioapic_t; #define APIC_TDCR_128 0x0a #define APIC_TDCR_1 0x0b +/* Constants related to AMD Extended APIC Features Register */ +#define APIC_EXTF_ELVT_MASK 0x00ff0000 +#define APIC_EXTF_ELVT_SHIFT 16 +#define APIC_EXTF_EXTID_CAP 0x00000004 +#define APIC_EXTF_SEIO_CAP 0x00000002 +#define APIC_EXTF_IER_CAP 0x00000001 + /* LVT table indices */ #define APIC_LVT_LINT0 0 #define APIC_LVT_LINT1 1 @@ -428,6 +451,13 @@ typedef struct IOAPIC ioapic_t; #define APIC_LVT_CMCI 6 #define APIC_LVT_MAX APIC_LVT_CMCI +/* AMD extended LVT constants, seem to be assigned by fiat */ +#define APIC_ELVT_IBS 0 /* Instruction based sampling */ +#define APIC_ELVT_MCA 1 /* MCE thresholding */ +#define APIC_ELVT_DEI 2 /* Deferred error interrupt */ +#define APIC_ELVT_SBI 3 /* Sideband interface */ +#define APIC_ELVT_MAX APIC_ELVT_SBI + /****************************************************************************** * I/O APIC defines */ Modified: stable/11/sys/x86/include/apicvar.h ============================================================================== --- stable/11/sys/x86/include/apicvar.h Fri Apr 14 14:00:13 2017 (r316830) +++ stable/11/sys/x86/include/apicvar.h Fri Apr 14 14:01:35 2017 (r316831) @@ -232,6 +232,9 @@ struct apic_ops { /* CMC */ void (*enable_cmc)(void); + /* AMD ELVT */ + int (*enable_mca_elvt)(void); + /* IPI */ void (*ipi_raw)(register_t, u_int); void (*ipi_vectored)(u_int, int); @@ -396,6 +399,13 @@ lapic_enable_cmc(void) apic_ops.enable_cmc(); } +static inline int +lapic_enable_mca_elvt(void) +{ + + return (apic_ops.enable_mca_elvt()); +} + static inline void lapic_ipi_raw(register_t icrlo, u_int dest) { Modified: stable/11/sys/x86/x86/local_apic.c ============================================================================== --- stable/11/sys/x86/x86/local_apic.c Fri Apr 14 14:00:13 2017 (r316830) +++ stable/11/sys/x86/x86/local_apic.c Fri Apr 14 14:01:35 2017 (r316831) @@ -122,6 +122,7 @@ struct lvt { struct lapic { struct lvt la_lvts[APIC_LVT_MAX + 1]; + struct lvt la_elvts[APIC_ELVT_MAX + 1];; u_int la_id:8; u_int la_cluster:4; u_int la_cluster_id:2; @@ -146,6 +147,14 @@ static struct lvt lvts[APIC_LVT_MAX + 1] { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_CMC_INT }, /* CMCI */ }; +/* Global defaults for AMD local APIC ELVT entries. */ +static struct lvt elvts[APIC_ELVT_MAX + 1] = { + { 1, 1, 1, 0, APIC_LVT_DM_FIXED, 0 }, + { 1, 1, 1, 0, APIC_LVT_DM_FIXED, APIC_CMC_INT }, + { 1, 1, 1, 0, APIC_LVT_DM_FIXED, 0 }, + { 1, 1, 1, 0, APIC_LVT_DM_FIXED, 0 }, +}; + static inthand_t *ioint_handlers[] = { NULL, /* 0 - 31 */ IDTVEC(apic_isr1), /* 32 - 63 */ @@ -319,6 +328,7 @@ static int native_lapic_enable_pmc(void static void native_lapic_disable_pmc(void); static void native_lapic_reenable_pmc(void); static void native_lapic_enable_cmc(void); +static int native_lapic_enable_mca_elvt(void); static int native_lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked); static int native_lapic_set_lvt_mode(u_int apic_id, u_int lvt, @@ -357,6 +367,7 @@ struct apic_ops apic_ops = { .disable_pmc = native_lapic_disable_pmc, .reenable_pmc = native_lapic_reenable_pmc, .enable_cmc = native_lapic_enable_cmc, + .enable_mca_elvt = native_lapic_enable_mca_elvt, #ifdef SMP .ipi_raw = native_lapic_ipi_raw, .ipi_vectored = native_lapic_ipi_vectored, @@ -371,15 +382,8 @@ struct apic_ops apic_ops = { }; static uint32_t -lvt_mode(struct lapic *la, u_int pin, uint32_t value) +lvt_mode_impl(struct lapic *la, struct lvt *lvt, u_int pin, uint32_t value) { - struct lvt *lvt; - - KASSERT(pin <= APIC_LVT_MAX, ("%s: pin %u out of range", __func__, pin)); - if (la->la_lvts[pin].lvt_active) - lvt = &la->la_lvts[pin]; - else - lvt = &lvts[pin]; value &= ~(APIC_LVT_M | APIC_LVT_TM | APIC_LVT_IIPP | APIC_LVT_DM | APIC_LVT_VECTOR); @@ -411,6 +415,38 @@ lvt_mode(struct lapic *la, u_int pin, ui return (value); } +static uint32_t +lvt_mode(struct lapic *la, u_int pin, uint32_t value) +{ + struct lvt *lvt; + + KASSERT(pin <= APIC_LVT_MAX, + ("%s: pin %u out of range", __func__, pin)); + if (la->la_lvts[pin].lvt_active) + lvt = &la->la_lvts[pin]; + else + lvt = &lvts[pin]; + + return (lvt_mode_impl(la, lvt, pin, value)); +} + +static uint32_t +elvt_mode(struct lapic *la, u_int idx, uint32_t value) +{ + struct lvt *elvt; + + KASSERT(idx <= APIC_ELVT_MAX, + ("%s: idx %u out of range", __func__, idx)); + + elvt = &la->la_elvts[idx]; + KASSERT(elvt->lvt_active, ("%s: ELVT%u is not active", __func__, idx)); + KASSERT(elvt->lvt_edgetrigger, + ("%s: ELVT%u is not edge triggered", __func__, idx)); + KASSERT(elvt->lvt_activehi, + ("%s: ELVT%u is not active high", __func__, idx)); + return (lvt_mode_impl(la, elvt, idx, value)); +} + /* * Map the local APIC and setup necessary interrupt vectors. */ @@ -583,6 +619,10 @@ native_lapic_create(u_int apic_id, int b lapics[apic_id].la_lvts[i] = lvts[i]; lapics[apic_id].la_lvts[i].lvt_active = 0; } + for (i = 0; i <= APIC_ELVT_MAX; i++) { + lapics[apic_id].la_elvts[i] = elvts[i]; + lapics[apic_id].la_elvts[i].lvt_active = 0; + } for (i = 0; i <= APIC_NUM_IOINTS; i++) lapics[apic_id].la_ioint_irqs[i] = -1; lapics[apic_id].la_ioint_irqs[IDT_SYSCALL - APIC_IO_INTS] = IRQ_SYSCALL; @@ -602,18 +642,49 @@ native_lapic_create(u_int apic_id, int b #endif } +static inline uint32_t +amd_read_ext_features(void) +{ + uint32_t version; + + if (cpu_vendor_id != CPU_VENDOR_AMD) + return (0); + version = lapic_read32(LAPIC_VERSION); + if ((version & APIC_VER_AMD_EXT_SPACE) != 0) + return (lapic_read32(LAPIC_EXT_FEATURES)); + else + return (0); +} + +static inline uint32_t +amd_read_elvt_count(void) +{ + uint32_t extf; + uint32_t count; + + extf = amd_read_ext_features(); + count = (extf & APIC_EXTF_ELVT_MASK) >> APIC_EXTF_ELVT_SHIFT; + count = min(count, APIC_ELVT_MAX + 1); + return (count); +} + /* * Dump contents of local APIC registers */ static void native_lapic_dump(const char* str) { + uint32_t version; uint32_t maxlvt; + uint32_t extf; + int elvt_count; + int i; - maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT; + version = lapic_read32(LAPIC_VERSION); + maxlvt = (version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; printf("cpu%d %s:\n", PCPU_GET(cpuid), str); printf(" ID: 0x%08x VER: 0x%08x LDR: 0x%08x DFR: 0x%08x", - lapic_read32(LAPIC_ID), lapic_read32(LAPIC_VERSION), + lapic_read32(LAPIC_ID), version, lapic_read32(LAPIC_LDR), x2apic_mode ? 0 : lapic_read32(LAPIC_DFR)); if ((cpu_feature2 & CPUID2_X2APIC) != 0) printf(" x2APIC: %d", x2apic_mode); @@ -628,6 +699,14 @@ native_lapic_dump(const char* str) printf("\n"); if (maxlvt >= APIC_LVT_CMCI) printf(" cmci: 0x%08x\n", lapic_read32(LAPIC_LVT_CMCI)); + extf = amd_read_ext_features(); + if (extf != 0) { + printf(" AMD ext features: 0x%08x\n", extf); + elvt_count = amd_read_elvt_count(); + for (i = 0; i < elvt_count; i++) + printf(" AMD elvt%d: 0x%08x\n", i, + lapic_read32(LAPIC_EXT_LVT0 + i)); + } } static void @@ -645,15 +724,19 @@ static void native_lapic_setup(int boot) { struct lapic *la; + uint32_t version; uint32_t maxlvt; register_t saveintr; char buf[MAXCOMLEN + 1]; + int elvt_count; + int i; saveintr = intr_disable(); la = &lapics[lapic_id()]; KASSERT(la->la_present, ("missing APIC structure")); - maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT; + version = lapic_read32(LAPIC_VERSION); + maxlvt = (version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; /* Initialize the TPR to allow all interrupts. */ lapic_set_tpr(0); @@ -718,6 +801,13 @@ native_lapic_setup(int boot) lapic_read32(LAPIC_LVT_CMCI))); } + elvt_count = amd_read_elvt_count(); + for (i = 0; i < elvt_count; i++) { + if (la->la_elvts[i].lvt_active) + lapic_write32(LAPIC_EXT_LVT0 + i, + elvt_mode(la, i, lapic_read32(LAPIC_EXT_LVT0 + i))); + } + intr_restore(saveintr); } @@ -1311,6 +1401,37 @@ native_lapic_enable_cmc(void) printf("lapic%u: CMCI unmasked\n", apic_id); } +static int +native_lapic_enable_mca_elvt(void) +{ + u_int apic_id; + uint32_t value; + int elvt_count; + +#ifdef DEV_ATPIC + if (lapic_map == NULL) + return (-1); +#endif + + apic_id = PCPU_GET(apic_id); + KASSERT(lapics[apic_id].la_present, + ("%s: missing APIC %u", __func__, apic_id)); + elvt_count = amd_read_elvt_count(); + if (elvt_count <= APIC_ELVT_MCA) + return (-1); + + value = lapic_read32(LAPIC_EXT_LVT0 + APIC_ELVT_MCA); + if ((value & APIC_LVT_M) == 0) { + printf("AMD MCE Thresholding Extended LVT is already active\n"); + return (-1); + } + lapics[apic_id].la_elvts[APIC_ELVT_MCA].lvt_masked = 0; + lapics[apic_id].la_elvts[APIC_ELVT_MCA].lvt_active = 1; + if (bootverbose) + printf("lapic%u: MCE Thresholding ELVT unmasked\n", apic_id); + return (APIC_ELVT_MCA); +} + void lapic_handle_error(void) { From owner-svn-src-all@freebsd.org Fri Apr 14 14:03:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EB21D3D415; Fri, 14 Apr 2017 14:03:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51D38887; Fri, 14 Apr 2017 14:03:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EE3ous057428; Fri, 14 Apr 2017 14:03:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EE3oFl057426; Fri, 14 Apr 2017 14:03:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141403.v3EE3oFl057426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316832 - in stable/11/sys/x86: include x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:03:51 -0000 Author: avg Date: Fri Apr 14 14:03:50 2017 New Revision: 316832 URL: https://svnweb.freebsd.org/changeset/base/316832 Log: MFC r314636,r314700: MCA: add AMD Error Thresholding support Modified: stable/11/sys/x86/include/specialreg.h stable/11/sys/x86/x86/mca.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/include/specialreg.h ============================================================================== --- stable/11/sys/x86/include/specialreg.h Fri Apr 14 14:01:35 2017 (r316831) +++ stable/11/sys/x86/include/specialreg.h Fri Apr 14 14:03:50 2017 (r316832) @@ -705,6 +705,22 @@ #define MC_MISC_ADDRESS_MODE 0x00000000000001c0 /* If MCG_CAP_SER_P */ #define MC_CTL2_THRESHOLD 0x0000000000007fff #define MC_CTL2_CMCI_EN 0x0000000040000000 +#define MC_AMDNB_BANK 4 +#define MC_MISC_AMDNB_VAL 0x8000000000000000 /* Counter presence valid */ +#define MC_MISC_AMDNB_CNTP 0x4000000000000000 /* Counter present */ +#define MC_MISC_AMDNB_LOCK 0x2000000000000000 /* Register locked */ +#define MC_MISC_AMDNB_LVT_MASK 0x00f0000000000000 /* Extended LVT offset */ +#define MC_MISC_AMDNB_LVT_SHIFT 52 +#define MC_MISC_AMDNB_CNTEN 0x0008000000000000 /* Counter enabled */ +#define MC_MISC_AMDNB_INT_MASK 0x0006000000000000 /* Interrupt type */ +#define MC_MISC_AMDNB_INT_LVT 0x0002000000000000 /* Interrupt via Extended LVT */ +#define MC_MISC_AMDNB_INT_SMI 0x0004000000000000 /* SMI */ +#define MC_MISC_AMDNB_OVERFLOW 0x0001000000000000 /* Counter overflow */ +#define MC_MISC_AMDNB_CNT_MASK 0x00000fff00000000 /* Counter value */ +#define MC_MISC_AMDNB_CNT_SHIFT 32 +#define MC_MISC_AMDNB_CNT_MAX 0xfff +#define MC_MISC_AMDNB_PTR_MASK 0x00000000ff000000 /* Pointer to additional registers */ +#define MC_MISC_AMDNB_PTR_SHIFT 24 /* * The following four 3-byte registers control the non-cacheable regions. Modified: stable/11/sys/x86/x86/mca.c ============================================================================== --- stable/11/sys/x86/x86/mca.c Fri Apr 14 14:01:35 2017 (r316831) +++ stable/11/sys/x86/x86/mca.c Fri Apr 14 14:03:50 2017 (r316832) @@ -75,6 +75,11 @@ struct cmc_state { int max_threshold; time_t last_intr; }; + +struct amd_et_state { + int cur_threshold; + time_t last_intr; +}; #endif struct mca_internal { @@ -118,8 +123,18 @@ static struct task mca_refill_task, mca_ static struct mtx mca_lock; #ifdef DEV_APIC -static struct cmc_state **cmc_state; /* Indexed by cpuid, bank */ +static struct cmc_state **cmc_state; /* Indexed by cpuid, bank. */ +static struct amd_et_state *amd_et_state; /* Indexed by cpuid. */ static int cmc_throttle = 60; /* Time in seconds to throttle CMCI. */ + +static int amd_elvt = -1; + +static inline bool +amd_thresholding_supported(void) +{ + return (cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) >= 0x10 && CPUID_TO_FAMILY(cpu_id) <= 0x16); +} #endif static int @@ -521,19 +536,15 @@ mca_record_entry(enum scan_mode mode, co * cmc_throttle seconds or the periodic scan. If a periodic scan * finds that the threshold is too high, it is lowered. */ -static void -cmci_update(enum scan_mode mode, int bank, int valid, struct mca_record *rec) +static int +update_threshold(enum scan_mode mode, int valid, int last_intr, int count, + int cur_threshold, int max_threshold) { - struct cmc_state *cc; - uint64_t ctl; u_int delta; - int count, limit; + int limit; - /* Fetch the current limit for this bank. */ - cc = &cmc_state[PCPU_GET(cpuid)][bank]; - ctl = rdmsr(MSR_MC_CTL2(bank)); - count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; - delta = (u_int)(time_uptime - cc->last_intr); + delta = (u_int)(time_uptime - last_intr); + limit = cur_threshold; /* * If an interrupt was received less than cmc_throttle seconds @@ -542,16 +553,11 @@ cmci_update(enum scan_mode mode, int ban * double the threshold up to the max. */ if (mode == CMCI && valid) { - limit = ctl & MC_CTL2_THRESHOLD; if (delta < cmc_throttle && count >= limit && - limit < cc->max_threshold) { - limit = min(limit << 1, cc->max_threshold); - ctl &= ~MC_CTL2_THRESHOLD; - ctl |= limit; - wrmsr(MSR_MC_CTL2(bank), ctl); + limit < max_threshold) { + limit = min(limit << 1, max_threshold); } - cc->last_intr = time_uptime; - return; + return (limit); } /* @@ -559,31 +565,81 @@ cmci_update(enum scan_mode mode, int ban * should be lowered. */ if (mode != POLLED) - return; + return (limit); /* If a CMCI occured recently, do nothing for now. */ if (delta < cmc_throttle) - return; + return (limit); /* * Compute a new limit based on the average rate of events per * cmc_throttle seconds since the last interrupt. */ if (valid) { - count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; limit = count * cmc_throttle / delta; if (limit <= 0) limit = 1; - else if (limit > cc->max_threshold) - limit = cc->max_threshold; - } else + else if (limit > max_threshold) + limit = max_threshold; + } else { limit = 1; - if ((ctl & MC_CTL2_THRESHOLD) != limit) { + } + return (limit); +} + +static void +cmci_update(enum scan_mode mode, int bank, int valid, struct mca_record *rec) +{ + struct cmc_state *cc; + uint64_t ctl; + int cur_threshold, new_threshold; + int count; + + /* Fetch the current limit for this bank. */ + cc = &cmc_state[PCPU_GET(cpuid)][bank]; + ctl = rdmsr(MSR_MC_CTL2(bank)); + count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; + cur_threshold = ctl & MC_CTL2_THRESHOLD; + + new_threshold = update_threshold(mode, valid, cc->last_intr, count, + cur_threshold, cc->max_threshold); + + if (mode == CMCI && valid) + cc->last_intr = time_uptime; + if (new_threshold != cur_threshold) { ctl &= ~MC_CTL2_THRESHOLD; - ctl |= limit; + ctl |= new_threshold; wrmsr(MSR_MC_CTL2(bank), ctl); } } + +static void +amd_thresholding_update(enum scan_mode mode, int bank, int valid) +{ + struct amd_et_state *cc; + uint64_t misc; + int new_threshold; + int count; + + KASSERT(bank == MC_AMDNB_BANK, + ("%s: unexpected bank %d", __func__, bank)); + cc = &amd_et_state[PCPU_GET(cpuid)]; + misc = rdmsr(MSR_MC_MISC(bank)); + count = (misc & MC_MISC_AMDNB_CNT_MASK) >> MC_MISC_AMDNB_CNT_SHIFT; + count = count - (MC_MISC_AMDNB_CNT_MAX - cc->cur_threshold); + + new_threshold = update_threshold(mode, valid, cc->last_intr, count, + cc->cur_threshold, MC_MISC_AMDNB_CNT_MAX); + + cc->cur_threshold = new_threshold; + misc &= ~MC_MISC_AMDNB_CNT_MASK; + misc |= (uint64_t)(MC_MISC_AMDNB_CNT_MAX - cc->cur_threshold) + << MC_MISC_AMDNB_CNT_SHIFT; + misc &= ~MC_MISC_AMDNB_OVERFLOW; + wrmsr(MSR_MC_MISC(bank), misc); + if (mode == CMCI && valid) + cc->last_intr = time_uptime; +} #endif /* @@ -638,8 +694,12 @@ mca_scan(enum scan_mode mode) * If this is a bank this CPU monitors via CMCI, * update the threshold. */ - if (PCPU_GET(cmci_mask) & 1 << i) - cmci_update(mode, i, valid, &rec); + if (PCPU_GET(cmci_mask) & 1 << i) { + if (cmc_state != NULL) + cmci_update(mode, i, valid, &rec); + else + amd_thresholding_update(mode, i, valid); + } #endif } if (mode == POLLED) @@ -751,6 +811,18 @@ cmci_setup(void) &cmc_throttle, 0, sysctl_positive_int, "I", "Interval in seconds to throttle corrected MC interrupts"); } + +static void +amd_thresholding_setup(void) +{ + + amd_et_state = malloc((mp_maxid + 1) * sizeof(struct amd_et_state), + M_MCA, M_WAITOK | M_ZERO); + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, + "cmc_throttle", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + &cmc_throttle, 0, sysctl_positive_int, "I", + "Interval in seconds to throttle corrected MC interrupts"); +} #endif static void @@ -789,6 +861,8 @@ mca_setup(uint64_t mcg_cap) #ifdef DEV_APIC if (mcg_cap & MCG_CAP_CMCI_P) cmci_setup(); + else if (amd_thresholding_supported()) + amd_thresholding_setup(); #endif } @@ -863,6 +937,82 @@ cmci_resume(int i) ctl |= MC_CTL2_CMCI_EN | 1; wrmsr(MSR_MC_CTL2(i), ctl); } + +static void +amd_thresholding_start(struct amd_et_state *cc) +{ + uint64_t misc; + + KASSERT(amd_elvt >= 0, ("ELVT offset is not set")); + misc = rdmsr(MSR_MC_MISC(MC_AMDNB_BANK)); + misc &= ~MC_MISC_AMDNB_INT_MASK; + misc |= MC_MISC_AMDNB_INT_LVT; + misc &= ~MC_MISC_AMDNB_LVT_MASK; + misc |= (uint64_t)amd_elvt << MC_MISC_AMDNB_LVT_SHIFT; + misc &= ~MC_MISC_AMDNB_CNT_MASK; + misc |= (uint64_t)(MC_MISC_AMDNB_CNT_MAX - cc->cur_threshold) + << MC_MISC_AMDNB_CNT_SHIFT; + misc &= ~MC_MISC_AMDNB_OVERFLOW; + misc |= MC_MISC_AMDNB_CNTEN; + + wrmsr(MSR_MC_MISC(MC_AMDNB_BANK), misc); +} + +static void +amd_thresholding_init(void) +{ + struct amd_et_state *cc; + uint64_t misc; + + /* The counter must be valid and present. */ + misc = rdmsr(MSR_MC_MISC(MC_AMDNB_BANK)); + if ((misc & (MC_MISC_AMDNB_VAL | MC_MISC_AMDNB_CNTP)) != + (MC_MISC_AMDNB_VAL | MC_MISC_AMDNB_CNTP)) + return; + + /* The register should not be locked. */ + if ((misc & MC_MISC_AMDNB_LOCK) != 0) + return; + + /* + * If counter is enabled then either the firmware or another CPU + * has already claimed it. + */ + if ((misc & MC_MISC_AMDNB_CNTEN) != 0) + return; + + /* + * Configure an Extended Interrupt LVT register for reporting + * counter overflows if that feature is supported and the first + * extended register is available. + */ + amd_elvt = lapic_enable_mca_elvt(); + if (amd_elvt < 0) + return; + + /* Re-use Intel CMC support infrastructure. */ + cc = &amd_et_state[PCPU_GET(cpuid)]; + cc->cur_threshold = 1; + amd_thresholding_start(cc); + + /* Mark the NB bank as monitored. */ + PCPU_SET(cmci_mask, PCPU_GET(cmci_mask) | 1 << MC_AMDNB_BANK); +} + +static void +amd_thresholding_resume(void) +{ + struct amd_et_state *cc; + + /* Nothing to do if this CPU doesn't monitor the NB bank. */ + if ((PCPU_GET(cmci_mask) & 1 << MC_AMDNB_BANK) == 0) + return; + + cc = &amd_et_state[PCPU_GET(cpuid)]; + cc->last_intr = 0; + cc->cur_threshold = 1; + amd_thresholding_start(cc); +} #endif /* @@ -940,8 +1090,26 @@ _mca_init(int boot) } #ifdef DEV_APIC - if (PCPU_GET(cmci_mask) != 0 && boot) + /* + * AMD Processors from families 10h - 16h provide support + * for Machine Check Error Thresholding. + * The processors support counters of MC errors and they + * can be configured to generate an interrupt when a counter + * overflows. + * The counters are all associated with Bank 4 and each + * of them covers a group of errors reported via that bank. + * At the moment only the DRAM Error Threshold Group is + * supported. + */ + if (amd_thresholding_supported() && + (mcg_cap & MCG_CAP_COUNT) >= 4) { + if (boot) + amd_thresholding_init(); + else + amd_thresholding_resume(); + } else if (PCPU_GET(cmci_mask) != 0 && boot) { lapic_enable_cmc(); + } #endif } From owner-svn-src-all@freebsd.org Fri Apr 14 14:05:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B613ED3D4FD; Fri, 14 Apr 2017 14:05:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 878DAA37; Fri, 14 Apr 2017 14:05:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EE5eCG057552; Fri, 14 Apr 2017 14:05:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EE5efq057551; Fri, 14 Apr 2017 14:05:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141405.v3EE5efq057551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316833 - in stable/11/sys: dev/amd_ecc_inject modules modules/amd_ecc_inject X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:05:41 -0000 Author: avg Date: Fri Apr 14 14:05:40 2017 New Revision: 316833 URL: https://svnweb.freebsd.org/changeset/base/316833 Log: MFC r314638: add a module that provides support for DRAM ECC error injection on AMD CPUs Added: stable/11/sys/dev/amd_ecc_inject/ - copied from r314638, head/sys/dev/amd_ecc_inject/ stable/11/sys/modules/amd_ecc_inject/ - copied from r314638, head/sys/modules/amd_ecc_inject/ Modified: stable/11/sys/modules/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Fri Apr 14 14:03:50 2017 (r316832) +++ stable/11/sys/modules/Makefile Fri Apr 14 14:05:40 2017 (r316833) @@ -34,6 +34,7 @@ SUBDIR= \ alc \ ale \ alq \ + ${_amd_ecc_inject} \ ${_amdsbwd} \ ${_amdtemp} \ amr \ @@ -617,6 +618,7 @@ _acpi= acpi .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) _aesni= aesni .endif +_amd_ecc_inject=amd_ecc_inject _amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr From owner-svn-src-all@freebsd.org Fri Apr 14 14:11:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F281CD3D7DF; Fri, 14 Apr 2017 14:11:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2D36DDB; Fri, 14 Apr 2017 14:11:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEBnUK057858; Fri, 14 Apr 2017 14:11:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEBnki057855; Fri, 14 Apr 2017 14:11:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141411.v3EEBnki057855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316834 - in stable/11: sys/vm tools/tools/umastat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:11:51 -0000 Author: avg Date: Fri Apr 14 14:11:49 2017 New Revision: 316834 URL: https://svnweb.freebsd.org/changeset/base/316834 Log: MFC r315077: uma: eliminate uk_slabsize field Modified: stable/11/sys/vm/uma_core.c stable/11/sys/vm/uma_int.h stable/11/tools/tools/umastat/umastat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/uma_core.c ============================================================================== --- stable/11/sys/vm/uma_core.c Fri Apr 14 14:05:40 2017 (r316833) +++ stable/11/sys/vm/uma_core.c Fri Apr 14 14:11:49 2017 (r316834) @@ -1218,15 +1218,16 @@ keg_small_init(uma_keg_t keg) u_int memused; u_int wastedspace; u_int shsize; + u_int slabsize; if (keg->uk_flags & UMA_ZONE_PCPU) { u_int ncpus = (mp_maxid + 1) ? (mp_maxid + 1) : MAXCPU; - keg->uk_slabsize = sizeof(struct pcpu); + slabsize = sizeof(struct pcpu); keg->uk_ppera = howmany(ncpus * sizeof(struct pcpu), PAGE_SIZE); } else { - keg->uk_slabsize = UMA_SLAB_SIZE; + slabsize = UMA_SLAB_SIZE; keg->uk_ppera = 1; } @@ -1236,8 +1237,8 @@ keg_small_init(uma_keg_t keg) * allocation bits for we round it up. */ rsize = keg->uk_size; - if (rsize < keg->uk_slabsize / SLAB_SETSIZE) - rsize = keg->uk_slabsize / SLAB_SETSIZE; + if (rsize < slabsize / SLAB_SETSIZE) + rsize = slabsize / SLAB_SETSIZE; if (rsize & keg->uk_align) rsize = (rsize & ~keg->uk_align) + (keg->uk_align + 1); keg->uk_rsize = rsize; @@ -1251,12 +1252,12 @@ keg_small_init(uma_keg_t keg) else shsize = sizeof(struct uma_slab); - keg->uk_ipers = (keg->uk_slabsize - shsize) / rsize; + keg->uk_ipers = (slabsize - shsize) / rsize; KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE, ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); memused = keg->uk_ipers * rsize + shsize; - wastedspace = keg->uk_slabsize - memused; + wastedspace = slabsize - memused; /* * We can't do OFFPAGE if we're internal or if we've been @@ -1277,9 +1278,9 @@ keg_small_init(uma_keg_t keg) * Historically this was not done because the VM could not * efficiently handle contiguous allocations. */ - if ((wastedspace >= keg->uk_slabsize / UMA_MAX_WASTE) && - (keg->uk_ipers < (keg->uk_slabsize / keg->uk_rsize))) { - keg->uk_ipers = keg->uk_slabsize / keg->uk_rsize; + if ((wastedspace >= slabsize / UMA_MAX_WASTE) && + (keg->uk_ipers < (slabsize / keg->uk_rsize))) { + keg->uk_ipers = slabsize / keg->uk_rsize; KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE, ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); #ifdef UMA_DEBUG @@ -1288,8 +1289,8 @@ keg_small_init(uma_keg_t keg) "maximum wasted space allowed = %d, " "calculated ipers = %d, " "new wasted space = %d\n", keg->uk_name, wastedspace, - keg->uk_slabsize / UMA_MAX_WASTE, keg->uk_ipers, - keg->uk_slabsize - keg->uk_ipers * keg->uk_rsize); + slabsize / UMA_MAX_WASTE, keg->uk_ipers, + slabsize - keg->uk_ipers * keg->uk_rsize); #endif keg->uk_flags |= UMA_ZONE_OFFPAGE; } @@ -1322,7 +1323,6 @@ keg_large_init(uma_keg_t keg) ("%s: Cannot large-init a UMA_ZONE_PCPU keg", __func__)); keg->uk_ppera = howmany(keg->uk_size, PAGE_SIZE); - keg->uk_slabsize = keg->uk_ppera * PAGE_SIZE; keg->uk_ipers = 1; keg->uk_rsize = keg->uk_size; @@ -1374,7 +1374,6 @@ keg_cachespread_init(uma_keg_t keg) pages = MIN(pages, (128 * 1024) / PAGE_SIZE); keg->uk_rsize = rsize; keg->uk_ppera = pages; - keg->uk_slabsize = UMA_SLAB_SIZE; keg->uk_ipers = ((pages * PAGE_SIZE) + trailer) / rsize; keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; KASSERT(keg->uk_ipers <= SLAB_SETSIZE, Modified: stable/11/sys/vm/uma_int.h ============================================================================== --- stable/11/sys/vm/uma_int.h Fri Apr 14 14:05:40 2017 (r316833) +++ stable/11/sys/vm/uma_int.h Fri Apr 14 14:11:49 2017 (r316834) @@ -210,7 +210,6 @@ struct uma_keg { vm_offset_t uk_kva; /* Zone base KVA */ uma_zone_t uk_slabzone; /* Slab zone backing us, if OFFPAGE */ - uint16_t uk_slabsize; /* Slab size for this keg */ uint16_t uk_pgoff; /* Offset to uma_slab struct */ uint16_t uk_ppera; /* pages per allocation from backend */ uint16_t uk_ipers; /* Items per slab */ Modified: stable/11/tools/tools/umastat/umastat.c ============================================================================== --- stable/11/tools/tools/umastat/umastat.c Fri Apr 14 14:05:40 2017 (r316833) +++ stable/11/tools/tools/umastat/umastat.c Fri Apr 14 14:11:49 2017 (r316834) @@ -378,7 +378,6 @@ main(int argc, char *argv[]) printf(" uk_rsize = %d\n", kz.uk_rsize); printf(" uk_maxpages = %d\n", kz.uk_maxpages); - printf(" uk_slabsize = %d\n", kz.uk_slabsize); printf(" uk_pgoff = %d\n", kz.uk_pgoff); printf(" uk_ppera = %d\n", kz.uk_ppera); printf(" uk_ipers = %d\n", kz.uk_ipers); From owner-svn-src-all@freebsd.org Fri Apr 14 14:12:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDF70D3D828; Fri, 14 Apr 2017 14:12:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0D36E76; Fri, 14 Apr 2017 14:12:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEBxYi059595; Fri, 14 Apr 2017 14:11:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEBxQs059450; Fri, 14 Apr 2017 14:11:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141411.v3EEBxQs059450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316835 - in stable/10: sys/vm tools/tools/umastat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:12:01 -0000 Author: avg Date: Fri Apr 14 14:11:59 2017 New Revision: 316835 URL: https://svnweb.freebsd.org/changeset/base/316835 Log: MFC r315077: uma: eliminate uk_slabsize field Modified: stable/10/sys/vm/uma_core.c stable/10/sys/vm/uma_int.h stable/10/tools/tools/umastat/umastat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Fri Apr 14 14:11:49 2017 (r316834) +++ stable/10/sys/vm/uma_core.c Fri Apr 14 14:11:59 2017 (r316835) @@ -1226,15 +1226,16 @@ keg_small_init(uma_keg_t keg) u_int memused; u_int wastedspace; u_int shsize; + u_int slabsize; if (keg->uk_flags & UMA_ZONE_PCPU) { u_int ncpus = mp_ncpus ? mp_ncpus : MAXCPU; - keg->uk_slabsize = sizeof(struct pcpu); + slabsize = sizeof(struct pcpu); keg->uk_ppera = howmany(ncpus * sizeof(struct pcpu), PAGE_SIZE); } else { - keg->uk_slabsize = UMA_SLAB_SIZE; + slabsize = UMA_SLAB_SIZE; keg->uk_ppera = 1; } @@ -1244,8 +1245,8 @@ keg_small_init(uma_keg_t keg) * allocation bits for we round it up. */ rsize = keg->uk_size; - if (rsize < keg->uk_slabsize / SLAB_SETSIZE) - rsize = keg->uk_slabsize / SLAB_SETSIZE; + if (rsize < slabsize / SLAB_SETSIZE) + rsize = slabsize / SLAB_SETSIZE; if (rsize & keg->uk_align) rsize = (rsize & ~keg->uk_align) + (keg->uk_align + 1); keg->uk_rsize = rsize; @@ -1262,12 +1263,12 @@ keg_small_init(uma_keg_t keg) else shsize = sizeof(struct uma_slab); - keg->uk_ipers = (keg->uk_slabsize - shsize) / rsize; + keg->uk_ipers = (slabsize - shsize) / rsize; KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE, ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); memused = keg->uk_ipers * rsize + shsize; - wastedspace = keg->uk_slabsize - memused; + wastedspace = slabsize - memused; /* * We can't do OFFPAGE if we're internal or if we've been @@ -1288,9 +1289,9 @@ keg_small_init(uma_keg_t keg) * Historically this was not done because the VM could not * efficiently handle contiguous allocations. */ - if ((wastedspace >= keg->uk_slabsize / UMA_MAX_WASTE) && - (keg->uk_ipers < (keg->uk_slabsize / keg->uk_rsize))) { - keg->uk_ipers = keg->uk_slabsize / keg->uk_rsize; + if ((wastedspace >= slabsize / UMA_MAX_WASTE) && + (keg->uk_ipers < (slabsize / keg->uk_rsize))) { + keg->uk_ipers = slabsize / keg->uk_rsize; KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE, ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); #ifdef UMA_DEBUG @@ -1299,8 +1300,8 @@ keg_small_init(uma_keg_t keg) "maximum wasted space allowed = %d, " "calculated ipers = %d, " "new wasted space = %d\n", keg->uk_name, wastedspace, - keg->uk_slabsize / UMA_MAX_WASTE, keg->uk_ipers, - keg->uk_slabsize - keg->uk_ipers * keg->uk_rsize); + slabsize / UMA_MAX_WASTE, keg->uk_ipers, + slabsize - keg->uk_ipers * keg->uk_rsize); #endif keg->uk_flags |= UMA_ZONE_OFFPAGE; } @@ -1333,7 +1334,6 @@ keg_large_init(uma_keg_t keg) ("%s: Cannot large-init a UMA_ZONE_PCPU keg", __func__)); keg->uk_ppera = howmany(keg->uk_size, PAGE_SIZE); - keg->uk_slabsize = keg->uk_ppera * PAGE_SIZE; keg->uk_ipers = 1; keg->uk_rsize = keg->uk_size; @@ -1387,7 +1387,6 @@ keg_cachespread_init(uma_keg_t keg) pages = MIN(pages, (128 * 1024) / PAGE_SIZE); keg->uk_rsize = rsize; keg->uk_ppera = pages; - keg->uk_slabsize = UMA_SLAB_SIZE; keg->uk_ipers = ((pages * PAGE_SIZE) + trailer) / rsize; keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; KASSERT(keg->uk_ipers <= SLAB_SETSIZE, Modified: stable/10/sys/vm/uma_int.h ============================================================================== --- stable/10/sys/vm/uma_int.h Fri Apr 14 14:11:49 2017 (r316834) +++ stable/10/sys/vm/uma_int.h Fri Apr 14 14:11:59 2017 (r316835) @@ -206,7 +206,6 @@ struct uma_keg { vm_offset_t uk_kva; /* Zone base KVA */ uma_zone_t uk_slabzone; /* Slab zone backing us, if OFFPAGE */ - uint16_t uk_slabsize; /* Slab size for this keg */ uint16_t uk_pgoff; /* Offset to uma_slab struct */ uint16_t uk_ppera; /* pages per allocation from backend */ uint16_t uk_ipers; /* Items per slab */ Modified: stable/10/tools/tools/umastat/umastat.c ============================================================================== --- stable/10/tools/tools/umastat/umastat.c Fri Apr 14 14:11:49 2017 (r316834) +++ stable/10/tools/tools/umastat/umastat.c Fri Apr 14 14:11:59 2017 (r316835) @@ -378,7 +378,6 @@ main(int argc, char *argv[]) printf(" uk_rsize = %d\n", kz.uk_rsize); printf(" uk_maxpages = %d\n", kz.uk_maxpages); - printf(" uk_slabsize = %d\n", kz.uk_slabsize); printf(" uk_pgoff = %d\n", kz.uk_pgoff); printf(" uk_ppera = %d\n", kz.uk_ppera); printf(" uk_ipers = %d\n", kz.uk_ipers); From owner-svn-src-all@freebsd.org Fri Apr 14 14:34:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC645D3DEEE; Fri, 14 Apr 2017 14:34:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 748B3FC4; Fri, 14 Apr 2017 14:34:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEYmaB070312; Fri, 14 Apr 2017 14:34:48 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEYmSl070311; Fri, 14 Apr 2017 14:34:48 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141434.v3EEYmSl070311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316836 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:34:49 -0000 Author: avg Date: Fri Apr 14 14:34:48 2017 New Revision: 316836 URL: https://svnweb.freebsd.org/changeset/base/316836 Log: MFC r315078: uma: fix pages <-> items conversions at several places Modified: stable/11/sys/vm/uma_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/uma_core.c ============================================================================== --- stable/11/sys/vm/uma_core.c Fri Apr 14 14:11:59 2017 (r316835) +++ stable/11/sys/vm/uma_core.c Fri Apr 14 14:34:48 2017 (r316836) @@ -1505,7 +1505,8 @@ keg_ctor(void *mem, int size, void *udat printf("UMA: %s(%p) size %d(%d) flags %#x ipers %d ppera %d out %d free %d\n", zone->uz_name, zone, keg->uk_size, keg->uk_rsize, keg->uk_flags, keg->uk_ipers, keg->uk_ppera, - (keg->uk_ipers * keg->uk_pages) - keg->uk_free, keg->uk_free); + (keg->uk_pages / keg->uk_ppera) * keg->uk_ipers - keg->uk_free, + keg->uk_free); #endif LIST_INSERT_HEAD(&keg->uk_zones, zone, uz_link); @@ -2916,7 +2917,7 @@ uma_zone_set_max(uma_zone_t zone, int ni keg->uk_maxpages = (nitems / keg->uk_ipers) * keg->uk_ppera; if (keg->uk_maxpages * keg->uk_ipers < nitems) keg->uk_maxpages += keg->uk_ppera; - nitems = keg->uk_maxpages * keg->uk_ipers; + nitems = (keg->uk_maxpages / keg->uk_ppera) * keg->uk_ipers; KEG_UNLOCK(keg); return (nitems); @@ -2933,7 +2934,7 @@ uma_zone_get_max(uma_zone_t zone) if (keg == NULL) return (0); KEG_LOCK(keg); - nitems = keg->uk_maxpages * keg->uk_ipers; + nitems = (keg->uk_maxpages / keg->uk_ppera) * keg->uk_ipers; KEG_UNLOCK(keg); return (nitems); @@ -3094,13 +3095,14 @@ uma_zone_reserve_kva(uma_zone_t zone, in if (pages * keg->uk_ipers < count) pages++; + pages *= keg->uk_ppera; #ifdef UMA_MD_SMALL_ALLOC if (keg->uk_ppera > 1) { #else if (1) { #endif - kva = kva_alloc((vm_size_t)pages * UMA_SLAB_SIZE); + kva = kva_alloc((vm_size_t)pages * PAGE_SIZE); if (kva == 0) return (0); } else @@ -3300,8 +3302,8 @@ uma_print_keg(uma_keg_t keg) "out %d free %d limit %d\n", keg->uk_name, keg, keg->uk_size, keg->uk_rsize, keg->uk_flags, keg->uk_ipers, keg->uk_ppera, - (keg->uk_ipers * keg->uk_pages) - keg->uk_free, keg->uk_free, - (keg->uk_maxpages / keg->uk_ppera) * keg->uk_ipers); + (keg->uk_pages / keg->uk_ppera) * keg->uk_ipers - keg->uk_free, + keg->uk_free, (keg->uk_maxpages / keg->uk_ppera) * keg->uk_ipers); printf("Part slabs:\n"); LIST_FOREACH(slab, &keg->uk_part_slab, us_link) slab_print(slab); From owner-svn-src-all@freebsd.org Fri Apr 14 14:38:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1771D3DFC9; Fri, 14 Apr 2017 14:38:28 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1DBC19F; Fri, 14 Apr 2017 14:38:28 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEcRML070488; Fri, 14 Apr 2017 14:38:27 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEcRfX070487; Fri, 14 Apr 2017 14:38:27 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201704141438.v3EEcRfX070487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 14 Apr 2017 14:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316837 - head/sys/dev/usb/quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:38:28 -0000 Author: kevlo Date: Fri Apr 14 14:38:27 2017 New Revision: 316837 URL: https://svnweb.freebsd.org/changeset/base/316837 Log: Remove RTL8153 quirk since ure(4) supports this chip. Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Apr 14 14:34:48 2017 (r316836) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Apr 14 14:38:27 2017 (r316837) @@ -95,7 +95,6 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC), USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS), USB_QUIRK(REALTEK, RTL8196EU, 0x0000, 0xffff, UQ_CFG_INDEX_1), - USB_QUIRK(REALTEK, RTL8153, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(CISCOLINKSYS, USB3GIGV1, 0x0000, 0xffff, UQ_CFG_INDEX_1), From owner-svn-src-all@freebsd.org Fri Apr 14 14:39:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4A67D3D090; Fri, 14 Apr 2017 14:39:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6671617; Fri, 14 Apr 2017 14:39:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEdwqB070742; Fri, 14 Apr 2017 14:39:58 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEdwdK070741; Fri, 14 Apr 2017 14:39:58 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141439.v3EEdwdK070741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316838 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:40:00 -0000 Author: avg Date: Fri Apr 14 14:39:58 2017 New Revision: 316838 URL: https://svnweb.freebsd.org/changeset/base/316838 Log: MFC r286583: Avoid sign extension of value passed to kva_alloc from uma_zone_reserve_kva On behalf of: zbb Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Fri Apr 14 14:38:27 2017 (r316837) +++ stable/10/sys/vm/uma_core.c Fri Apr 14 14:39:58 2017 (r316838) @@ -3109,7 +3109,7 @@ uma_zone_reserve_kva(uma_zone_t zone, in { uma_keg_t keg; vm_offset_t kva; - int pages; + u_int pages; keg = zone_first_keg(zone); if (keg == NULL) @@ -3124,7 +3124,7 @@ uma_zone_reserve_kva(uma_zone_t zone, in #else if (1) { #endif - kva = kva_alloc(pages * UMA_SLAB_SIZE); + kva = kva_alloc((vm_size_t)pages * UMA_SLAB_SIZE); if (kva == 0) return (0); } else From owner-svn-src-all@freebsd.org Fri Apr 14 14:41:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39924D3D28B; Fri, 14 Apr 2017 14:41:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E37179CC; Fri, 14 Apr 2017 14:41:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEfWcU074351; Fri, 14 Apr 2017 14:41:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEfWiU074350; Fri, 14 Apr 2017 14:41:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141441.v3EEfWiU074350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316839 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:41:33 -0000 Author: avg Date: Fri Apr 14 14:41:31 2017 New Revision: 316839 URL: https://svnweb.freebsd.org/changeset/base/316839 Log: MFC r315078: uma: fix pages <-> items conversions at several places Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Fri Apr 14 14:39:58 2017 (r316838) +++ stable/10/sys/vm/uma_core.c Fri Apr 14 14:41:31 2017 (r316839) @@ -1538,7 +1538,8 @@ keg_ctor(void *mem, int size, void *udat printf("UMA: %s(%p) size %d(%d) flags %#x ipers %d ppera %d out %d free %d\n", zone->uz_name, zone, keg->uk_size, keg->uk_rsize, keg->uk_flags, keg->uk_ipers, keg->uk_ppera, - (keg->uk_ipers * keg->uk_pages) - keg->uk_free, keg->uk_free); + (keg->uk_pages / keg->uk_ppera) * keg->uk_ipers - keg->uk_free, + keg->uk_free); #endif LIST_INSERT_HEAD(&keg->uk_zones, zone, uz_link); @@ -2950,7 +2951,7 @@ uma_zone_set_max(uma_zone_t zone, int ni keg->uk_maxpages = (nitems / keg->uk_ipers) * keg->uk_ppera; if (keg->uk_maxpages * keg->uk_ipers < nitems) keg->uk_maxpages += keg->uk_ppera; - nitems = keg->uk_maxpages * keg->uk_ipers; + nitems = (keg->uk_maxpages / keg->uk_ppera) * keg->uk_ipers; KEG_UNLOCK(keg); return (nitems); @@ -2967,7 +2968,7 @@ uma_zone_get_max(uma_zone_t zone) if (keg == NULL) return (0); KEG_LOCK(keg); - nitems = keg->uk_maxpages * keg->uk_ipers; + nitems = (keg->uk_maxpages / keg->uk_ppera) * keg->uk_ipers; KEG_UNLOCK(keg); return (nitems); @@ -3118,13 +3119,14 @@ uma_zone_reserve_kva(uma_zone_t zone, in if (pages * keg->uk_ipers < count) pages++; + pages *= keg->uk_ppera; #ifdef UMA_MD_SMALL_ALLOC if (keg->uk_ppera > 1) { #else if (1) { #endif - kva = kva_alloc((vm_size_t)pages * UMA_SLAB_SIZE); + kva = kva_alloc((vm_size_t)pages * PAGE_SIZE); if (kva == 0) return (0); } else @@ -3344,8 +3346,8 @@ uma_print_keg(uma_keg_t keg) "out %d free %d limit %d\n", keg->uk_name, keg, keg->uk_size, keg->uk_rsize, keg->uk_flags, keg->uk_ipers, keg->uk_ppera, - (keg->uk_ipers * keg->uk_pages) - keg->uk_free, keg->uk_free, - (keg->uk_maxpages / keg->uk_ppera) * keg->uk_ipers); + (keg->uk_pages / keg->uk_ppera) * keg->uk_ipers - keg->uk_free, + keg->uk_free, (keg->uk_maxpages / keg->uk_ppera) * keg->uk_ipers); printf("Part slabs:\n"); LIST_FOREACH(slab, &keg->uk_part_slab, us_link) slab_print(slab); From owner-svn-src-all@freebsd.org Fri Apr 14 14:44:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29D6ED3D420; Fri, 14 Apr 2017 14:44:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD465D84; Fri, 14 Apr 2017 14:44:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEi0vO074688; Fri, 14 Apr 2017 14:44:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEi0sB074684; Fri, 14 Apr 2017 14:44:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141444.v3EEi0sB074684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316840 - in stable/11/sys: kern sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:44:02 -0000 Author: avg Date: Fri Apr 14 14:44:00 2017 New Revision: 316840 URL: https://svnweb.freebsd.org/changeset/base/316840 Log: MFC r315851: move thread switch tracing from mi_switch to sched_switch Modified: stable/11/sys/kern/kern_synch.c stable/11/sys/kern/sched_4bsd.c stable/11/sys/kern/sched_ule.c stable/11/sys/sys/proc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_synch.c ============================================================================== --- stable/11/sys/kern/kern_synch.c Fri Apr 14 14:41:31 2017 (r316839) +++ stable/11/sys/kern/kern_synch.c Fri Apr 14 14:44:00 2017 (r316840) @@ -66,13 +66,6 @@ __FBSDID("$FreeBSD$"); #include -#define KTDSTATE(td) \ - (((td)->td_inhibitors & TDI_SLEEPING) != 0 ? "sleep" : \ - ((td)->td_inhibitors & TDI_SUSPENDED) != 0 ? "suspended" : \ - ((td)->td_inhibitors & TDI_SWAPPED) != 0 ? "swapped" : \ - ((td)->td_inhibitors & TDI_LOCK) != 0 ? "blocked" : \ - ((td)->td_inhibitors & TDI_IWAIT) != 0 ? "iwait" : "yielding") - static void synch_setup(void *dummy); SYSINIT(synch_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, synch_setup, NULL); @@ -437,20 +430,8 @@ mi_switch(int flags, struct thread *newt PCPU_SET(switchticks, ticks); CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name); -#if (KTR_COMPILE & KTR_SCHED) != 0 - if (TD_IS_IDLETHREAD(td)) - KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "idle", - "prio:%d", td->td_priority); - else - KTR_STATE3(KTR_SCHED, "thread", sched_tdname(td), KTDSTATE(td), - "prio:%d", td->td_priority, "wmesg:\"%s\"", td->td_wmesg, - "lockname:\"%s\"", td->td_lockname); -#endif SDT_PROBE0(sched, , , preempt); sched_switch(td, newtd, flags); - KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", - "prio:%d", td->td_priority); - CTR4(KTR_PROC, "mi_switch: new thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name); Modified: stable/11/sys/kern/sched_4bsd.c ============================================================================== --- stable/11/sys/kern/sched_4bsd.c Fri Apr 14 14:41:31 2017 (r316839) +++ stable/11/sys/kern/sched_4bsd.c Fri Apr 14 14:44:00 2017 (r316840) @@ -1013,6 +1013,16 @@ sched_switch(struct thread *td, struct t MPASS(newtd->td_lock == &sched_lock); } +#if (KTR_COMPILE & KTR_SCHED) != 0 + if (TD_IS_IDLETHREAD(td)) + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "idle", + "prio:%d", td->td_priority); + else + KTR_STATE3(KTR_SCHED, "thread", sched_tdname(td), KTDSTATE(td), + "prio:%d", td->td_priority, "wmesg:\"%s\"", td->td_wmesg, + "lockname:\"%s\"", td->td_lockname); +#endif + if (td != newtd) { #ifdef HWPMC_HOOKS if (PMC_PROC_IS_USING_PMCS(td->td_proc)) @@ -1061,6 +1071,9 @@ sched_switch(struct thread *td, struct t } else SDT_PROBE0(sched, , , remain__cpu); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", + "prio:%d", td->td_priority); + #ifdef SMP if (td->td_flags & TDF_IDLETD) CPU_SET(PCPU_GET(cpuid), &idle_cpus_mask); Modified: stable/11/sys/kern/sched_ule.c ============================================================================== --- stable/11/sys/kern/sched_ule.c Fri Apr 14 14:41:31 2017 (r316839) +++ stable/11/sys/kern/sched_ule.c Fri Apr 14 14:44:00 2017 (r316840) @@ -1938,6 +1938,17 @@ sched_switch(struct thread *td, struct t mtx = thread_lock_block(td); tdq_load_rem(tdq, td); } + +#if (KTR_COMPILE & KTR_SCHED) != 0 + if (TD_IS_IDLETHREAD(td)) + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "idle", + "prio:%d", td->td_priority); + else + KTR_STATE3(KTR_SCHED, "thread", sched_tdname(td), KTDSTATE(td), + "prio:%d", td->td_priority, "wmesg:\"%s\"", td->td_wmesg, + "lockname:\"%s\"", td->td_lockname); +#endif + /* * We enter here with the thread blocked and assigned to the * appropriate cpu run-queue or sleep-queue and with the current @@ -1988,6 +1999,10 @@ sched_switch(struct thread *td, struct t thread_unblock_switch(td, mtx); SDT_PROBE0(sched, , , remain__cpu); } + + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", + "prio:%d", td->td_priority); + /* * Assert that all went well and return. */ Modified: stable/11/sys/sys/proc.h ============================================================================== --- stable/11/sys/sys/proc.h Fri Apr 14 14:41:31 2017 (r316839) +++ stable/11/sys/sys/proc.h Fri Apr 14 14:44:00 2017 (r316840) @@ -487,6 +487,12 @@ do { \ #define TD_ON_UPILOCK(td) ((td)->td_flags & TDF_UPIBLOCKED) #define TD_IS_IDLETHREAD(td) ((td)->td_flags & TDF_IDLETD) +#define KTDSTATE(td) \ + (((td)->td_inhibitors & TDI_SLEEPING) != 0 ? "sleep" : \ + ((td)->td_inhibitors & TDI_SUSPENDED) != 0 ? "suspended" : \ + ((td)->td_inhibitors & TDI_SWAPPED) != 0 ? "swapped" : \ + ((td)->td_inhibitors & TDI_LOCK) != 0 ? "blocked" : \ + ((td)->td_inhibitors & TDI_IWAIT) != 0 ? "iwait" : "yielding") #define TD_SET_INHIB(td, inhib) do { \ (td)->td_state = TDS_INHIBITED; \ From owner-svn-src-all@freebsd.org Fri Apr 14 14:44:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF253D3D43E; Fri, 14 Apr 2017 14:44:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70B0DDA9; Fri, 14 Apr 2017 14:44:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEi64F074739; Fri, 14 Apr 2017 14:44:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEi6fs074734; Fri, 14 Apr 2017 14:44:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141444.v3EEi6fs074734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316841 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:44:07 -0000 Author: avg Date: Fri Apr 14 14:44:06 2017 New Revision: 316841 URL: https://svnweb.freebsd.org/changeset/base/316841 Log: MFC r315851: move thread switch tracing from mi_switch to sched_switch Modified: stable/10/sys/kern/kern_synch.c stable/10/sys/kern/sched_4bsd.c stable/10/sys/kern/sched_ule.c stable/10/sys/sys/proc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_synch.c ============================================================================== --- stable/10/sys/kern/kern_synch.c Fri Apr 14 14:44:00 2017 (r316840) +++ stable/10/sys/kern/kern_synch.c Fri Apr 14 14:44:06 2017 (r316841) @@ -73,13 +73,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#define KTDSTATE(td) \ - (((td)->td_inhibitors & TDI_SLEEPING) != 0 ? "sleep" : \ - ((td)->td_inhibitors & TDI_SUSPENDED) != 0 ? "suspended" : \ - ((td)->td_inhibitors & TDI_SWAPPED) != 0 ? "swapped" : \ - ((td)->td_inhibitors & TDI_LOCK) != 0 ? "blocked" : \ - ((td)->td_inhibitors & TDI_IWAIT) != 0 ? "iwait" : "yielding") - static void synch_setup(void *dummy); SYSINIT(synch_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, synch_setup, NULL); @@ -469,23 +462,11 @@ mi_switch(int flags, struct thread *newt PCPU_SET(switchticks, ticks); CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td->td_sched, td->td_proc->p_pid, td->td_name); -#if (KTR_COMPILE & KTR_SCHED) != 0 - if (TD_IS_IDLETHREAD(td)) - KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "idle", - "prio:%d", td->td_priority); - else - KTR_STATE3(KTR_SCHED, "thread", sched_tdname(td), KTDSTATE(td), - "prio:%d", td->td_priority, "wmesg:\"%s\"", td->td_wmesg, - "lockname:\"%s\"", td->td_lockname); -#endif SDT_PROBE0(sched, , , preempt); #ifdef XEN PT_UPDATES_FLUSH(); #endif sched_switch(td, newtd, flags); - KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", - "prio:%d", td->td_priority); - CTR4(KTR_PROC, "mi_switch: new thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td->td_sched, td->td_proc->p_pid, td->td_name); Modified: stable/10/sys/kern/sched_4bsd.c ============================================================================== --- stable/10/sys/kern/sched_4bsd.c Fri Apr 14 14:44:00 2017 (r316840) +++ stable/10/sys/kern/sched_4bsd.c Fri Apr 14 14:44:06 2017 (r316841) @@ -1008,6 +1008,16 @@ sched_switch(struct thread *td, struct t MPASS(newtd->td_lock == &sched_lock); } +#if (KTR_COMPILE & KTR_SCHED) != 0 + if (TD_IS_IDLETHREAD(td)) + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "idle", + "prio:%d", td->td_priority); + else + KTR_STATE3(KTR_SCHED, "thread", sched_tdname(td), KTDSTATE(td), + "prio:%d", td->td_priority, "wmesg:\"%s\"", td->td_wmesg, + "lockname:\"%s\"", td->td_lockname); +#endif + if (td != newtd) { #ifdef HWPMC_HOOKS if (PMC_PROC_IS_USING_PMCS(td->td_proc)) @@ -1056,6 +1066,9 @@ sched_switch(struct thread *td, struct t } else SDT_PROBE0(sched, , , remain__cpu); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", + "prio:%d", td->td_priority); + #ifdef SMP if (td->td_flags & TDF_IDLETD) CPU_SET(PCPU_GET(cpuid), &idle_cpus_mask); Modified: stable/10/sys/kern/sched_ule.c ============================================================================== --- stable/10/sys/kern/sched_ule.c Fri Apr 14 14:44:00 2017 (r316840) +++ stable/10/sys/kern/sched_ule.c Fri Apr 14 14:44:06 2017 (r316841) @@ -1906,6 +1906,17 @@ sched_switch(struct thread *td, struct t mtx = thread_lock_block(td); tdq_load_rem(tdq, td); } + +#if (KTR_COMPILE & KTR_SCHED) != 0 + if (TD_IS_IDLETHREAD(td)) + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "idle", + "prio:%d", td->td_priority); + else + KTR_STATE3(KTR_SCHED, "thread", sched_tdname(td), KTDSTATE(td), + "prio:%d", td->td_priority, "wmesg:\"%s\"", td->td_wmesg, + "lockname:\"%s\"", td->td_lockname); +#endif + /* * We enter here with the thread blocked and assigned to the * appropriate cpu run-queue or sleep-queue and with the current @@ -1956,6 +1967,10 @@ sched_switch(struct thread *td, struct t thread_unblock_switch(td, mtx); SDT_PROBE0(sched, , , remain__cpu); } + + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", + "prio:%d", td->td_priority); + /* * Assert that all went well and return. */ Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Fri Apr 14 14:44:00 2017 (r316840) +++ stable/10/sys/sys/proc.h Fri Apr 14 14:44:06 2017 (r316841) @@ -461,6 +461,12 @@ do { \ #define TD_ON_UPILOCK(td) ((td)->td_flags & TDF_UPIBLOCKED) #define TD_IS_IDLETHREAD(td) ((td)->td_flags & TDF_IDLETD) +#define KTDSTATE(td) \ + (((td)->td_inhibitors & TDI_SLEEPING) != 0 ? "sleep" : \ + ((td)->td_inhibitors & TDI_SUSPENDED) != 0 ? "suspended" : \ + ((td)->td_inhibitors & TDI_SWAPPED) != 0 ? "swapped" : \ + ((td)->td_inhibitors & TDI_LOCK) != 0 ? "blocked" : \ + ((td)->td_inhibitors & TDI_IWAIT) != 0 ? "iwait" : "yielding") #define TD_SET_INHIB(td, inhib) do { \ (td)->td_state = TDS_INHIBITED; \ From owner-svn-src-all@freebsd.org Fri Apr 14 14:45:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CB2BD3D53A; Fri, 14 Apr 2017 14:45:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09746A; Fri, 14 Apr 2017 14:45:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEje7Y074858; Fri, 14 Apr 2017 14:45:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEjeN4074857; Fri, 14 Apr 2017 14:45:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141445.v3EEjeN4074857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316842 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:45:41 -0000 Author: avg Date: Fri Apr 14 14:45:39 2017 New Revision: 316842 URL: https://svnweb.freebsd.org/changeset/base/316842 Log: MFC r315960: dtrace sched:::preempt should fire only when there is preemption Modified: stable/11/sys/kern/kern_synch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_synch.c ============================================================================== --- stable/11/sys/kern/kern_synch.c Fri Apr 14 14:44:06 2017 (r316841) +++ stable/11/sys/kern/kern_synch.c Fri Apr 14 14:45:39 2017 (r316842) @@ -430,7 +430,11 @@ mi_switch(int flags, struct thread *newt PCPU_SET(switchticks, ticks); CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name); - SDT_PROBE0(sched, , , preempt); +#ifdef KDTRACE_HOOKS + if ((flags & SW_PREEMPT) != 0 || ((flags & SW_INVOL) != 0 && + (flags & SW_TYPE_MASK) == SWT_NEEDRESCHED)) + SDT_PROBE0(sched, , , preempt); +#endif sched_switch(td, newtd, flags); CTR4(KTR_PROC, "mi_switch: new thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name); From owner-svn-src-all@freebsd.org Fri Apr 14 14:45:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADCBBD3D56F; Fri, 14 Apr 2017 14:45:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F85467; Fri, 14 Apr 2017 14:45:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEjiQX074908; Fri, 14 Apr 2017 14:45:44 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEjibq074907; Fri, 14 Apr 2017 14:45:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141445.v3EEjibq074907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316843 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:45:45 -0000 Author: avg Date: Fri Apr 14 14:45:44 2017 New Revision: 316843 URL: https://svnweb.freebsd.org/changeset/base/316843 Log: MFC r315960: dtrace sched:::preempt should fire only when there is preemption Modified: stable/10/sys/kern/kern_synch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_synch.c ============================================================================== --- stable/10/sys/kern/kern_synch.c Fri Apr 14 14:45:39 2017 (r316842) +++ stable/10/sys/kern/kern_synch.c Fri Apr 14 14:45:44 2017 (r316843) @@ -462,7 +462,11 @@ mi_switch(int flags, struct thread *newt PCPU_SET(switchticks, ticks); CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td->td_sched, td->td_proc->p_pid, td->td_name); - SDT_PROBE0(sched, , , preempt); +#ifdef KDTRACE_HOOKS + if ((flags & SW_PREEMPT) != 0 || ((flags & SW_INVOL) != 0 && + (flags & SW_TYPE_MASK) == SWT_NEEDRESCHED)) + SDT_PROBE0(sched, , , preempt); +#endif #ifdef XEN PT_UPDATES_FLUSH(); #endif From owner-svn-src-all@freebsd.org Fri Apr 14 14:48:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3138AD3D631; Fri, 14 Apr 2017 14:48:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD423325; Fri, 14 Apr 2017 14:48:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EEmuUa075060; Fri, 14 Apr 2017 14:48:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EEmuhk075059; Fri, 14 Apr 2017 14:48:56 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141448.v3EEmuhk075059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 14:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316844 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:48:57 -0000 Author: avg Date: Fri Apr 14 14:48:55 2017 New Revision: 316844 URL: https://svnweb.freebsd.org/changeset/base/316844 Log: MFC r316017,r316020: add SMT detection for newer AMD processors Modified: stable/11/sys/x86/x86/mp_x86.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/mp_x86.c ============================================================================== --- stable/11/sys/x86/x86/mp_x86.c Fri Apr 14 14:45:44 2017 (r316843) +++ stable/11/sys/x86/x86/mp_x86.c Fri Apr 14 14:48:55 2017 (r316844) @@ -226,11 +226,10 @@ add_deterministic_cache(int type, int le * Determine topology of processing units and caches for AMD CPUs. * See: * - AMD CPUID Specification (Publication # 25481) - * - BKDG For AMD Family 10h Processors (Publication # 31116), section 2.15 * - BKDG for AMD NPT Family 0Fh Processors (Publication # 32559) - * XXX At the moment the code does not recognize grouping of AMD CMT threads, - * if supported, into cores, so each thread is treated as being in its own - * core. In other words, each logical CPU is considered to be a core. + * - BKDG For AMD Family 10h Processors (Publication # 31116) + * - BKDG For AMD Family 15h Models 00h-0Fh Processors (Publication # 42301) + * - BKDG For AMD Family 16h Models 00h-0Fh Processors (Publication # 48751) */ static void topo_probe_amd(void) @@ -254,6 +253,22 @@ topo_probe_amd(void) pkg_id_shift = mask_width((cpu_procinfo2 & AMDID_CMP_CORES) + 1); + /* + * Families prior to 16h define the following value as + * cores per compute unit and we don't really care about the AMD + * compute units at the moment. Perhaps we should treat them as + * cores and cores within the compute units as hardware threads, + * but that's up for debate. + * Later families define the value as threads per compute unit, + * so we are following AMD's nomenclature here. + */ + if ((amd_feature2 & AMDID2_TOPOLOGY) != 0 && + CPUID_TO_FAMILY(cpu_id) >= 0x16) { + cpuid_count(0x8000001e, 0, p); + share_count = ((p[1] >> 8) & 0xff) + 1; + core_id_shift = mask_width(share_count); + } + if ((amd_feature2 & AMDID2_TOPOLOGY) != 0) { for (i = 0; ; i++) { cpuid_count(0x8000001d, i, p); From owner-svn-src-all@freebsd.org Fri Apr 14 15:06:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDBC8D3DC7A; Fri, 14 Apr 2017 15:06:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F62ECA; Fri, 14 Apr 2017 15:06:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EF6GH1083384; Fri, 14 Apr 2017 15:06:16 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EF6G7i083383; Fri, 14 Apr 2017 15:06:16 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141506.v3EF6G7i083383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 15:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316845 - stable/11/sys/dev/aacraid X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:06:18 -0000 Author: avg Date: Fri Apr 14 15:06:16 2017 New Revision: 316845 URL: https://svnweb.freebsd.org/changeset/base/316845 Log: MFC r315858: aacraid: rework r315083 for a clean build with and without AACRAID_DEBUG Modified: stable/11/sys/dev/aacraid/aacraid_cam.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/aacraid/aacraid_cam.c ============================================================================== --- stable/11/sys/dev/aacraid/aacraid_cam.c Fri Apr 14 14:48:55 2017 (r316844) +++ stable/11/sys/dev/aacraid/aacraid_cam.c Fri Apr 14 15:06:16 2017 (r316845) @@ -243,13 +243,11 @@ static int aac_cam_probe(device_t dev) { struct aac_cam *camsc; - struct aac_softc *sc; camsc = (struct aac_cam *)device_get_softc(dev); if (!camsc->inf) return (0); - sc = camsc->inf->aac_sc; - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + fwprintf(camsc->inf->aac_sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); return (0); } @@ -1136,11 +1134,9 @@ static void aac_container_complete(struct aac_command *cm) { union ccb *ccb; - struct aac_softc *sc; u_int32_t status; - sc = cm->cm_sc; - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + fwprintf(cm->cm_sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); ccb = cm->cm_ccb; status = ((u_int32_t *)cm->cm_fib->data)[0]; From owner-svn-src-all@freebsd.org Fri Apr 14 15:06:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D894D3DCBD; Fri, 14 Apr 2017 15:06:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49EB2F5; Fri, 14 Apr 2017 15:06:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EF6M1x083433; Fri, 14 Apr 2017 15:06:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EF6M1G083432; Fri, 14 Apr 2017 15:06:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141506.v3EF6M1G083432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 15:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316846 - stable/10/sys/dev/aacraid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:06:23 -0000 Author: avg Date: Fri Apr 14 15:06:22 2017 New Revision: 316846 URL: https://svnweb.freebsd.org/changeset/base/316846 Log: MFC r315858: aacraid: rework r315083 for a clean build with and without AACRAID_DEBUG Modified: stable/10/sys/dev/aacraid/aacraid_cam.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/aacraid/aacraid_cam.c ============================================================================== --- stable/10/sys/dev/aacraid/aacraid_cam.c Fri Apr 14 15:06:16 2017 (r316845) +++ stable/10/sys/dev/aacraid/aacraid_cam.c Fri Apr 14 15:06:22 2017 (r316846) @@ -248,8 +248,7 @@ aac_cam_probe(device_t dev) camsc = (struct aac_cam *)device_get_softc(dev); if (!camsc->inf) return (0); - sc = camsc->inf->aac_sc; - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + fwprintf(camsc->inf->aac_sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); return (0); } @@ -1139,8 +1138,7 @@ aac_container_complete(struct aac_comman union ccb *ccb; u_int32_t status; - sc = cm->cm_sc; - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + fwprintf(cm->cm_sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); ccb = cm->cm_ccb; status = ((u_int32_t *)cm->cm_fib->data)[0]; From owner-svn-src-all@freebsd.org Fri Apr 14 15:07:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BCC5D3DDE5; Fri, 14 Apr 2017 15:07:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEF04674; Fri, 14 Apr 2017 15:07:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EF7pHj083713; Fri, 14 Apr 2017 15:07:51 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EF7pXf083712; Fri, 14 Apr 2017 15:07:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141507.v3EF7pXf083712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 15:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316847 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:07:52 -0000 Author: avg Date: Fri Apr 14 15:07:50 2017 New Revision: 316847 URL: https://svnweb.freebsd.org/changeset/base/316847 Log: MFC r315853: zfs_putpages: use TXG_WAIT Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 15:06:22 2017 (r316846) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 15:07:50 2017 (r316847) @@ -4716,19 +4716,13 @@ zfs_putpages(struct vnode *vp, vm_page_t goto out; } -top: tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_write(tx, zp->z_id, off, len); dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE); zfs_sa_upgrade_txholds(tx, zp); - err = dmu_tx_assign(tx, TXG_NOWAIT); + err = dmu_tx_assign(tx, TXG_WAIT); if (err != 0) { - if (err == ERESTART) { - dmu_tx_wait(tx); - dmu_tx_abort(tx); - goto top; - } dmu_tx_abort(tx); goto out; } From owner-svn-src-all@freebsd.org Fri Apr 14 15:07:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7FA0D3DE1D; Fri, 14 Apr 2017 15:07:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A66706A0; Fri, 14 Apr 2017 15:07:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EF7tkV083764; Fri, 14 Apr 2017 15:07:55 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EF7tg1083763; Fri, 14 Apr 2017 15:07:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141507.v3EF7tg1083763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 15:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316848 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:07:57 -0000 Author: avg Date: Fri Apr 14 15:07:55 2017 New Revision: 316848 URL: https://svnweb.freebsd.org/changeset/base/316848 Log: MFC r315853: zfs_putpages: use TXG_WAIT Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 15:07:50 2017 (r316847) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 15:07:55 2017 (r316848) @@ -4760,19 +4760,13 @@ zfs_putpages(struct vnode *vp, vm_page_t goto out; } -top: tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_write(tx, zp->z_id, off, len); dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE); zfs_sa_upgrade_txholds(tx, zp); - err = dmu_tx_assign(tx, TXG_NOWAIT); + err = dmu_tx_assign(tx, TXG_WAIT); if (err != 0) { - if (err == ERESTART) { - dmu_tx_wait(tx); - dmu_tx_abort(tx); - goto top; - } dmu_tx_abort(tx); goto out; } From owner-svn-src-all@freebsd.org Fri Apr 14 15:09:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DA19D3DED6; Fri, 14 Apr 2017 15:09:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF0DD95D; Fri, 14 Apr 2017 15:09:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EF9OOc083889; Fri, 14 Apr 2017 15:09:24 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EF9NR6083885; Fri, 14 Apr 2017 15:09:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141509.v3EF9NR6083885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 15:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316849 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:09:25 -0000 Author: avg Date: Fri Apr 14 15:09:23 2017 New Revision: 316849 URL: https://svnweb.freebsd.org/changeset/base/316849 Log: MFC r315852: zfs: add zio_buf_alloc_nowait and use it in vdev_queue_aggregate Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Apr 14 15:07:55 2017 (r316848) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Apr 14 15:09:23 2017 (r316849) @@ -566,6 +566,7 @@ extern zio_t *zio_unique_parent(zio_t *c extern void zio_add_child(zio_t *pio, zio_t *cio); extern void *zio_buf_alloc(size_t size); +extern void *zio_buf_alloc_nowait(size_t size); extern void zio_buf_free(void *buf, size_t size); extern void *zio_data_buf_alloc(size_t size); extern void zio_data_buf_free(void *buf, size_t size); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Apr 14 15:07:55 2017 (r316848) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Apr 14 15:09:23 2017 (r316849) @@ -647,6 +647,7 @@ static zio_t * vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio) { zio_t *first, *last, *aio, *dio, *mandatory, *nio; + void *abuf; uint64_t maxgap = 0; uint64_t size; boolean_t stretch; @@ -755,8 +756,12 @@ vdev_queue_aggregate(vdev_queue_t *vq, z size = IO_SPAN(first, last); ASSERT3U(size, <=, zfs_vdev_aggregation_limit); + abuf = zio_buf_alloc_nowait(size); + if (abuf == NULL) + return (NULL); + aio = zio_vdev_delegated_io(first->io_vd, first->io_offset, - zio_buf_alloc(size), size, first->io_type, zio->io_priority, + abuf, size, first->io_type, zio->io_priority, flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE, vdev_queue_agg_io_done, NULL); aio->io_timestamp = first->io_timestamp; Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Apr 14 15:07:55 2017 (r316848) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Apr 14 15:09:23 2017 (r316849) @@ -272,18 +272,33 @@ zio_fini(void) * useful to inspect ZFS metadata, but if possible, we should avoid keeping * excess / transient data in-core during a crashdump. */ -void * -zio_buf_alloc(size_t size) +static void * +zio_buf_alloc_impl(size_t size, boolean_t canwait) { size_t c = (size - 1) >> SPA_MINBLOCKSHIFT; int flags = zio_exclude_metadata ? KM_NODEBUG : 0; VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); - if (zio_use_uma) - return (kmem_cache_alloc(zio_buf_cache[c], KM_PUSHPAGE)); - else - return (kmem_alloc(size, KM_SLEEP|flags)); + if (zio_use_uma) { + return (kmem_cache_alloc(zio_buf_cache[c], + canwait ? KM_PUSHPAGE : KM_NOSLEEP)); + } else { + return (kmem_alloc(size, + (canwait ? KM_SLEEP : KM_NOSLEEP) | flags)); + } +} + +void * +zio_buf_alloc(size_t size) +{ + return (zio_buf_alloc_impl(size, B_TRUE)); +} + +void * +zio_buf_alloc_nowait(size_t size) +{ + return (zio_buf_alloc_impl(size, B_FALSE)); } /* From owner-svn-src-all@freebsd.org Fri Apr 14 15:09:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1A6D3DF2A; Fri, 14 Apr 2017 15:09:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A78009A4; Fri, 14 Apr 2017 15:09:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EF9UFs083942; Fri, 14 Apr 2017 15:09:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EF9UcJ083939; Fri, 14 Apr 2017 15:09:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141509.v3EF9UcJ083939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 15:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316850 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:09:31 -0000 Author: avg Date: Fri Apr 14 15:09:30 2017 New Revision: 316850 URL: https://svnweb.freebsd.org/changeset/base/316850 Log: MFC r315852: zfs: add zio_buf_alloc_nowait and use it in vdev_queue_aggregate Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Apr 14 15:09:23 2017 (r316849) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Apr 14 15:09:30 2017 (r316850) @@ -566,6 +566,7 @@ extern zio_t *zio_unique_parent(zio_t *c extern void zio_add_child(zio_t *pio, zio_t *cio); extern void *zio_buf_alloc(size_t size); +extern void *zio_buf_alloc_nowait(size_t size); extern void zio_buf_free(void *buf, size_t size); extern void *zio_data_buf_alloc(size_t size); extern void zio_data_buf_free(void *buf, size_t size); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Apr 14 15:09:23 2017 (r316849) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Apr 14 15:09:30 2017 (r316850) @@ -659,6 +659,7 @@ static zio_t * vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio) { zio_t *first, *last, *aio, *dio, *mandatory, *nio; + void *abuf; uint64_t maxgap = 0; uint64_t size; boolean_t stretch; @@ -767,8 +768,12 @@ vdev_queue_aggregate(vdev_queue_t *vq, z size = IO_SPAN(first, last); ASSERT3U(size, <=, zfs_vdev_aggregation_limit); + abuf = zio_buf_alloc_nowait(size); + if (abuf == NULL) + return (NULL); + aio = zio_vdev_delegated_io(first->io_vd, first->io_offset, - zio_buf_alloc(size), size, first->io_type, zio->io_priority, + abuf, size, first->io_type, zio->io_priority, flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE, vdev_queue_agg_io_done, NULL); aio->io_timestamp = first->io_timestamp; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Apr 14 15:09:23 2017 (r316849) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Apr 14 15:09:30 2017 (r316850) @@ -277,18 +277,33 @@ zio_fini(void) * useful to inspect ZFS metadata, but if possible, we should avoid keeping * excess / transient data in-core during a crashdump. */ -void * -zio_buf_alloc(size_t size) +static void * +zio_buf_alloc_impl(size_t size, boolean_t canwait) { size_t c = (size - 1) >> SPA_MINBLOCKSHIFT; int flags = zio_exclude_metadata ? KM_NODEBUG : 0; VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); - if (zio_use_uma) - return (kmem_cache_alloc(zio_buf_cache[c], KM_PUSHPAGE)); - else - return (kmem_alloc(size, KM_SLEEP|flags)); + if (zio_use_uma) { + return (kmem_cache_alloc(zio_buf_cache[c], + canwait ? KM_PUSHPAGE : KM_NOSLEEP)); + } else { + return (kmem_alloc(size, + (canwait ? KM_SLEEP : KM_NOSLEEP) | flags)); + } +} + +void * +zio_buf_alloc(size_t size) +{ + return (zio_buf_alloc_impl(size, B_TRUE)); +} + +void * +zio_buf_alloc_nowait(size_t size) +{ + return (zio_buf_alloc_impl(size, B_FALSE)); } /* From owner-svn-src-all@freebsd.org Fri Apr 14 15:16:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 426CBD3D245; Fri, 14 Apr 2017 15:16:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12134FA6; Fri, 14 Apr 2017 15:16:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EFGgxM087766; Fri, 14 Apr 2017 15:16:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EFGgK9087765; Fri, 14 Apr 2017 15:16:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704141516.v3EFGgK9087765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 14 Apr 2017 15:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316851 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:16:43 -0000 Author: kib Date: Fri Apr 14 15:16:41 2017 New Revision: 316851 URL: https://svnweb.freebsd.org/changeset/base/316851 Log: Correct calculation of the entry->free_down in the invariants-checking code. Reported by: maxim Found by: PVS studio scan Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/intel_gas.c Modified: head/sys/x86/iommu/intel_gas.c ============================================================================== --- head/sys/x86/iommu/intel_gas.c Fri Apr 14 15:09:30 2017 (r316850) +++ head/sys/x86/iommu/intel_gas.c Fri Apr 14 15:16:41 2017 (r316851) @@ -198,7 +198,7 @@ dmar_gas_check_free(struct dmar_domain * l->free_down)); } else { v = MAX(entry->free_after, l->free_down); - v = MAX(entry->free_down, r->free_down); + v = MAX(v, r->free_down); MPASS(entry->free_down == v); } } From owner-svn-src-all@freebsd.org Fri Apr 14 15:22:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2442AD3D505; Fri, 14 Apr 2017 15:22:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E57EA784; Fri, 14 Apr 2017 15:22:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EFM0of092172; Fri, 14 Apr 2017 15:22:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EFM09u092171; Fri, 14 Apr 2017 15:22:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704141522.v3EFM09u092171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 14 Apr 2017 15:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316852 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:22:02 -0000 Author: kib Date: Fri Apr 14 15:22:00 2017 New Revision: 316852 URL: https://svnweb.freebsd.org/changeset/base/316852 Log: In fsck_ffs pass1, prevent the inosused variable from wrapping. The loop that scans the used inode map when soft updates is in use assumes that the inosused variable is signed. However, ino_t is unsigned, so the loop invariant is incorrect and the check for inosused wrapping to < 0 can never be true. Instead of checking for wrap after the fact just prevent it from happening in the first place. PR: 218592 Submitted by: Todd Miller Reviewed by: mckusick MFC after: 1 week Modified: head/sbin/fsck_ffs/pass1.c Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Fri Apr 14 15:16:41 2017 (r316851) +++ head/sbin/fsck_ffs/pass1.c Fri Apr 14 15:22:00 2017 (r316852) @@ -133,9 +133,14 @@ pass1(void) */ if ((preen || inoopt) && usedsoftdep && !rebuildcg) { cp = &cg_inosused(cgp)[(inosused - 1) / CHAR_BIT]; - for ( ; inosused > 0; inosused -= CHAR_BIT, cp--) { - if (*cp == 0) + for ( ; inosused != 0; cp--) { + if (*cp == 0) { + if (inosused > CHAR_BIT) + inosused -= CHAR_BIT; + else + inosused = 0; continue; + } for (i = 1 << (CHAR_BIT - 1); i > 0; i >>= 1) { if (*cp & i) break; @@ -143,8 +148,6 @@ pass1(void) } break; } - if (inosused < 0) - inosused = 0; } /* * Allocate inoinfo structures for the allocated inodes. From owner-svn-src-all@freebsd.org Fri Apr 14 15:31:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EE51D3D91E; Fri, 14 Apr 2017 15:31:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20A07DF3; Fri, 14 Apr 2017 15:31:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EFV4H0093448; Fri, 14 Apr 2017 15:31:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EFV4EZ093447; Fri, 14 Apr 2017 15:31:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141531.v3EFV4EZ093447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 15:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316853 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:31:05 -0000 Author: avg Date: Fri Apr 14 15:31:04 2017 New Revision: 316853 URL: https://svnweb.freebsd.org/changeset/base/316853 Log: dtrace: fix normalization of stddev aggregation To be upstreamed. Discussed with: Bryan Cantrill MFC after: 2 weeks Sponsored by: Panzura Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Fri Apr 14 15:22:00 2017 (r316852) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Fri Apr 14 15:31:04 2017 (r316853) @@ -389,8 +389,10 @@ dt_stddev(uint64_t *data, uint64_t norma * The standard approximation for standard deviation is * sqrt(average(x**2) - average(x)**2), i.e. the square root * of the average of the squares minus the square of the average. + * When normalizing, we should divide the sum of x**2 by normal**2. */ dt_divide_128(data + 2, normal, avg_of_squares); + dt_divide_128(avg_of_squares, normal, avg_of_squares); dt_divide_128(avg_of_squares, data[0], avg_of_squares); norm_avg = (int64_t)data[1] / (int64_t)normal / (int64_t)data[0]; From owner-svn-src-all@freebsd.org Fri Apr 14 15:32:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74EEFD3DBCD; Fri, 14 Apr 2017 15:32:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com [209.85.128.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14F111193; Fri, 14 Apr 2017 15:32:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wr0-f170.google.com with SMTP id c55so52602443wrc.3; Fri, 14 Apr 2017 08:32:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=NcItDyFqITnWjbEYmgvYUg2HtgxFjs08oe1Fib1gP8k=; b=aen8Nff4ZQIzz8Yy8jA2ZV4VMzf9zcDiObde+r9rm2yhBVhQ4gMQnSZgLJTm/i2+0X 23WqjZCldhkNyhGTwqOMCt57cAE/ADWIX6AKKUDwz2B88BoSzCiL/vdP5a3u4OIYAgtu z3bPlOec68Ai1UtDuyJ2CValsb/Rubcwuo0Xz9xnuMBcLGgCit7obdTBpvGD1igG1AlP Om7fuTtcZSe+vtGBShfYcSkIQlrfsmHAOA4T23ZPx6RW7sk9L8c4IRliv6vLoP4otoNR T73irsYuWFS1UcEGBPKfdVNq2jC7r7ZmIk7dMmqiKDLoG3aiDGEXZzbwenanEp4fY7hN BwCA== X-Gm-Message-State: AN3rC/7MPdfQUevvEQOH+tjlrfqpfu9yhnM5k+gJSqrYbEgUAZhuxy5a mdyucmCFf6c8MlMJyzkh9Q== X-Received: by 10.223.166.9 with SMTP id k9mr8049963wrc.177.1492183954925; Fri, 14 Apr 2017 08:32:34 -0700 (PDT) Received: from mail-wr0-f171.google.com (mail-wr0-f171.google.com. [209.85.128.171]) by smtp.gmail.com with ESMTPSA id n198sm3133528wmd.30.2017.04.14.08.32.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 08:32:34 -0700 (PDT) Received: by mail-wr0-f171.google.com with SMTP id l28so52549459wre.0; Fri, 14 Apr 2017 08:32:34 -0700 (PDT) X-Received: by 10.223.181.132 with SMTP id c4mr525428wre.178.1492183954681; Fri, 14 Apr 2017 08:32:34 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Fri, 14 Apr 2017 08:32:34 -0700 (PDT) In-Reply-To: <201704141158.v3EBwfLm003147@repo.freebsd.org> References: <201704141158.v3EBwfLm003147@repo.freebsd.org> From: Conrad Meyer Date: Fri, 14 Apr 2017 08:32:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316826 - head/sys/netpfil/ipfw/nat64 To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:32:43 -0000 On Fri, Apr 14, 2017 at 4:58 AM, Andrey V. Elsukov wrote: > Author: ae > Date: Fri Apr 14 11:58:41 2017 > New Revision: 316826 > URL: https://svnweb.freebsd.org/changeset/base/316826 > > Log: > Avoid undefined behavior. > > The 'pktid' variable is modified while being used twice between > sequence points, probably due to htonl() is macro. FYI =E2=80=94 there are a ton of similar reports in sys/rpc due to the XDR macros (which read a network value off a pointer and increment it). See e.g., IXDR_GET_UINT32() macro. Best, Conrad From owner-svn-src-all@freebsd.org Fri Apr 14 15:35:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA843D3DC78; Fri, 14 Apr 2017 15:35:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 743B31373; Fri, 14 Apr 2017 15:35:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EFZ7tE096443; Fri, 14 Apr 2017 15:35:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EFZ7BY096442; Fri, 14 Apr 2017 15:35:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141535.v3EFZ7BY096442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 15:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316854 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:35:08 -0000 Author: avg Date: Fri Apr 14 15:35:07 2017 New Revision: 316854 URL: https://svnweb.freebsd.org/changeset/base/316854 Log: rename vfs.zfs.debug_flags to vfs.zfs.debugflags While the former name is easier to read, the "_flags" suffix has a special meaning for loader(8) and, thus, it was impossible to set the knob via loader.conf(5). The loader interpreted the setting as flags that should be passed to a kernel module named "vfs.zfs.debug". Discussed with: smh MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Apr 14 15:31:04 2017 (r316853) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Apr 14 15:35:07 2017 (r316854) @@ -353,7 +353,7 @@ sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLE return (0); } -SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debugflags, CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); From owner-svn-src-all@freebsd.org Fri Apr 14 15:49:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FA24D3D0FA; Fri, 14 Apr 2017 15:49:15 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B464A1C55; Fri, 14 Apr 2017 15:49:14 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wr0-f176.google.com with SMTP id l28so52746212wre.0; Fri, 14 Apr 2017 08:49:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=f9Es0/dLKhDQ7Fu/1RotCHOYaUCZ3XIEB742ihaoBVI=; b=L7OC3blNnQ7w2nx3KPX6tWp7livQWU6k44Is48oKoFmH4rPwZEKeDyM6R3ay3LV7Rk yqSua79qe2r72sZAcIXyhQYd1eBAjwg1AdHzN7A3CsZJaCbr+jgs1oK5L2oVR+hp4xyc sNWBkDtclVNxuly8E65hCmoa2AgVcCulc3u2npby4v1iwCakoIMzWHAzk9oJ6bgu4EAO dq8RgLOXPsA8HB6zxNgJ6z3aCM+s+pw2dS8zVgpkPiEXEyy5wI5rHIMYDCNyFknK++JB 8ZxhFtkap/mAGLjyNqKEmP19mwVcVDQ3pvJlVuSfNu8xN758e9vyDdujSY1nl8GGz1BU 9WKQ== X-Gm-Message-State: AN3rC/6DUZhsVygAMSjZCZeeo5cHpkmiFJXjafURFZ7EHT9+TV1E002z ZHFYjhiv3aCBNg== X-Received: by 10.223.182.155 with SMTP id j27mr7594745wre.152.1492184446133; Fri, 14 Apr 2017 08:40:46 -0700 (PDT) Received: from mail-wr0-f181.google.com (mail-wr0-f181.google.com. [209.85.128.181]) by smtp.gmail.com with ESMTPSA id m90sm3155392wmi.34.2017.04.14.08.40.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 08:40:46 -0700 (PDT) Received: by mail-wr0-f181.google.com with SMTP id o21so52725981wrb.2; Fri, 14 Apr 2017 08:40:45 -0700 (PDT) X-Received: by 10.223.181.132 with SMTP id c4mr552425wre.178.1492184445858; Fri, 14 Apr 2017 08:40:45 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Fri, 14 Apr 2017 08:40:45 -0700 (PDT) In-Reply-To: <201704141516.v3EFGgK9087765@repo.freebsd.org> References: <201704141516.v3EFGgK9087765@repo.freebsd.org> From: Conrad Meyer Date: Fri, 14 Apr 2017 08:40:45 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316851 - head/sys/x86/iommu To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:49:15 -0000 On Fri, Apr 14, 2017 at 8:16 AM, Konstantin Belousov wrote: > Author: kib > Date: Fri Apr 14 15:16:41 2017 > New Revision: 316851 > URL: https://svnweb.freebsd.org/changeset/base/316851 > > Log: > Correct calculation of the entry->free_down in the invariants-checking > code. > > Reported by: maxim > Found by: PVS studio scan This was also reported by Coverity in CID 1304880 as an unused value. Coverity also reports a NULL check (l. 547) after all paths have dereferenced the pointer ("next") already in dmar_gas_alloc_region() of the same file (CID 1199386). Best, Conrad From owner-svn-src-all@freebsd.org Fri Apr 14 15:54:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8C8ED3D4F1 for ; Fri, 14 Apr 2017 15:54:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CFB0214 for ; Fri, 14 Apr 2017 15:54:35 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 6e5378af-212a-11e7-8c46-c35e37f62db1 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 6e5378af-212a-11e7-8c46-c35e37f62db1; Fri, 14 Apr 2017 15:52:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v3EFrQfG006295; Fri, 14 Apr 2017 09:53:26 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1492185206.73883.126.camel@freebsd.org> Subject: Re: svn commit: r316826 - head/sys/netpfil/ipfw/nat64 From: Ian Lepore To: cem@freebsd.org, "Andrey V. Elsukov" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 14 Apr 2017 09:53:26 -0600 In-Reply-To: References: <201704141158.v3EBwfLm003147@repo.freebsd.org> Content-Type: text/plain; charset="windows-1251" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:54:35 -0000 On Fri, 2017-04-14 at 08:32 -0700, Conrad Meyer wrote: > On Fri, Apr 14, 2017 at 4:58 AM, Andrey V. Elsukov > wrote: > > > > Author: ae > > Date: Fri Apr 14 11:58:41 2017 > > New Revision: 316826 > > URL: https://svnweb.freebsd.org/changeset/base/316826 > > > > Log: > >   Avoid undefined behavior. > > > >   The 'pktid' variable is modified while being used twice between > >   sequence points, probably due to htonl() is macro. > FYI — there are a ton of similar reports in sys/rpc due to the XDR > macros (which read a network value off a pointer and increment it). > See e.g., IXDR_GET_UINT32() macro. > > Best, > Conrad Aren't they all false positives, since the macros involved are g'teed not to evaluate their arguments more than once as written (because __builtin_constant_p always evaluates at compile time)?  Do we really want to churn our source code to eliminate false positives from some tool that appears to still be in its alpha-testing state? -- Ian From owner-svn-src-all@freebsd.org Fri Apr 14 15:55:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C4ECD3D57F; Fri, 14 Apr 2017 15:55:41 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yb0-x22e.google.com (mail-yb0-x22e.google.com [IPv6:2607:f8b0:4002:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF70E3A7; Fri, 14 Apr 2017 15:55:40 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yb0-x22e.google.com with SMTP id i124so19901835ybc.3; Fri, 14 Apr 2017 08:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=0l92peGyC1c0oC3XKcey8A1obDtlicssyrnmqUeajBQ=; b=W6paLrdJ8vuks2rrB/O1HKPhzSSSHb/a6p/ZLl93X7vTlRI4KNC+zoLbqEdeack55V YNxr0twJnUofwVWQILf1jSMkhDupAJW69V452tyU6Cg2NRAtqnVPNa7RMEYfHpm7dIKn 4+DE48nWGhmXpl7gv6IHh9nw0AujbfvwUPuLuySklmMBM+OtMbZcl0CKU5Gojs2gg9V9 cScHju3SeZmWfMkRlujq6MOFngsz0J8hIYQIKUm49he3cDMCK5+oWw9YRIebpvIGKilb MMaMQx290b2Tdw4ts/5YX58casmPUuCiJ+jA4uRY9s4FV0jAnyk9MTbtTskXChcYOeL8 q+iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=0l92peGyC1c0oC3XKcey8A1obDtlicssyrnmqUeajBQ=; b=Kp+LBqzlJQRMYfudzU/X7TTFkQ2EoyHd086V/JAFn4PWn5sGC1qGSpIRSDdbfRYW0B j+1TE2FDjpHr4gGrJIC1ocyr4LfdXUheFqWVKV66qI2ADJVF2vJlF1QHA6sajhUPFR6B wFRjRXVMGveQEyeLe4audCw6HtBrxCVwC2HySgdRLJidw0WWa7Q8go7kqsmz88raoQ0U EzjZTbX/OLnxy5xv9QBzzy1wv7uVPtKO06T268BdfN+GcPbCWh9TypZajVLG1ZJhM1eI wVFXlZH5iu1xlqTptIlR9CQFkUkZu/NCw8K3ZN5PNFK8sBzD6CwbtTgcuPylaaM/fjnM 5TDA== X-Gm-Message-State: AN3rC/7b3pje9CytmQK7sjejzWR80c9dfbrT1U8jy3spetGiHVSPt1T8 3wvnALN9CAc2WRndyNdN6aoGGF1p4Q== X-Received: by 10.37.171.132 with SMTP id v4mr6800266ybi.9.1492185339833; Fri, 14 Apr 2017 08:55:39 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.20.214 with HTTP; Fri, 14 Apr 2017 08:55:39 -0700 (PDT) In-Reply-To: <201704141535.v3EFZ7BY096442@repo.freebsd.org> References: <201704141535.v3EFZ7BY096442@repo.freebsd.org> From: Alan Somers Date: Fri, 14 Apr 2017 09:55:39 -0600 X-Google-Sender-Auth: qaM-nqDQv4EqBkrcmiFkuTqDOho Message-ID: Subject: Re: svn commit: r316854 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Andriy Gapon Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 15:55:41 -0000 Are you sure it's a good idea to MFC this change? Doing so will upset anybody currently setting that sysctl in /etc/sysctl.conf. On Fri, Apr 14, 2017 at 9:35 AM, Andriy Gapon wrote: > Author: avg > Date: Fri Apr 14 15:35:07 2017 > New Revision: 316854 > URL: https://svnweb.freebsd.org/changeset/base/316854 > > Log: > rename vfs.zfs.debug_flags to vfs.zfs.debugflags > > While the former name is easier to read, the "_flags" suffix has a special > meaning for loader(8) and, thus, it was impossible to set the knob via > loader.conf(5). The loader interpreted the setting as flags that should > be passed to a kernel module named "vfs.zfs.debug". > > Discussed with: smh > MFC after: 2 weeks > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Apr 14 15:31:04 2017 (r316853) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Apr 14 15:35:07 2017 (r316854) > @@ -353,7 +353,7 @@ sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLE > return (0); > } > > -SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, > +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debugflags, > CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), > sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); > > From owner-svn-src-all@freebsd.org Fri Apr 14 16:18:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DC8FD3DC81; Fri, 14 Apr 2017 16:18:54 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FAFB31D; Fri, 14 Apr 2017 16:18:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EGIrwx013531; Fri, 14 Apr 2017 16:18:53 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EGIrNX013530; Fri, 14 Apr 2017 16:18:53 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704141618.v3EGIrNX013530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 14 Apr 2017 16:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316855 - vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:18:54 -0000 Author: asomers Date: Fri Apr 14 16:18:53 2017 New Revision: 316855 URL: https://svnweb.freebsd.org/changeset/base/316855 Log: 7900 zdb shouldn't print the path of a znode at verbosity < 5 Reviewed by: Paul Dagnelie Reviewed by: Matt Ahrens Approved by: Dan McDonald Author: Alan Somers illumos/illumos-gate@e548d2fa41d1baa06662ed9abbb8bcec86e27dd9 https://www.illumos.org/issues/7900 Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 15:35:07 2017 (r316854) +++ vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:18:53 2017 (r316855) @@ -1693,23 +1693,19 @@ dump_znode(objset_t *os, uint64_t object return; } - error = zfs_obj_to_path(os, object, path, sizeof (path)); - if (error != 0) { - (void) snprintf(path, sizeof (path), "\?\?\?", - (u_longlong_t)object); - } - if (dump_opt['d'] < 3) { - (void) printf("\t%s\n", path); - (void) sa_handle_destroy(hdl); - return; - } - z_crtime = (time_t)crtm[0]; z_atime = (time_t)acctm[0]; z_mtime = (time_t)modtm[0]; z_ctime = (time_t)chgtm[0]; - (void) printf("\tpath %s\n", path); + if (dump_opt['d'] > 4) { + error = zfs_obj_to_path(os, object, path, sizeof (path)); + if (error != 0) { + (void) snprintf(path, sizeof (path), + "\?\?\?", (u_longlong_t)object); + } + (void) printf("\tpath %s\n", path); + } dump_uidgid(os, uid, gid); (void) printf("\tatime %s", ctime(&z_atime)); (void) printf("\tmtime %s", ctime(&z_mtime)); From owner-svn-src-all@freebsd.org Fri Apr 14 16:20:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D33B1D3DECB; Fri, 14 Apr 2017 16:20:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 96C4794F; Fri, 14 Apr 2017 16:20:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA09263; Fri, 14 Apr 2017 19:20:48 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1cz3xo-000EYA-3S; Fri, 14 Apr 2017 19:20:48 +0300 Subject: Re: svn commit: r316854 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201704141535.v3EFZ7BY096442@repo.freebsd.org> From: Andriy Gapon Message-ID: Date: Fri, 14 Apr 2017 19:19:26 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:20:56 -0000 On 14/04/2017 18:55, Alan Somers wrote: > Are you sure it's a good idea to MFC this change? Doing so will upset > anybody currently setting that sysctl in /etc/sysctl.conf. Well, this is a debug knob, so I expected that it is tweaked by hand on as needed basis. I don't expect that it is used as a permanent setting. But to err on the side of caution I can add a compatibility sysctl name. > On Fri, Apr 14, 2017 at 9:35 AM, Andriy Gapon wrote: >> Author: avg >> Date: Fri Apr 14 15:35:07 2017 >> New Revision: 316854 >> URL: https://svnweb.freebsd.org/changeset/base/316854 >> >> Log: >> rename vfs.zfs.debug_flags to vfs.zfs.debugflags >> >> While the former name is easier to read, the "_flags" suffix has a special >> meaning for loader(8) and, thus, it was impossible to set the knob via >> loader.conf(5). The loader interpreted the setting as flags that should >> be passed to a kernel module named "vfs.zfs.debug". >> >> Discussed with: smh >> MFC after: 2 weeks >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Apr 14 15:31:04 2017 (r316853) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Apr 14 15:35:07 2017 (r316854) >> @@ -353,7 +353,7 @@ sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLE >> return (0); >> } >> >> -SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, >> +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debugflags, >> CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), >> sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); >> >> -- Andriy Gapon From owner-svn-src-all@freebsd.org Fri Apr 14 16:21:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C437D3DF53; Fri, 14 Apr 2017 16:21:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF3F6AE1; Fri, 14 Apr 2017 16:21:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f51.google.com with SMTP id o81so132887970wmb.1; Fri, 14 Apr 2017 09:21:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=MuF1fL4wP1zl7aYEqmI8Old8lhHcMrsWjX5dgV/Tm8o=; b=Pn5yft7JzApttt5k5KT6suBsVGaSdWS/zFF4zgTiW7hl1ryR0HyT7sAtS8Y1Q33/XS DxTP1CTY1wDaMjdIewdSxEUyOM5bSeWsb0kQyoxxWjp+2trgNlvD8TWgUFgER8WnNnLf umHF4cJUFSLIziomMpwSNvSrzf3PKtWaQHiPlQHXAs3mPz3xF8ypvw/2zy7lpXO66KFL 4avPhnushUzj83eYfb7J8al4NK7m3p/bH5LXOBvpkmKOzVaGExbckD6lT8M86BY843UB AmPNc1klAMoZkahgGMSrIC1XJo14tPR/J73e9U8DkvzppX34Dj8xCX2D05YjE3qckBeJ 7f4Q== X-Gm-Message-State: AN3rC/6Dgcfs0A6d3az6JD6p7fVw/r6XKF/ATYLH6MqvzPxEy+lBC66d nO0HU527G0EwWg== X-Received: by 10.28.133.139 with SMTP id h133mr30643769wmd.87.1492186535977; Fri, 14 Apr 2017 09:15:35 -0700 (PDT) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com. [74.125.82.50]) by smtp.gmail.com with ESMTPSA id v7sm2916446wrd.0.2017.04.14.09.15.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 09:15:35 -0700 (PDT) Received: by mail-wm0-f50.google.com with SMTP id u2so67538663wmu.0; Fri, 14 Apr 2017 09:15:35 -0700 (PDT) X-Received: by 10.28.218.197 with SMTP id r188mr8272286wmg.0.1492186535731; Fri, 14 Apr 2017 09:15:35 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Fri, 14 Apr 2017 09:15:35 -0700 (PDT) In-Reply-To: <1492185206.73883.126.camel@freebsd.org> References: <201704141158.v3EBwfLm003147@repo.freebsd.org> <1492185206.73883.126.camel@freebsd.org> From: Conrad Meyer Date: Fri, 14 Apr 2017 09:15:35 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316826 - head/sys/netpfil/ipfw/nat64 To: Ian Lepore Cc: "Andrey V. Elsukov" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:21:19 -0000 Ian, I don't know about "guaranteed," but it certainly looks like the htonl/bswap macros intend to avoid double-evaluating macro parameters. On Fri, Apr 14, 2017 at 8:53 AM, Ian Lepore wrote: > On Fri, 2017-04-14 at 08:32 -0700, Conrad Meyer wrote: >> On Fri, Apr 14, 2017 at 4:58 AM, Andrey V. Elsukov >> wrote: >> > >> > Author: ae >> > Date: Fri Apr 14 11:58:41 2017 >> > New Revision: 316826 >> > URL: https://svnweb.freebsd.org/changeset/base/316826 >> > >> > Log: >> > Avoid undefined behavior. >> > >> > The 'pktid' variable is modified while being used twice between >> > sequence points, probably due to htonl() is macro. >> FYI =E2=80=94 there are a ton of similar reports in sys/rpc due to the X= DR >> macros (which read a network value off a pointer and increment it). >> See e.g., IXDR_GET_UINT32() macro. >> >> Best, >> Conrad > > Aren't they all false positives, since the macros involved are g'teed > not to evaluate their arguments more than once as written (because > __builtin_constant_p always evaluates at compile time)? Do we really > want to churn our source code to eliminate false positives from some > tool that appears to still be in its alpha-testing state? > > -- Ian From owner-svn-src-all@freebsd.org Fri Apr 14 16:30:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B43F1D3E0AD; Fri, 14 Apr 2017 16:30:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 808B3DE8; Fri, 14 Apr 2017 16:30:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EGUbdf018455; Fri, 14 Apr 2017 16:30:37 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EGUbFe018438; Fri, 14 Apr 2017 16:30:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704141630.v3EGUbFe018438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 14 Apr 2017 16:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316856 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:30:38 -0000 Author: asomers Date: Fri Apr 14 16:30:37 2017 New Revision: 316856 URL: https://svnweb.freebsd.org/changeset/base/316856 Log: MFV 316855 7900 zdb shouldn't print the path of a znode at verbosity < 5 Reviewed by: Paul Dagnelie Reviewed by: Matt Ahrens Approved by: Dan McDonald Author: Alan Somers illumos/illumos-gate@e548d2fa41d1baa06662ed9abbb8bcec86e27dd9 https://www.illumos.org/issues/7900 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Apr 14 16:18:53 2017 (r316855) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Apr 14 16:30:37 2017 (r316856) @@ -1718,23 +1718,19 @@ dump_znode(objset_t *os, uint64_t object return; } - error = zfs_obj_to_path(os, object, path, sizeof (path)); - if (error != 0) { - (void) snprintf(path, sizeof (path), "\?\?\?", - (u_longlong_t)object); - } - if (dump_opt['d'] < 3) { - (void) printf("\t%s\n", path); - (void) sa_handle_destroy(hdl); - return; - } - z_crtime = (time_t)crtm[0]; z_atime = (time_t)acctm[0]; z_mtime = (time_t)modtm[0]; z_ctime = (time_t)chgtm[0]; - (void) printf("\tpath %s\n", path); + if (dump_opt['d'] > 4) { + error = zfs_obj_to_path(os, object, path, sizeof (path)); + if (error != 0) { + (void) snprintf(path, sizeof (path), + "\?\?\?", (u_longlong_t)object); + } + (void) printf("\tpath %s\n", path); + } dump_uidgid(os, uid, gid); (void) printf("\tatime %s", ctime(&z_atime)); (void) printf("\tmtime %s", ctime(&z_mtime)); From owner-svn-src-all@freebsd.org Fri Apr 14 16:40:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C69ED3E3B4; Fri, 14 Apr 2017 16:40:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 687D088A; Fri, 14 Apr 2017 16:40:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EGeArH022481; Fri, 14 Apr 2017 16:40:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EGeAuG022480; Fri, 14 Apr 2017 16:40:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141640.v3EGeAuG022480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 16:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316857 - stable/10/sys/dev/aacraid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:40:11 -0000 Author: avg Date: Fri Apr 14 16:40:10 2017 New Revision: 316857 URL: https://svnweb.freebsd.org/changeset/base/316857 Log: fix mismerge in r316846, MFC of r315858 Modified: stable/10/sys/dev/aacraid/aacraid_cam.c Modified: stable/10/sys/dev/aacraid/aacraid_cam.c ============================================================================== --- stable/10/sys/dev/aacraid/aacraid_cam.c Fri Apr 14 16:30:37 2017 (r316856) +++ stable/10/sys/dev/aacraid/aacraid_cam.c Fri Apr 14 16:40:10 2017 (r316857) @@ -242,7 +242,6 @@ aac_cam_event(struct aac_softc *sc, stru static int aac_cam_probe(device_t dev) { - struct aac_softc *sc; struct aac_cam *camsc; camsc = (struct aac_cam *)device_get_softc(dev); @@ -1134,7 +1133,6 @@ aac_cam_poll(struct cam_sim *sim) static void aac_container_complete(struct aac_command *cm) { - struct aac_softc *sc; union ccb *ccb; u_int32_t status; From owner-svn-src-all@freebsd.org Fri Apr 14 16:53:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E02FDD3E930; Fri, 14 Apr 2017 16:53:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CE886A4; Fri, 14 Apr 2017 16:53:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EGrY49030491; Fri, 14 Apr 2017 16:53:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EGrYEO030485; Fri, 14 Apr 2017 16:53:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141653.v3EGrYEO030485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 16:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316858 - in vendor/illumos/dist: cmd/zdb cmd/ztest lib/libzpool/common lib/libzpool/common/sys man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:53:36 -0000 Author: avg Date: Fri Apr 14 16:53:34 2017 New Revision: 316858 URL: https://svnweb.freebsd.org/changeset/base/316858 Log: 7280 Allow changing global libzpool variables in zdb and ztest through command line illumos/illumos-gate@0e60744c982adecd0a1f146f5637475d07ab1069 https://github.com/illumos/illumos-gate/commit/0e60744c982adecd0a1f146f5637475d07ab1069 https://www.illumos.org/issues/7280 zdb is very handy for diagnosing problems with a pool in a safe and quick way. When a pool is in a bad shape, we often want to disable some fail-safes, or adjust some tunables in order to open them. In the kernel, this is done by changing public variables in mdb. The goal of this feature is to add the same capability to zdb and ztest, so that they can change libzpool tuneables from the command line. Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Approved by: Robert Mustacchi Author: Pavel Zakharov Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h vendor/illumos/dist/lib/libzpool/common/util.c vendor/illumos/dist/man/man1m/zdb.1m Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:40:10 2017 (r316857) +++ vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:53:34 2017 (r316858) @@ -118,7 +118,8 @@ usage(void) { (void) fprintf(stderr, "Usage: %s [-CumMdibcsDvhLXFPAG] [-t txg] [-e [-p path...]] " - "[-U config] [-I inflight I/Os] [-x dumpdir] poolname [object...]\n" + "[-U config] [-I inflight I/Os] [-x dumpdir] [-o var=value] " + "poolname [object...]\n" " %s [-divPA] [-e -p path...] [-U config] dataset " "[object...]\n" " %s -mM [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " @@ -180,6 +181,8 @@ usage(void) "checksumming I/Os [default is 200]\n"); (void) fprintf(stderr, " -G dump zfs_dbgmsg buffer before " "exiting\n"); + (void) fprintf(stderr, " -o = set global " + "variable to an unsigned 32-bit integer value\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -3575,7 +3578,7 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "bcdhilmMI:suCDRSAFLXx:evp:t:U:PG")) != -1) { + "bcdhilmMI:suCDRSAFLXx:evp:t:U:PGo:")) != -1) { switch (c) { case 'b': case 'c': @@ -3644,6 +3647,11 @@ main(int argc, char **argv) case 'x': vn_dumpdir = optarg; break; + case 'o': + error = set_global_var(optarg); + if (error != 0) + usage(); + break; default: usage(); break; Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Fri Apr 14 16:40:10 2017 (r316857) +++ vendor/illumos/dist/cmd/ztest/ztest.c Fri Apr 14 16:53:34 2017 (r316858) @@ -579,6 +579,8 @@ usage(boolean_t requested) "\t[-F freezeloops (default: %llu)] max loops in spa_freeze()\n" "\t[-P passtime (default: %llu sec)] time per pass\n" "\t[-B alt_ztest (default: )] alternate ztest path\n" + "\t[-o variable=value] ... set global variable to an unsigned\n" + "\t 32-bit integer value\n" "\t[-h] (print help)\n" "", zo->zo_pool, @@ -614,7 +616,7 @@ process_options(int argc, char **argv) bcopy(&ztest_opts_defaults, zo, sizeof (*zo)); while ((opt = getopt(argc, argv, - "v:s:a:m:r:R:d:t:g:i:k:p:f:VET:P:hF:B:")) != EOF) { + "v:s:a:m:r:R:d:t:g:i:k:p:f:VET:P:hF:B:o:")) != EOF) { value = 0; switch (opt) { case 'v': @@ -701,6 +703,10 @@ process_options(int argc, char **argv) case 'B': (void) strlcpy(altdir, optarg, sizeof (altdir)); break; + case 'o': + if (set_global_var(optarg) != 0) + usage(B_FALSE); + break; case 'h': usage(B_TRUE); break; Modified: vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Fri Apr 14 16:40:10 2017 (r316857) +++ vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Fri Apr 14 16:53:34 2017 (r316858) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ @@ -541,6 +541,7 @@ extern void kernel_fini(void); struct spa; extern void nicenum(uint64_t num, char *buf); extern void show_pool_stats(struct spa *); +extern int set_global_var(char *arg); typedef struct callb_cpr { kmutex_t *cc_lockp; Modified: vendor/illumos/dist/lib/libzpool/common/util.c ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/util.c Fri Apr 14 16:40:10 2017 (r316857) +++ vendor/illumos/dist/lib/libzpool/common/util.c Fri Apr 14 16:53:34 2017 (r316858) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016 by Delphix. All rights reserved. */ #include @@ -31,6 +32,7 @@ #include #include #include +#include /* * Routines needed by more than one client of libzpool. @@ -153,3 +155,58 @@ show_pool_stats(spa_t *spa) nvlist_free(config); } + +/* + * Sets given global variable in libzpool to given unsigned 32-bit value. + * arg: "=" + */ +int +set_global_var(char *arg) +{ + void *zpoolhdl; + char *varname = arg, *varval; + u_longlong_t val; + +#ifndef _LITTLE_ENDIAN + /* + * On big endian systems changing a 64-bit variable would set the high + * 32 bits instead of the low 32 bits, which could cause unexpected + * results. + */ + fprintf(stderr, "Setting global variables is only supported on " + "little-endian systems\n", varname); + return (ENOTSUP); +#endif + if ((varval = strchr(arg, '=')) != NULL) { + *varval = '\0'; + varval++; + val = strtoull(varval, NULL, 0); + if (val > UINT32_MAX) { + fprintf(stderr, "Value for global variable '%s' must " + "be a 32-bit unsigned integer\n", varname); + return (EOVERFLOW); + } + } else { + return (EINVAL); + } + + zpoolhdl = dlopen("libzpool.so", RTLD_LAZY); + if (zpoolhdl != NULL) { + uint32_t *var; + var = dlsym(zpoolhdl, varname); + if (var == NULL) { + fprintf(stderr, "Global variable '%s' does not exist " + "in libzpool.so\n", varname); + return (EINVAL); + } + *var = (uint32_t)val; + + dlclose(zpoolhdl); + } else { + fprintf(stderr, "Failed to open libzpool.so to set global " + "variable\n"); + return (EIO); + } + + return (0); +} Modified: vendor/illumos/dist/man/man1m/zdb.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zdb.1m Fri Apr 14 16:40:10 2017 (r316857) +++ vendor/illumos/dist/man/man1m/zdb.1m Fri Apr 14 16:53:34 2017 (r316858) @@ -21,7 +21,7 @@ .SH "SYNOPSIS" \fBzdb\fR [-CumdibcsDvhLMXFPAG] [-e [-p \fIpath\fR...]] [-t \fItxg\fR] [-U \fIcache\fR] [-I \fIinflight I/Os\fR] [-x \fIdumpdir\fR] - [\fIpoolname\fR [\fIobject\fR ...]] + [-o \fIvar\fR=\fIvalue\fR] ... [\fIpoolname\fR [\fIobject\fR ...]] .P \fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] @@ -423,6 +423,18 @@ option. .sp .ne 2 .na +\fB-o \fIvar\fR=\fIvalue\fR ... \fR +.ad +.sp .6 +.RS 4n +Set the given global libzpool variable to the provided value. The value must +be an unsigned 32-bit integer. Currently only little-endian systems are +supported to avoid accidentally setting the high 32 bits of 64-bit variables. +.RE + +.sp +.ne 2 +.na \fB-P\fR .ad .sp .6 From owner-svn-src-all@freebsd.org Fri Apr 14 16:54:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB0A0D3E9A2; Fri, 14 Apr 2017 16:54:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CC42856; Fri, 14 Apr 2017 16:54:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EGsoOA030617; Fri, 14 Apr 2017 16:54:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EGsoJw030616; Fri, 14 Apr 2017 16:54:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704141654.v3EGsoJw030616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 14 Apr 2017 16:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316859 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:54:51 -0000 Author: markj Date: Fri Apr 14 16:54:50 2017 New Revision: 316859 URL: https://svnweb.freebsd.org/changeset/base/316859 Log: Stop mirror synchronization before draining the I/O queue. Regular I/O requests may be blocked by concurrent synchronization requests targeted to the same LBAs, in which case they are moved to a holding queue until the conflicting I/O completes. We therefore want to stop synchronization before completing pending I/O in g_mirror_destroy_provider() since this ensures that blocked I/O requests are completed as well. Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Apr 14 16:53:34 2017 (r316858) +++ head/sys/geom/mirror/g_mirror.c Fri Apr 14 16:54:50 2017 (r316859) @@ -2170,6 +2170,11 @@ g_mirror_destroy_provider(struct g_mirro KASSERT(sc->sc_provider != NULL, ("NULL provider (device=%s).", sc->sc_name)); + LIST_FOREACH(disk, &sc->sc_disks, d_next) { + if (disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING) + g_mirror_sync_stop(disk, 1); + } + g_topology_lock(); g_error_provider(sc->sc_provider, ENXIO); mtx_lock(&sc->sc_queue_mtx); @@ -2193,10 +2198,6 @@ g_mirror_destroy_provider(struct g_mirro sc->sc_provider = NULL; G_MIRROR_DEBUG(0, "Device %s: provider destroyed.", sc->sc_name); g_topology_unlock(); - LIST_FOREACH(disk, &sc->sc_disks, d_next) { - if (disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING) - g_mirror_sync_stop(disk, 1); - } } static void From owner-svn-src-all@freebsd.org Fri Apr 14 16:55:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C05E9D3EA56; Fri, 14 Apr 2017 16:55:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7653DA5B; Fri, 14 Apr 2017 16:55:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EGtF39030711; Fri, 14 Apr 2017 16:55:15 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EGtFIw030710; Fri, 14 Apr 2017 16:55:15 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141655.v3EGtFIw030710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 16:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316860 - vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:55:16 -0000 Author: avg Date: Fri Apr 14 16:55:15 2017 New Revision: 316860 URL: https://svnweb.freebsd.org/changeset/base/316860 Log: 7545 zdb should disable reference tracking illumos/illumos-gate@4dd77f9e38ef05b39db128ff7608d926fd3218c6 https://github.com/illumos/illumos-gate/commit/4dd77f9e38ef05b39db128ff7608d926fd3218c6 https://www.illumos.org/issues/7545 When evicting from the ARC, we manipulate some refcount_t's, e.g. arcs_size. When using zdb to examine a large amount of data (e.g. zdb -bb on a large pool with small blocks), the ARC may have a large number of entries. If reference tracking is enabled, there will be ~1 reference for each block in the ARC. When evicting, we decrement the refcount and have to search all the references to find the one that we are removing, which is very slow. Since zdb is typically used to find problems with the on-disk format, and not with the code it is running, we should disable reference tracking in zdb. Reviewed by: Dan Kimmel Reviewed by: Steve Gonczi Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:54:50 2017 (r316859) +++ vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:55:15 2017 (r316860) @@ -75,10 +75,12 @@ DMU_OT_ZAP_OTHER : DMU_OT_NUMTYPES)) #ifndef lint +extern int reference_tracking_enable; extern boolean_t zfs_recover; extern uint64_t zfs_arc_max, zfs_arc_meta_limit; extern int zfs_vdev_async_read_max_active; #else +int reference_tracking_enable; boolean_t zfs_recover; uint64_t zfs_arc_max, zfs_arc_meta_limit; int zfs_vdev_async_read_max_active; @@ -3676,6 +3678,11 @@ main(int argc, char **argv) */ zfs_vdev_async_read_max_active = 10; + /* + * Disable reference tracking for better performance. + */ + reference_tracking_enable = B_FALSE; + kernel_init(FREAD); g_zfs = libzfs_init(); ASSERT(g_zfs != NULL); From owner-svn-src-all@freebsd.org Fri Apr 14 16:57:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A48E2D3EB6D; Fri, 14 Apr 2017 16:57:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C3E0C47; Fri, 14 Apr 2017 16:57:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EGv6u0030852; Fri, 14 Apr 2017 16:57:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EGv622030850; Fri, 14 Apr 2017 16:57:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141657.v3EGv622030850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 16:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316861 - in vendor/illumos/dist: cmd/zdb man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:57:07 -0000 Author: avg Date: Fri Apr 14 16:57:06 2017 New Revision: 316861 URL: https://svnweb.freebsd.org/changeset/base/316861 Log: 6866 zdb -l should return non-zero if it fails to find any label illumos/illumos-gate@64723e361134b2a2c45341334174f9d34002f8d0 https://github.com/illumos/illumos-gate/commit/64723e361134b2a2c45341334174f9d34002f8d0 https://www.illumos.org/issues/6866 Need this for #6865. To be generally more scripting-friendly, overload this issue with adding '-q' option which should skip printing any label information. Reviewed by: Matthew Ahrens Reviewed by: John Kennedy Approved by: Robert Mustacchi Author: Yuri Pankov Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/man/man1m/zdb.1m Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:55:15 2017 (r316860) +++ vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:57:06 2017 (r316861) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Nexenta Systems, Inc. */ #include @@ -119,7 +120,7 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumMdibcsDvhLXFPAG] [-t txg] [-e [-p path...]] " + "Usage: %s [-CmMdibcsDvhLXFPAG] [-t txg] [-e [-p path...]] " "[-U config] [-I inflight I/Os] [-x dumpdir] [-o var=value] " "poolname [object...]\n" " %s [-divPA] [-e -p path...] [-U config] dataset " @@ -129,7 +130,7 @@ usage(void) " %s -R [-A] [-e [-p path...]] poolname " "vdev:offset:size[:flags]\n" " %s -S [-PA] [-e [-p path...]] [-U config] poolname\n" - " %s -l [-uA] device\n" + " %s -l [-Aqu] device\n" " %s -C [-A] [-U config]\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); @@ -140,7 +141,6 @@ usage(void) (void) fprintf(stderr, " If object numbers are specified, only " "those objects are dumped\n\n"); (void) fprintf(stderr, " Options to control amount of output:\n"); - (void) fprintf(stderr, " -u uberblock\n"); (void) fprintf(stderr, " -d dataset(s)\n"); (void) fprintf(stderr, " -i intent logs\n"); (void) fprintf(stderr, " -C config (or cachefile if alone)\n"); @@ -154,7 +154,7 @@ usage(void) (void) fprintf(stderr, " -D dedup statistics\n"); (void) fprintf(stderr, " -S simulate dedup to measure effect\n"); (void) fprintf(stderr, " -v verbose (applies to all others)\n"); - (void) fprintf(stderr, " -l dump label contents\n"); + (void) fprintf(stderr, " -l read label contents\n"); (void) fprintf(stderr, " -L disable leak tracking (do not " "load spacemaps)\n"); (void) fprintf(stderr, " -R read and display block from a " @@ -185,6 +185,8 @@ usage(void) "exiting\n"); (void) fprintf(stderr, " -o = set global " "variable to an unsigned 32-bit integer value\n"); + (void) fprintf(stderr, " -q don't print label contents\n"); + (void) fprintf(stderr, " -u uberblock\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -2133,45 +2135,48 @@ dump_label_uberblocks(vdev_label_t *lbl, } } -static void +static int dump_label(const char *dev) { int fd; vdev_label_t label; - char *path, *buf = label.vl_vdev_phys.vp_nvlist; + char path[MAXPATHLEN]; + char *buf = label.vl_vdev_phys.vp_nvlist; size_t buflen = sizeof (label.vl_vdev_phys.vp_nvlist); struct stat64 statbuf; uint64_t psize, ashift; - int len = strlen(dev) + 1; + boolean_t label_found = B_FALSE; - if (strncmp(dev, ZFS_DISK_ROOTD, strlen(ZFS_DISK_ROOTD)) == 0) { - len++; - path = malloc(len); - (void) snprintf(path, len, "%s%s", ZFS_RDISK_ROOTD, - dev + strlen(ZFS_DISK_ROOTD)); - } else { - path = strdup(dev); - } + (void) strlcpy(path, dev, sizeof (path)); + if (dev[0] == '/') { + if (strncmp(dev, ZFS_DISK_ROOTD, + strlen(ZFS_DISK_ROOTD)) == 0) { + (void) snprintf(path, sizeof (path), "%s%s", + ZFS_RDISK_ROOTD, dev + strlen(ZFS_DISK_ROOTD)); + } + } else if (stat64(path, &statbuf) != 0) { + char *s; - if ((fd = open64(path, O_RDONLY)) < 0) { - (void) printf("cannot open '%s': %s\n", path, strerror(errno)); - free(path); - exit(1); + (void) snprintf(path, sizeof (path), "%s%s", ZFS_RDISK_ROOTD, + dev); + if ((s = strrchr(dev, 's')) == NULL || !isdigit(*(s + 1))) + (void) strlcat(path, "s0", sizeof (path)); } - if (fstat64(fd, &statbuf) != 0) { + if (stat64(path, &statbuf) != 0) { (void) printf("failed to stat '%s': %s\n", path, strerror(errno)); - free(path); - (void) close(fd); exit(1); } if (S_ISBLK(statbuf.st_mode)) { (void) printf("cannot use '%s': character device required\n", path); - free(path); - (void) close(fd); + exit(1); + } + + if ((fd = open64(path, O_RDONLY)) < 0) { + (void) printf("cannot open '%s': %s\n", path, strerror(errno)); exit(1); } @@ -2181,36 +2186,43 @@ dump_label(const char *dev) for (int l = 0; l < VDEV_LABELS; l++) { nvlist_t *config = NULL; - (void) printf("--------------------------------------------\n"); - (void) printf("LABEL %d\n", l); - (void) printf("--------------------------------------------\n"); + if (!dump_opt['q']) { + (void) printf("------------------------------------\n"); + (void) printf("LABEL %d\n", l); + (void) printf("------------------------------------\n"); + } if (pread64(fd, &label, sizeof (label), vdev_label_offset(psize, l, 0)) != sizeof (label)) { - (void) printf("failed to read label %d\n", l); + if (!dump_opt['q']) + (void) printf("failed to read label %d\n", l); continue; } if (nvlist_unpack(buf, buflen, &config, 0) != 0) { - (void) printf("failed to unpack label %d\n", l); + if (!dump_opt['q']) + (void) printf("failed to unpack label %d\n", l); ashift = SPA_MINBLOCKSHIFT; } else { nvlist_t *vdev_tree = NULL; - dump_nvlist(config, 4); + if (!dump_opt['q']) + dump_nvlist(config, 4); if ((nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &vdev_tree) != 0) || (nvlist_lookup_uint64(vdev_tree, ZPOOL_CONFIG_ASHIFT, &ashift) != 0)) ashift = SPA_MINBLOCKSHIFT; nvlist_free(config); + label_found = B_TRUE; } if (dump_opt['u']) dump_label_uberblocks(&label, ashift); } - free(path); (void) close(fd); + + return (label_found ? 0 : 2); } static uint64_t dataset_feature_count[SPA_FEATURES]; @@ -3580,7 +3592,7 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "bcdhilmMI:suCDRSAFLXx:evp:t:U:PGo:")) != -1) { + "bcdhilmMI:suCDRSAFLXx:evp:t:U:PGo:q")) != -1) { switch (c) { case 'b': case 'c': @@ -3606,6 +3618,7 @@ main(int argc, char **argv) case 'X': case 'e': case 'P': + case 'q': dump_opt[c]++; break; case 'I': @@ -3713,10 +3726,8 @@ main(int argc, char **argv) usage(); } - if (dump_opt['l']) { - dump_label(argv[0]); - return (0); - } + if (dump_opt['l']) + return (dump_label(argv[0])); if (dump_opt['X'] || dump_opt['F']) rewind = ZPOOL_DO_REWIND | Modified: vendor/illumos/dist/man/man1m/zdb.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zdb.1m Fri Apr 14 16:55:15 2017 (r316860) +++ vendor/illumos/dist/man/man1m/zdb.1m Fri Apr 14 16:57:06 2017 (r316861) @@ -12,14 +12,15 @@ .\" .\" Copyright 2012, Richard Lowe. .\" Copyright (c) 2012, 2016 by Delphix. All rights reserved. +.\" Copyright 2016 Nexenta Systems, Inc. .\" -.TH "ZDB" "1M" "Feb 4, 2016" "" "" +.TH "ZDB" "1M" "April 9, 2016" .SH "NAME" \fBzdb\fR - Display zpool debugging and consistency information .SH "SYNOPSIS" -\fBzdb\fR [-CumdibcsDvhLMXFPAG] [-e [-p \fIpath\fR...]] [-t \fItxg\fR] +\fBzdb\fR [-CmdibcsDvhLMXFPAG] [-e [-p \fIpath\fR...]] [-t \fItxg\fR] [-U \fIcache\fR] [-I \fIinflight I/Os\fR] [-x \fIdumpdir\fR] [-o \fIvar\fR=\fIvalue\fR] ... [\fIpoolname\fR [\fIobject\fR ...]] @@ -39,7 +40,7 @@ \fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR .P -\fBzdb\fR -l [-uA] \fIdevice\fR +\fBzdb\fR -l [-Aqu] \fIdevice\fR .P \fBzdb\fR -C [-A] [-U \fIcache\fR] @@ -176,8 +177,13 @@ transaction type. .ad .sp .6 .RS 4n -Display the vdev labels from the specified device. If the \fB-u\fR option is -also specified, also display the uberblocks on this device. +Read the vdev labels from the specified device. \fBzdb -l\fR will return 0 if +valid label was found, 1 if error occured, and 2 if no valid labels were found. +.P +If the \fB-u\fR option is also specified, also display the uberblocks on this +device. +.P +If the \fB-q\fR option is also specified, don't print the labels. .RE .sp From owner-svn-src-all@freebsd.org Fri Apr 14 16:58:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F3E5D3EC54; Fri, 14 Apr 2017 16:58:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B751E40; Fri, 14 Apr 2017 16:58:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EGwf6f030992; Fri, 14 Apr 2017 16:58:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EGwfxU030989; Fri, 14 Apr 2017 16:58:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141658.v3EGwfxU030989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 16:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316862 - in vendor/illumos/dist: cmd/zdb man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:58:42 -0000 Author: avg Date: Fri Apr 14 16:58:41 2017 New Revision: 316862 URL: https://svnweb.freebsd.org/changeset/base/316862 Log: 6410 teach zdb to perform object lookups by path illumos/illumos-gate@ed61ec1da9132e570b0853386d0f78a32f852cd2 https://github.com/illumos/illumos-gate/commit/ed61ec1da9132e570b0853386d0f78a32f852cd2 https://www.illumos.org/issues/6410 This is primarily intended to ease debugging & testing ZFS when one is only interested in things like the on-disk location of a specific object's blocks, but doesn't know their object id. This allows doing things like the following (FreeBSD-based example): # zpool create -f foo da0 # dd if=/dev/zero of=/foo/1 bs=1M count=4 >/dev/null 2>&1 # zpool export foo # zdb -vvvvv -o "ZFS plain file" foo /1 Object lvl iblk dblk dsize lsize %full type 8 2 16K 128K 3.99M 4M 100.00 ZFS plain file (K=inherit) (Z=inherit) 168 bonus System attributes dnode flags: USED_BYTES USERUSED_ACCOUNTED dnode maxblkid: 31 path /1 uid 0 gid 0 atime Thu Apr 23 22:45:32 2015 mtime Thu Apr 23 22:45:32 2015 ctime Thu Apr 23 22:45:32 2015 crtime Thu Apr 23 22:45:32 2015 gen 7 mode 100644 size 4194304 parent 4 links 1 pflags 40800000004 Indirect blocks: 0 L1 DVA[0]=<0:c19200:600> DVA[1]=<0:10800019200:600> [L1 ZFS plain file] fletcher4 lz4 LE contiguous unique double size=4000L/200P birth=7L/ Reviewed by: Pavel Zakharov Reviewed by: Matthew Ahrens Reviewed by: Will Andrews Approved by: Dan McDonald Author: Yuri Pankov Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/man/man1m/zdb.1m Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:57:06 2017 (r316861) +++ vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:58:41 2017 (r316862) @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] - * Copyright 2016 Nexenta Systems, Inc. + * Copyright 2017 Nexenta Systems, Inc. */ #include @@ -120,19 +120,22 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CmMdibcsDvhLXFPAG] [-t txg] [-e [-p path...]] " - "[-U config] [-I inflight I/Os] [-x dumpdir] [-o var=value] " - "poolname [object...]\n" - " %s [-divPA] [-e -p path...] [-U config] dataset " - "[object...]\n" - " %s -mM [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " - "poolname [vdev [metaslab...]]\n" - " %s -R [-A] [-e [-p path...]] poolname " - "vdev:offset:size[:flags]\n" - " %s -S [-PA] [-e [-p path...]] [-U config] poolname\n" - " %s -l [-Aqu] device\n" - " %s -C [-A] [-U config]\n\n", - cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); + "Usage:\t%s [-AbcdDFGhiLMPsvX] [-e [-p ...]] " + "[-I ]\n" + "\t\t[-o =]... [-t ] [-U ] [-x ]\n" + "\t\t[ [ ...]]\n" + "\t%s [-AdiPv] [-e [-p ...]] [-U ] " + "[ ...]\n" + "\t%s -C [-A] [-U ]\n" + "\t%s -l [-Aqu] \n" + "\t%s -m [-AFLPX] [-e [-p ...]] [-t ] [-U ]\n" + "\t\t [ [ ...]]\n" + "\t%s -O \n" + "\t%s -R [-A] [-e [-p ...]] [-U ]\n" + "\t\t ::[:]\n" + "\t%s -S [-AP] [-e [-p ...]] [-U ] \n\n", + cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, + cmdname); (void) fprintf(stderr, " Dataset name must include at least one " "separator character '/' or '@'\n"); @@ -141,52 +144,54 @@ usage(void) (void) fprintf(stderr, " If object numbers are specified, only " "those objects are dumped\n\n"); (void) fprintf(stderr, " Options to control amount of output:\n"); - (void) fprintf(stderr, " -d dataset(s)\n"); - (void) fprintf(stderr, " -i intent logs\n"); - (void) fprintf(stderr, " -C config (or cachefile if alone)\n"); - (void) fprintf(stderr, " -h pool history\n"); (void) fprintf(stderr, " -b block statistics\n"); - (void) fprintf(stderr, " -m metaslabs\n"); - (void) fprintf(stderr, " -M metaslab groups\n"); (void) fprintf(stderr, " -c checksum all metadata (twice for " "all data) blocks\n"); - (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); + (void) fprintf(stderr, " -C config (or cachefile if alone)\n"); + (void) fprintf(stderr, " -d dataset(s)\n"); (void) fprintf(stderr, " -D dedup statistics\n"); - (void) fprintf(stderr, " -S simulate dedup to measure effect\n"); - (void) fprintf(stderr, " -v verbose (applies to all others)\n"); + (void) fprintf(stderr, " -h pool history\n"); + (void) fprintf(stderr, " -i intent logs\n"); (void) fprintf(stderr, " -l read label contents\n"); (void) fprintf(stderr, " -L disable leak tracking (do not " "load spacemaps)\n"); + (void) fprintf(stderr, " -m metaslabs\n"); + (void) fprintf(stderr, " -M metaslab groups\n"); + (void) fprintf(stderr, " -O perform object lookups by path\n"); (void) fprintf(stderr, " -R read and display block from a " - "device\n\n"); + "device\n"); + (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); + (void) fprintf(stderr, " -S simulate dedup to measure effect\n"); + (void) fprintf(stderr, " -v verbose (applies to all " + "others)\n\n"); (void) fprintf(stderr, " Below options are intended for use " "with other options:\n"); (void) fprintf(stderr, " -A ignore assertions (-A), enable " "panic recovery (-AA) or both (-AAA)\n"); - (void) fprintf(stderr, " -F attempt automatic rewind within " - "safe range of transaction groups\n"); - (void) fprintf(stderr, " -U -- use alternate " - "cachefile\n"); - (void) fprintf(stderr, " -X attempt extreme rewind (does not " - "work with dataset)\n"); (void) fprintf(stderr, " -e pool is exported/destroyed/" "has altroot/not in a cachefile\n"); - (void) fprintf(stderr, " -p -- use one or more with " - "-e to specify path to vdev dir\n"); - (void) fprintf(stderr, " -x -- " - "dump all read blocks into specified directory\n"); - (void) fprintf(stderr, " -P print numbers in parseable form\n"); - (void) fprintf(stderr, " -t -- highest txg to use when " - "searching for uberblocks\n"); + (void) fprintf(stderr, " -F attempt automatic rewind within " + "safe range of transaction groups\n"); + (void) fprintf(stderr, " -G dump zfs_dbgmsg buffer before " + "exiting\n"); (void) fprintf(stderr, " -I -- " "specify the maximum number of " "checksumming I/Os [default is 200]\n"); - (void) fprintf(stderr, " -G dump zfs_dbgmsg buffer before " - "exiting\n"); (void) fprintf(stderr, " -o = set global " "variable to an unsigned 32-bit integer value\n"); + (void) fprintf(stderr, " -p -- use one or more with " + "-e to specify path to vdev dir\n"); + (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -q don't print label contents\n"); + (void) fprintf(stderr, " -t -- highest txg to use when " + "searching for uberblocks\n"); (void) fprintf(stderr, " -u uberblock\n"); + (void) fprintf(stderr, " -U -- use alternate " + "cachefile\n"); + (void) fprintf(stderr, " -x -- " + "dump all read blocks into specified directory\n"); + (void) fprintf(stderr, " -X attempt extreme rewind (does not " + "work with dataset)\n\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -1576,8 +1581,55 @@ dump_deadlist(dsl_deadlist_t *dl) static avl_tree_t idx_tree; static avl_tree_t domain_tree; static boolean_t fuid_table_loaded; -static boolean_t sa_loaded; -sa_attr_type_t *sa_attr_table; +static objset_t *sa_os = NULL; +static sa_attr_type_t *sa_attr_table = NULL; + +static int +open_objset(const char *path, dmu_objset_type_t type, void *tag, objset_t **osp) +{ + int err; + uint64_t sa_attrs = 0; + uint64_t version = 0; + + VERIFY3P(sa_os, ==, NULL); + err = dmu_objset_own(path, type, B_TRUE, tag, osp); + if (err != 0) { + (void) fprintf(stderr, "failed to own dataset '%s': %s\n", path, + strerror(err)); + return (err); + } + + if (dmu_objset_type(*osp) == DMU_OST_ZFS) { + (void) zap_lookup(*osp, MASTER_NODE_OBJ, ZPL_VERSION_STR, + 8, 1, &version); + if (version >= ZPL_VERSION_SA) { + (void) zap_lookup(*osp, MASTER_NODE_OBJ, ZFS_SA_ATTRS, + 8, 1, &sa_attrs); + } + err = sa_setup(*osp, sa_attrs, zfs_attr_table, ZPL_END, + &sa_attr_table); + if (err != 0) { + (void) fprintf(stderr, "sa_setup failed: %s\n", + strerror(err)); + dmu_objset_disown(*osp, tag); + *osp = NULL; + } + } + sa_os = *osp; + + return (0); +} + +static void +close_objset(objset_t *os, void *tag) +{ + VERIFY3P(os, ==, sa_os); + if (os->os_sa != NULL) + sa_tear_down(os); + dmu_objset_disown(os, tag); + sa_attr_table = NULL; + sa_os = NULL; +} static void fuid_table_destroy() @@ -1649,25 +1701,7 @@ dump_znode(objset_t *os, uint64_t object int idx = 0; int error; - if (!sa_loaded) { - uint64_t sa_attrs = 0; - uint64_t version; - - VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZPL_VERSION_STR, - 8, 1, &version) == 0); - if (version >= ZPL_VERSION_SA) { - VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZFS_SA_ATTRS, - 8, 1, &sa_attrs) == 0); - } - if ((error = sa_setup(os, sa_attrs, zfs_attr_table, - ZPL_END, &sa_attr_table)) != 0) { - (void) printf("sa_setup failed errno %d, can't " - "display znode contents\n", error); - return; - } - sa_loaded = B_TRUE; - } - + VERIFY3P(os, ==, sa_os); if (sa_handle_get(os, object, NULL, SA_HDL_PRIVATE, &hdl)) { (void) printf("Failed to get handle for SA znode\n"); return; @@ -2135,6 +2169,108 @@ dump_label_uberblocks(vdev_label_t *lbl, } } +static char curpath[PATH_MAX]; + +/* + * Iterate through the path components, recursively passing + * current one's obj and remaining path until we find the obj + * for the last one. + */ +static int +dump_path_impl(objset_t *os, uint64_t obj, char *name) +{ + int err; + int header = 1; + uint64_t child_obj; + char *s; + dmu_buf_t *db; + dmu_object_info_t doi; + + if ((s = strchr(name, '/')) != NULL) + *s = '\0'; + err = zap_lookup(os, obj, name, 8, 1, &child_obj); + + (void) strlcat(curpath, name, sizeof (curpath)); + + if (err != 0) { + (void) fprintf(stderr, "failed to lookup %s: %s\n", + curpath, strerror(err)); + return (err); + } + + child_obj = ZFS_DIRENT_OBJ(child_obj); + err = sa_buf_hold(os, child_obj, FTAG, &db); + if (err != 0) { + (void) fprintf(stderr, + "failed to get SA dbuf for obj %llu: %s\n", + (u_longlong_t)child_obj, strerror(err)); + return (EINVAL); + } + dmu_object_info_from_db(db, &doi); + sa_buf_rele(db, FTAG); + + if (doi.doi_bonus_type != DMU_OT_SA && + doi.doi_bonus_type != DMU_OT_ZNODE) { + (void) fprintf(stderr, "invalid bonus type %d for obj %llu\n", + doi.doi_bonus_type, (u_longlong_t)child_obj); + return (EINVAL); + } + + if (dump_opt['v'] > 6) { + (void) printf("obj=%llu %s type=%d bonustype=%d\n", + (u_longlong_t)child_obj, curpath, doi.doi_type, + doi.doi_bonus_type); + } + + (void) strlcat(curpath, "/", sizeof (curpath)); + + switch (doi.doi_type) { + case DMU_OT_DIRECTORY_CONTENTS: + if (s != NULL && *(s + 1) != '\0') + return (dump_path_impl(os, child_obj, s + 1)); + /*FALLTHROUGH*/ + case DMU_OT_PLAIN_FILE_CONTENTS: + dump_object(os, child_obj, dump_opt['v'], &header); + return (0); + default: + (void) fprintf(stderr, "object %llu has non-file/directory " + "type %d\n", (u_longlong_t)obj, doi.doi_type); + break; + } + + return (EINVAL); +} + +/* + * Dump the blocks for the object specified by path inside the dataset. + */ +static int +dump_path(char *ds, char *path) +{ + int err; + objset_t *os; + uint64_t root_obj; + + err = open_objset(ds, DMU_OST_ZFS, FTAG, &os); + if (err != 0) + return (err); + + err = zap_lookup(os, MASTER_NODE_OBJ, ZFS_ROOT_OBJ, 8, 1, &root_obj); + if (err != 0) { + (void) fprintf(stderr, "can't lookup root znode: %s\n", + strerror(err)); + dmu_objset_disown(os, FTAG); + return (EINVAL); + } + + (void) snprintf(curpath, sizeof (curpath), "dataset=%s path=/", ds); + + err = dump_path_impl(os, root_obj, path); + + close_objset(os, FTAG); + return (err); +} + static int dump_label(const char *dev) { @@ -2234,11 +2370,9 @@ dump_one_dir(const char *dsname, void *a int error; objset_t *os; - error = dmu_objset_own(dsname, DMU_OST_ANY, B_TRUE, FTAG, &os); - if (error) { - (void) printf("Could not open %s, error %d\n", dsname, error); + error = open_objset(dsname, DMU_OST_ANY, FTAG, &os); + if (error != 0) return (0); - } for (spa_feature_t f = 0; f < SPA_FEATURES; f++) { if (!dmu_objset_ds(os)->ds_feature_inuse[f]) @@ -2249,9 +2383,8 @@ dump_one_dir(const char *dsname, void *a } dump_dir(os); - dmu_objset_disown(os, FTAG); + close_objset(os, FTAG); fuid_table_destroy(); - sa_loaded = B_FALSE; return (0); } @@ -3592,35 +3725,37 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "bcdhilmMI:suCDRSAFLXx:evp:t:U:PGo:q")) != -1) { + "AbcCdDeFGhiI:lLmMo:Op:PqRsSt:uU:vx:X")) != -1) { switch (c) { case 'b': case 'c': + case 'C': case 'd': + case 'D': + case 'G': case 'h': case 'i': case 'l': case 'm': - case 's': - case 'u': - case 'C': - case 'D': case 'M': + case 'O': case 'R': + case 's': case 'S': - case 'G': + case 'u': dump_opt[c]++; dump_all = 0; break; case 'A': + case 'e': case 'F': case 'L': - case 'X': - case 'e': case 'P': case 'q': + case 'X': dump_opt[c]++; break; + /* NB: Sort single match options below. */ case 'I': max_inflight = strtoull(optarg, NULL, 0); if (max_inflight == 0) { @@ -3630,6 +3765,11 @@ main(int argc, char **argv) usage(); } break; + case 'o': + error = set_global_var(optarg); + if (error != 0) + usage(); + break; case 'p': if (searchdirs == NULL) { searchdirs = umem_alloc(sizeof (char *), @@ -3662,11 +3802,6 @@ main(int argc, char **argv) case 'x': vn_dumpdir = optarg; break; - case 'o': - error = set_global_var(optarg); - if (error != 0) - usage(); - break; default: usage(); break; @@ -3704,7 +3839,7 @@ main(int argc, char **argv) verbose = MAX(verbose, 1); for (c = 0; c < 256; c++) { - if (dump_all && !strchr("elAFLRSXP", c)) + if (dump_all && strchr("AeFlLOPRSX", c) == NULL) dump_opt[c] = 1; if (dump_opt[c]) dump_opt[c] += verbose; @@ -3729,6 +3864,13 @@ main(int argc, char **argv) if (dump_opt['l']) return (dump_label(argv[0])); + if (dump_opt['O']) { + if (argc != 2) + usage(); + dump_opt['v'] = verbose + 3; + return (dump_path(argv[0], argv[1])); + } + if (dump_opt['X'] || dump_opt['F']) rewind = ZPOOL_DO_REWIND | (dump_opt['X'] ? ZPOOL_EXTREME_REWIND : 0); @@ -3803,8 +3945,7 @@ main(int argc, char **argv) } } } else { - error = dmu_objset_own(target, DMU_OST_ANY, - B_TRUE, FTAG, &os); + error = open_objset(target, DMU_OST_ANY, FTAG, &os); } } nvlist_free(policy); @@ -3847,10 +3988,12 @@ main(int argc, char **argv) zdb_read_block(argv[i], spa); } - (os != NULL) ? dmu_objset_disown(os, FTAG) : spa_close(spa, FTAG); + if (os != NULL) + close_objset(os, FTAG); + else + spa_close(spa, FTAG); fuid_table_destroy(); - sa_loaded = B_FALSE; dump_debug_buffer(); Modified: vendor/illumos/dist/man/man1m/zdb.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zdb.1m Fri Apr 14 16:57:06 2017 (r316861) +++ vendor/illumos/dist/man/man1m/zdb.1m Fri Apr 14 16:58:41 2017 (r316862) @@ -1,4 +1,3 @@ -'\" t .\" .\" This file and its contents are supplied under the terms of the .\" Common Development and Distribution License ("CDDL"), version 1.0. @@ -12,545 +11,372 @@ .\" .\" Copyright 2012, Richard Lowe. .\" Copyright (c) 2012, 2016 by Delphix. All rights reserved. -.\" Copyright 2016 Nexenta Systems, Inc. +.\" Copyright 2017 Nexenta Systems, Inc. .\" -.TH "ZDB" "1M" "April 9, 2016" - -.SH "NAME" -\fBzdb\fR - Display zpool debugging and consistency information - -.SH "SYNOPSIS" -\fBzdb\fR [-CmdibcsDvhLMXFPAG] [-e [-p \fIpath\fR...]] [-t \fItxg\fR] - [-U \fIcache\fR] [-I \fIinflight I/Os\fR] [-x \fIdumpdir\fR] - [-o \fIvar\fR=\fIvalue\fR] ... [\fIpoolname\fR [\fIobject\fR ...]] - -.P -\fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] - \fIdataset\fR [\fIobject\fR ...] - -.P -\fBzdb\fR -m [-MLXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] - \fIpoolname\fR [\fIvdev\fR [\fImetaslab\fR ...]] - -.P -\fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR - \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR] - -.P -\fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR - -.P -\fBzdb\fR -l [-Aqu] \fIdevice\fR - -.P -\fBzdb\fR -C [-A] [-U \fIcache\fR] - -.SH "DESCRIPTION" -The \fBzdb\fR utility displays information about a ZFS pool useful for -debugging and performs some amount of consistency checking. It is a not a -general purpose tool and options (and facilities) may change. This is neither -a fsck(1M) nor an fsdb(1M) utility. - -.P +.Dd January 14, 2017 +.Dt ZDB 1M +.Os +.Sh NAME +.Nm zdb +.Nd display zpool debugging and consistency information +.Sh SYNOPSIS +.Nm +.Op Fl AbcdDFGhiLMPsvX +.Op Fl e Op Fl p Ar path ... +.Op Fl I Ar inflight I/Os +.Oo Fl o Ar var Ns = Ns Ar value Oc Ns ... +.Op Fl t Ar txg +.Op Fl U Ar cache +.Op Fl x Ar dumpdir +.Op Ar poolname Op Ar object ... +.Nm +.Op Fl AdiPv +.Op Fl e Op Fl p Ar path ... +.Op Fl U Ar cache +.Ar dataset Op Ar object ... +.Nm +.Fl C +.Op Fl A +.Op Fl U Ar cache +.Nm +.Fl l +.Op Fl Aqu +.Ar device +.Nm +.Fl m +.Op Fl AFLPX +.Op Fl t Ar txg +.Op Fl e Op Fl p Ar path ... +.Op Fl U Ar cache +.Ar poolname Op Ar vdev Op Ar metaslab ... +.Nm +.Fl O +.Ar dataset path +.Nm +.Fl R +.Op Fl A +.Op Fl e Op Fl p Ar path ... +.Op Fl U Ar cache +.Ar poolname vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op : Ns Ar flags +.Nm +.Fl S +.Op Fl AP +.Op Fl e Op Fl p Ar path ... +.Op Fl U Ar cache +.Ar poolname +.Sh DESCRIPTION +The +.Nm +utility displays information about a ZFS pool useful for debugging and performs +some amount of consistency checking. +It is a not a general purpose tool and options +.Pq and facilities +may change. +This is neither a +.Xr fsck 1M +nor an +.Xr fsdb 1M +utility. +.Pp The output of this command in general reflects the on-disk structure of a ZFS -pool, and is inherently unstable. The precise output of most invocations is -not documented, a knowledge of ZFS internals is assumed. - -.P -If the \fIdataset\fR argument does not contain any \fB/\fR or \fB@\fR -characters, it is interpreted as a pool name. The root dataset can be -specified as \fIpool\fB/\fR (pool name followed by a slash). - -.P +pool, and is inherently unstable. +The precise output of most invocations is not documented, a knowledge of ZFS +internals is assumed. +.Pp +If the +.Ar dataset +argument does not contain any +.Qq Sy / +or +.Qq Sy @ +characters, it is interpreted as a pool name. +The root dataset can be specified as +.Ar pool Ns / +.Pq pool name followed by a slash . +.Pp When operating on an imported and active pool it is possible, though unlikely, that zdb may interpret inconsistent pool data and behave erratically. - -.SH "OPTIONS" +.Sh OPTIONS Display options: - -.sp -.ne 2 -.na -\fB-b\fR -.ad -.sp .6 -.RS 4n -Display statistics regarding the number, size (logical, physical and -allocated) and deduplication of blocks. -.RE - -.sp -.ne 2 -.na -\fB-c\fR -.ad -.sp .6 -.RS 4n +.Bl -tag -width Ds +.It Fl b +Display statistics regarding the number, size +.Pq logical, physical and allocated +and deduplication of blocks. +.It Fl c Verify the checksum of all metadata blocks while printing block statistics -(see \fB-b\fR). -.sp +.Po see +.Fl b +.Pc . +.Pp If specified multiple times, verify the checksums of all blocks. -.RE - -.sp -.ne 2 -.na -\fB-C\fR -.ad -.sp .6 -.RS 4n -Display information about the configuration. If specified with no other -options, instead display information about the cache file -(\fB/etc/zfs/zpool.cache\fR). To specify the cache file to display, see -\fB-U\fR. -.P -If specified multiple times, and a pool name is also specified display both -the cached configuration and the on-disk configuration. If specified multiple -times with \fB-e\fR also display the configuration that would be used were the -pool to be imported. -.RE - -.sp -.ne 2 -.na -\fB-d\fR -.ad -.sp .6 -.RS 4n -Display information about datasets. Specified once, displays basic dataset -information: ID, create transaction, size, and object count. -.sp +.It Fl C +Display information about the configuration. +If specified with no other options, instead display information about the cache +file +.Pq Pa /etc/zfs/zpool.cache . +To specify the cache file to display, see +.Fl U . +.Pp +If specified multiple times, and a pool name is also specified display both the +cached configuration and the on-disk configuration. +If specified multiple times with +.Fl e +also display the configuration that would be used were the pool to be imported. +.It Fl d +Display information about datasets. +Specified once, displays basic dataset information: ID, create transaction, +size, and object count. +.Pp If specified multiple times provides greater and greater verbosity. -.sp -If object IDs are specified, display information about those specific objects only. -.RE - -.sp -.ne 2 -.na -\fB-D\fR -.ad -.sp .6 -.RS 4n -Display deduplication statistics, including the deduplication ratio (dedup), -compression ratio (compress), inflation due to the zfs copies property -(copies), and an overall effective ratio (dedup * compress / copies). -.sp -If specified twice, display a histogram of deduplication statistics, showing -the allocated (physically present on disk) and referenced (logically -referenced in the pool) block counts and sizes by reference count. -.sp -If specified a third time, display the statistics independently for each deduplication table. -.sp -If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks. -.sp -If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks. -.RE - -.sp -.ne 2 -.na -\fB-h\fR -.ad -.sp .6 -.RS 4n -Display pool history similar to \fBzpool history\fR, but include internal -changes, transaction, and dataset information. -.RE - -.sp -.ne 2 -.na -\fB-i\fR -.ad -.sp .6 -.RS 4n -Display information about intent log (ZIL) entries relating to each -dataset. If specified multiple times, display counts of each intent log -transaction type. -.RE - -.sp -.ne 2 -.na -\fB-l\fR \fIdevice\fR -.ad -.sp .6 -.RS 4n -Read the vdev labels from the specified device. \fBzdb -l\fR will return 0 if -valid label was found, 1 if error occured, and 2 if no valid labels were found. -.P -If the \fB-u\fR option is also specified, also display the uberblocks on this -device. -.P -If the \fB-q\fR option is also specified, don't print the labels. -.RE - -.sp -.ne 2 -.na -\fB-L\fR -.ad -.sp .6 -.RS 4n -Disable leak tracing and the loading of space maps. By default, \fBzdb\fR +.Pp +If object IDs are specified, display information about those specific objects +only. +.It Fl D +Display deduplication statistics, including the deduplication ratio +.Pq Sy dedup , +compression ratio +.Pq Sy compress , +inflation due to the zfs copies property +.Pq Sy copies , +and an overall effective ratio +.Pq Sy dedup No * Sy compress No / Sy copies . +.It Fl DD +Display a histogram of deduplication statistics, showing the allocated +.Pq physically present on disk +and referenced +.Pq logically referenced in the pool +block counts and sizes by reference count. +.It Fl DDD +Display the statistics independently for each deduplication table. +.It Fl DDDD +Dump the contents of the deduplication tables describing duplicate blocks. +.It Fl DDDDD +Also dump the contents of the deduplication tables describing unique blocks. +.It Fl h +Display pool history similar to +.Nm zpool Cm history , +but include internal changes, transaction, and dataset information. +.It Fl i +Display information about intent log +.Pq ZIL +entries relating to each dataset. +If specified multiple times, display counts of each intent log transaction type. +.It Fl l Ar device +Read the vdev labels from the specified device. +.Nm Fl l +will return 0 if valid label was found, 1 if error occurred, and 2 if no valid +labels were found. +.Pp +If the +.Fl q +option is also specified, don't print the labels. +.Pp +If the +.Fl u +option is also specified, also display the uberblocks on this device. +.It Fl L +Disable leak tracing and the loading of space maps. +By default, +.Nm verifies that all non-free blocks are referenced, which can be very expensive. -.RE - -.sp -.ne 2 -.na -\fB-m\fR -.ad -.sp .6 -.RS 4n +.It Fl m Display the offset, spacemap, and free space of each metaslab. -When specified twice, also display information about the on-disk free -space histogram associated with each metaslab. When specified three time, -display the maximum contiguous free space, the in-core free space histogram, -and the percentage of free space in each space map. When specified -four times display every spacemap record. -.RE - -.sp -.ne 2 -.na -\fB-M\fR -.ad -.sp .6 -.RS 4n +.It Fl mm +Also display information about the on-disk free space histogram associated with +each metaslab. +.It Fl mmm +Display the maximum contiguous free space, the in-core free space histogram, and +the percentage of free space in each space map. +.It Fl mmmm +Display every spacemap record. +.It Fl M Display the offset, spacemap, and free space of each metaslab. -When specified twice, also display information about the maximum contiguous -free space and the percentage of free space in each space map. When specified -three times display every spacemap record. -.RE - -.sp -.ne 2 -.na -\fB-R\fR \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR] -.ad -.sp .6 -.RS 4n -Read and display a block from the specified device. By default the block is -displayed as a hex dump, but see the description of the \'r\' flag, below. -.sp -The block is specified in terms of a colon-separated tuple \fIvdev\fR (an -integer vdev identifier) \fIoffset\fR (the offset within the vdev) \fIsize\fR -(the size of the block to read) and, optionally, \fIflags\fR (a set of flags, -described below). - -.sp -.ne 2 -.na -\fBb\fR \fIoffset\fR -.ad -.sp .6 -.RS 4n +.It Fl MM +Also display information about the maximum contiguous free space and the +percentage of free space in each space map. +.It Fl MMM +Display every spacemap record. +.It Fl O Ar dataset path +Look up the specified +.Ar path +inside of the +.Ar dataset +and display its metadata and indirect blocks. +Specified +.Ar path +must be relative to the root of +.Ar dataset . +This option can be combined with +.Fl v +for increasing verbosity. +.It Fl R Ar poolname vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op : Ns Ar flags +Read and display a block from the specified device. +By default the block is displayed as a hex dump, but see the description of the +.Sy r +flag, below. +.Pp +The block is specified in terms of a colon-separated tuple +.Ar vdev +.Pq an integer vdev identifier +.Ar offset +.Pq the offset within the vdev +.Ar size +.Pq the size of the block to read +and, optionally, +.Ar flags +.Pq a set of flags, described below . +.Pp +.Bl -tag -compact -width "b offset" +.It Sy b Ar offset Print block pointer -.RE - -.sp -.ne 2 -.na -\fBd\fR -.ad -.sp .6 -.RS 4n +.It Sy d Decompress the block -.RE - -.sp -.ne 2 -.na -\fBe\fR -.ad -.sp .6 -.RS 4n +.It Sy e Byte swap the block -.RE - -.sp -.ne 2 -.na -\fBg\fR -.ad -.sp .6 -.RS 4n +.It Sy g Dump gang block header -.RE - -.sp -.ne 2 -.na -\fBi\fR -.ad -.sp .6 -.RS 4n +.It Sy i Dump indirect block -.RE - -.sp -.ne 2 -.na -\fBr\fR -.ad -.sp .6 -.RS 4n +.It Sy r Dump raw uninterpreted block data -.RE -.RE - -.sp -.ne 2 -.na -\fB-s\fR -.ad -.sp .6 -.RS 4n -Report statistics on \fBzdb\fR\'s I/O. Display operation counts, bandwidth, -and error counts of I/O to the pool from \fBzdb\fR. -.RE - -.sp -.ne 2 -.na -\fB-S\fR -.ad -.sp .6 -.RS 4n +.El +.It Fl s +Report statistics on +.Nm zdb +I/O. +Display operation counts, bandwidth, and error counts of I/O to the pool from *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 14 16:59:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F27D7D3EDB3; Fri, 14 Apr 2017 16:59:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C49AF1AC; Fri, 14 Apr 2017 16:59:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EGxraX031102; Fri, 14 Apr 2017 16:59:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EGxr3B031101; Fri, 14 Apr 2017 16:59:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141659.v3EGxr3B031101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 16:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316863 - vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 16:59:55 -0000 Author: avg Date: Fri Apr 14 16:59:53 2017 New Revision: 316863 URL: https://svnweb.freebsd.org/changeset/base/316863 Log: 3871 fix issues introduced by 3604 illumos/illumos-gate@de05b58863498b10283637eb9ac85e92fe85150e https://github.com/illumos/illumos-gate/commit/de05b58863498b10283637eb9ac85e92fe85150e https://www.illumos.org/issues/3871 GCC 4.5.3 on Gentoo Linux did not like a few of the changes made in the issue 3604 patch. It printed an error and a couple of warnings: ../../cmd/zdb/zdb.c: In function 'dump_bpobj': ../../cmd/zdb/zdb.c:1257:3: error: 'for' loop initial declarations are only allowed in C99 mode ../../cmd/zdb/zdb.c:1257:3: note: use option -std=c99 or -std=gnu99 to compile your code ../../cmd/zdb/zdb.c: In function 'dump_deadlist': ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format Reviewed by: Paul Dagnelie Reviewed by: Matthew Ahrens Reviewed by: Serapheim Dimitropoulos Approved by: Dan McDonald Author: Richard Yao Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:58:41 2017 (r316862) +++ vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:59:53 2017 (r316863) @@ -1564,7 +1564,8 @@ dump_deadlist(dsl_deadlist_t *dl) dle = AVL_NEXT(&dl->dl_tree, dle)) { if (dump_opt['d'] >= 5) { char buf[128]; - (void) snprintf(buf, sizeof (buf), "mintxg %llu -> ", + (void) snprintf(buf, sizeof (buf), + "mintxg %llu -> obj %llu", (longlong_t)dle->dle_mintxg, (longlong_t)dle->dle_bpobj.bpo_object); From owner-svn-src-all@freebsd.org Fri Apr 14 17:01:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5002ED3EF85; Fri, 14 Apr 2017 17:01:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13C493E1; Fri, 14 Apr 2017 17:01:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EH11kf031916; Fri, 14 Apr 2017 17:01:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EH11qq031914; Fri, 14 Apr 2017 17:01:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141701.v3EH11qq031914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316864 - in vendor/illumos/dist: cmd/zdb man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:01:02 -0000 Author: avg Date: Fri Apr 14 17:01:00 2017 New Revision: 316864 URL: https://svnweb.freebsd.org/changeset/base/316864 Log: 6392 zdb: introduce -V for verbatim import illumos/illumos-gate@dfd5965f7e43b6a630e5ac86708ae76b4f02cc40 https://github.com/illumos/illumos-gate/commit/dfd5965f7e43b6a630e5ac86708ae76b4f02cc40 https://www.illumos.org/issues/6392 When given a pool name via -e, zdb would attempt an import. If it failed, then it would attempt a verbatim import. This behavior is not always desirable so a -V switch is added to zdb to control the behavior. When specified, a verbatim import is done. Otherwise, the behavior is as it was previously, except no verbatim import is done on failure. https://github.com/zfsonlinux/zfs/commit/a5778ea2427bd340e3b4f697d9b6e1452bd71909 Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Reviewed by: Yuri Pankov Reviewed by: Brian Behlendorf Reviewed by: Matt Ahrens Reviewed by: Pavel Zakharov Approved by: Dan McDonald Author: Richard Yao Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/man/man1m/zdb.1m Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 16:59:53 2017 (r316863) +++ vendor/illumos/dist/cmd/zdb/zdb.c Fri Apr 14 17:01:00 2017 (r316864) @@ -120,20 +120,21 @@ static void usage(void) { (void) fprintf(stderr, - "Usage:\t%s [-AbcdDFGhiLMPsvX] [-e [-p ...]] " + "Usage:\t%s [-AbcdDFGhiLMPsvX] [-e [-V] [-p ...]] " "[-I ]\n" "\t\t[-o =]... [-t ] [-U ] [-x ]\n" "\t\t[ [ ...]]\n" - "\t%s [-AdiPv] [-e [-p ...]] [-U ] " + "\t%s [-AdiPv] [-e [-V] [-p ...]] [-U ] " "[ ...]\n" "\t%s -C [-A] [-U ]\n" "\t%s -l [-Aqu] \n" - "\t%s -m [-AFLPX] [-e [-p ...]] [-t ] [-U ]\n" - "\t\t [ [ ...]]\n" + "\t%s -m [-AFLPX] [-e [-V] [-p ...]] [-t ] " + "[-U ]\n\t\t [ [ ...]]\n" "\t%s -O \n" - "\t%s -R [-A] [-e [-p ...]] [-U ]\n" + "\t%s -R [-A] [-e [-V] [-p ...]] [-U ]\n" "\t\t ::[:]\n" - "\t%s -S [-AP] [-e [-p ...]] [-U ] \n\n", + "\t%s -S [-AP] [-e [-V] [-p ...]] [-U ] " + "\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); @@ -188,6 +189,7 @@ usage(void) (void) fprintf(stderr, " -u uberblock\n"); (void) fprintf(stderr, " -U -- use alternate " "cachefile\n"); + (void) fprintf(stderr, " -V do verbatim import\n"); (void) fprintf(stderr, " -x -- " "dump all read blocks into specified directory\n"); (void) fprintf(stderr, " -X attempt extreme rewind (does not " @@ -3707,6 +3709,7 @@ main(int argc, char **argv) char *target; nvlist_t *policy = NULL; uint64_t max_txg = UINT64_MAX; + int flags = ZFS_IMPORT_MISSING_LOG; int rewind = ZPOOL_NEVER_REWIND; char *spa_config_path_env; boolean_t target_is_spa = B_TRUE; @@ -3726,7 +3729,7 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "AbcCdDeFGhiI:lLmMo:Op:PqRsSt:uU:vx:X")) != -1) { + "AbcCdDeFGhiI:lLmMo:Op:PqRsSt:uU:vVx:X")) != -1) { switch (c) { case 'b': case 'c': @@ -3800,6 +3803,9 @@ main(int argc, char **argv) case 'v': verbose++; break; + case 'V': + flags = ZFS_IMPORT_VERBATIM; + break; case 'x': vn_dumpdir = optarg; break; @@ -3899,11 +3905,7 @@ main(int argc, char **argv) fatal("can't open '%s': %s", target, strerror(ENOMEM)); } - if ((error = spa_import(name, cfg, NULL, - ZFS_IMPORT_MISSING_LOG)) != 0) { - error = spa_import(name, cfg, NULL, - ZFS_IMPORT_VERBATIM); - } + error = spa_import(name, cfg, NULL, flags); } } Modified: vendor/illumos/dist/man/man1m/zdb.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zdb.1m Fri Apr 14 16:59:53 2017 (r316863) +++ vendor/illumos/dist/man/man1m/zdb.1m Fri Apr 14 17:01:00 2017 (r316864) @@ -22,7 +22,7 @@ .Sh SYNOPSIS .Nm .Op Fl AbcdDFGhiLMPsvX -.Op Fl e Op Fl p Ar path ... +.Op Fl e Oo Fl V Oc Op Fl p Ar path ... .Op Fl I Ar inflight I/Os .Oo Fl o Ar var Ns = Ns Ar value Oc Ns ... .Op Fl t Ar txg @@ -31,7 +31,7 @@ .Op Ar poolname Op Ar object ... .Nm .Op Fl AdiPv -.Op Fl e Op Fl p Ar path ... +.Op Fl e Oo Fl V Oc Op Fl p Ar path ... .Op Fl U Ar cache .Ar dataset Op Ar object ... .Nm @@ -45,8 +45,8 @@ .Nm .Fl m .Op Fl AFLPX +.Op Fl e Oo Fl V Oc Op Fl p Ar path ... .Op Fl t Ar txg -.Op Fl e Op Fl p Ar path ... .Op Fl U Ar cache .Ar poolname Op Ar vdev Op Ar metaslab ... .Nm @@ -55,13 +55,13 @@ .Nm .Fl R .Op Fl A -.Op Fl e Op Fl p Ar path ... +.Op Fl e Oo Fl V Oc Op Fl p Ar path ... .Op Fl U Ar cache .Ar poolname vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op : Ns Ar flags .Nm .Fl S .Op Fl AP -.Op Fl e Op Fl p Ar path ... +.Op Fl e Oo Fl V Oc Op Fl p Ar path ... .Op Fl U Ar cache .Ar poolname .Sh DESCRIPTION @@ -316,6 +316,11 @@ Use a cache file other than .It Fl v Enable verbosity. Specify multiple times for increased verbosity. +.It Fl V +Attempt verbatim import. +This mimics the behavior of the kernel when loading a pool from a cachefile. +Only usable with +.Fl e . .It Fl X Attempt .Qq extreme From owner-svn-src-all@freebsd.org Fri Apr 14 17:02:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67447D3EFE6; Fri, 14 Apr 2017 17:02:25 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37A7699D; Fri, 14 Apr 2017 17:02:25 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EH2OX7032026; Fri, 14 Apr 2017 17:02:24 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EH2OrW032025; Fri, 14 Apr 2017 17:02:24 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704141702.v3EH2OrW032025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 14 Apr 2017 17:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316865 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:02:25 -0000 Author: bde Date: Fri Apr 14 17:02:24 2017 New Revision: 316865 URL: https://svnweb.freebsd.org/changeset/base/316865 Log: Adjust shifting so that cursor widths up to 17 (was 9) work in vga planar mode. Direct mode always supported widths up to 32, except for its hard-coded 16s matching the pixmap size. Text mode is still limited to 9 its 2x2 character cell method and missing adjustments for the gap between characters, if any. Cursor heights can be almost anything in graphics modes. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Fri Apr 14 17:01:00 2017 (r316864) +++ head/sys/dev/syscons/scvgarndr.c Fri Apr 14 17:02:24 2017 (r316865) @@ -1045,9 +1045,9 @@ draw_pxlmouse_planar(scr_stat *scp, int outw(GDCIDX, 0x0803); /* data rotate/function select (and) */ p = scp->sc->adp->va_window + line_width*y + x/8; for (i = y, j = 0; i < ymax; ++i, ++j) { - m = ~((mouse_and_mask[j] & ~mouse_or_mask[j]) >> xoff); - for (k = 0; k < 2; ++k) { - m1 = m >> (8 * (1 - k)); + m = ~((mouse_and_mask[j] & ~mouse_or_mask[j]) << 8 >> xoff); + for (k = 0; k < 3; ++k) { + m1 = m >> (8 * (2 - k)); if (m1 != 0xff && x + 8 * k < scp->xpixel) { readb(p + k); writeb(p + k, m1); @@ -1058,9 +1058,9 @@ draw_pxlmouse_planar(scr_stat *scp, int outw(GDCIDX, 0x1003); /* data rotate/function select (or) */ p = scp->sc->adp->va_window + line_width*y + x/8; for (i = y, j = 0; i < ymax; ++i, ++j) { - m = mouse_or_mask[j] >> xoff; - for (k = 0; k < 2; ++k) { - m1 = m >> (8 * (1 - k)); + m = mouse_or_mask[j] << 8 >> xoff; + for (k = 0; k < 3; ++k) { + m1 = m >> (8 * (2 - k)); if (m1 != 0 && x + 8 * k < scp->xpixel) { readb(p + k); writeb(p + k, m1); From owner-svn-src-all@freebsd.org Fri Apr 14 17:03:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A04F7D3D0D5; Fri, 14 Apr 2017 17:03:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7271AC43; Fri, 14 Apr 2017 17:03:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EH3WnY035123; Fri, 14 Apr 2017 17:03:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EH3W5H035122; Fri, 14 Apr 2017 17:03:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704141703.v3EH3W5H035122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 14 Apr 2017 17:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316866 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:03:33 -0000 Author: markj Date: Fri Apr 14 17:03:32 2017 New Revision: 316866 URL: https://svnweb.freebsd.org/changeset/base/316866 Log: Check for a provider error before enqueuing mirror I/O. We are otherwise susceptible to a race with a concurrent teardown of the mirror provider, causing the I/O to be left uncompleted after the mirror started withering. Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Apr 14 17:02:24 2017 (r316865) +++ head/sys/geom/mirror/g_mirror.c Fri Apr 14 17:03:32 2017 (r316866) @@ -1176,6 +1176,11 @@ g_mirror_start(struct bio *bp) return; } mtx_lock(&sc->sc_queue_mtx); + if (bp->bio_to->error != 0) { + mtx_unlock(&sc->sc_queue_mtx); + g_io_deliver(bp, bp->bio_to->error); + return; + } bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); From owner-svn-src-all@freebsd.org Fri Apr 14 17:08:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEF6BD3D4EC; Fri, 14 Apr 2017 17:08:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F221F7; Fri, 14 Apr 2017 17:08:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EH8bLb035394; Fri, 14 Apr 2017 17:08:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EH8beb035393; Fri, 14 Apr 2017 17:08:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704141708.v3EH8beb035393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 14 Apr 2017 17:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316867 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:08:38 -0000 Author: markj Date: Fri Apr 14 17:08:37 2017 New Revision: 316867 URL: https://svnweb.freebsd.org/changeset/base/316867 Log: Don't set the mirror GEOM softc to NULL in g_mirror_destroy(). At this point we have not rendezvous'ed with the mirror worker thread, and I/O may still be in flight. Various I/O completion paths expect to be able to obtain a reference to the mirror softc from the GEOM, so setting it to NULL may result in various NULL pointer dereferences if the mirror is stopped with -f or the kernel is shut down while a mirror is synchronizing. The worker thread will clear the softc pointer before exiting. Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Apr 14 17:03:32 2017 (r316866) +++ head/sys/geom/mirror/g_mirror.c Fri Apr 14 17:08:37 2017 (r316867) @@ -3076,15 +3076,8 @@ g_mirror_destroy(struct g_mirror_softc * } } - g_topology_lock(); - if (sc->sc_geom->softc == NULL) { - g_topology_unlock(); + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) return (0); - } - sc->sc_geom->softc = NULL; - sc->sc_sync.ds_geom->softc = NULL; - g_topology_unlock(); - sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROY; sc->sc_flags |= G_MIRROR_DEVICE_FLAG_WAIT; G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); From owner-svn-src-all@freebsd.org Fri Apr 14 17:13:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CFF5D3DA35; Fri, 14 Apr 2017 17:13:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 696D3BBD; Fri, 14 Apr 2017 17:13:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHDnnJ039354; Fri, 14 Apr 2017 17:13:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHDna4039350; Fri, 14 Apr 2017 17:13:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141713.v3EHDna4039350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316868 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:13:50 -0000 Author: avg Date: Fri Apr 14 17:13:49 2017 New Revision: 316868 URL: https://svnweb.freebsd.org/changeset/base/316868 Log: 7430 Backfill metadnode more intelligently illumos/illumos-gate@af346df58864e8fe897b1ff1a3a4c12f9294391b https://github.com/illumos/illumos-gate/commit/af346df58864e8fe897b1ff1a3a4c12f9294391b https://www.illumos.org/issues/7430 Description and patch from brought over from the following ZoL commit: https:// github.com/zfsonlinux/zfs/commit/68cbd56e182ab949f58d004778d463aeb3f595c6 Only attempt to backfill lower metadnode object numbers if at least 4096 objects have been freed since the last rescan, and at most once per transaction group. This avoids a pathology in dmu_object_alloc() that caused O(N^2) behavior for create-heavy workloads and substantially improves object creation rates. As summarized by @mahrens in #4636: "Normally, the object allocator simply checks to see if the next object is available. The slow calls happened when dmu_object_alloc() checks to see if it can backfill lower object numbers. This happens every time we move on to a new L1 indirect block (i.e. every 32 * 128 = 4096 objects). When re-checking lower object numbers, we use the on-disk fill count (blkptr_t:blk_fill) to quickly skip over indirect blocks that don’t have enough free dnodes (defined as an L2 with at least 393,216 of 524,288 dnodes free). Therefore, we may find that a block of dnodes has a low (or zero) fill count, and yet we can’t allocate any of its dnodes, because they've been allocated in memory but not yet written to disk. In this case we have to hold each of the dnodes and then notice that it has been allocated in memory. The end result is that allocating N objects in the same TXG can require CPU usage proportional to N^2." Add a tunable dmu_rescan_dnode_threshold to define the number of objects that must be freed before a rescan is performed. Don't bother to export this as a module option because testing doesn't show a compelling reason to change it. The vast majority of the performance gain comes from limit the rescan to at most once per TXG. Reviewed by: Alek Pinchuk Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Approved by: Gordon Ross Author: Ned Bass Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c Fri Apr 14 17:08:37 2017 (r316867) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c Fri Apr 14 17:13:49 2017 (r316868) @@ -36,20 +36,22 @@ dmu_object_alloc(objset_t *os, dmu_objec dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { uint64_t object; - uint64_t L2_dnode_count = DNODES_PER_BLOCK << + uint64_t L1_dnode_count = DNODES_PER_BLOCK << (DMU_META_DNODE(os)->dn_indblkshift - SPA_BLKPTRSHIFT); dnode_t *dn = NULL; - int restarted = B_FALSE; mutex_enter(&os->os_obj_lock); for (;;) { object = os->os_obj_next; /* - * Each time we polish off an L2 bp worth of dnodes - * (2^13 objects), move to another L2 bp that's still - * reasonably sparse (at most 1/4 full). Look from the - * beginning once, but after that keep looking from here. - * If we can't find one, just keep going from here. + * Each time we polish off a L1 bp worth of dnodes (2^12 + * objects), move to another L1 bp that's still reasonably + * sparse (at most 1/4 full). Look from the beginning at most + * once per txg, but after that keep looking from here. + * os_scan_dnodes is set during txg sync if enough objects + * have been freed since the previous rescan to justify + * backfilling again. If we can't find a suitable block, just + * keep going from here. * * Note that dmu_traverse depends on the behavior that we use * multiple blocks of the dnode object before going back to @@ -57,12 +59,19 @@ dmu_object_alloc(objset_t *os, dmu_objec * that property or find another solution to the issues * described in traverse_visitbp. */ - if (P2PHASE(object, L2_dnode_count) == 0) { - uint64_t offset = restarted ? object << DNODE_SHIFT : 0; - int error = dnode_next_offset(DMU_META_DNODE(os), + + if (P2PHASE(object, L1_dnode_count) == 0) { + uint64_t offset; + int error; + if (os->os_rescan_dnodes) { + offset = 0; + os->os_rescan_dnodes = B_FALSE; + } else { + offset = object << DNODE_SHIFT; + } + error = dnode_next_offset(DMU_META_DNODE(os), DNODE_FIND_HOLE, &offset, 2, DNODES_PER_BLOCK >> 2, 0); - restarted = B_TRUE; if (error == 0) object = offset >> DNODE_SHIFT; } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Fri Apr 14 17:08:37 2017 (r316867) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Fri Apr 14 17:13:49 2017 (r316868) @@ -67,6 +67,13 @@ krwlock_t os_lock; */ int dmu_find_threads = 0; +/* + * Backfill lower metadnode objects after this many have been freed. + * Backfilling negatively impacts object creation rates, so only do it + * if there are enough holes to fill. + */ +int dmu_rescan_dnode_threshold = 131072; + static void dmu_objset_find_dp_cb(void *arg); void @@ -1176,6 +1183,13 @@ dmu_objset_sync(objset_t *os, zio_t *pio if (dr->dr_zio) zio_nowait(dr->dr_zio); } + + /* Enable dnode backfill if enough objects have been freed. */ + if (os->os_freed_dnodes >= dmu_rescan_dnode_threshold) { + os->os_rescan_dnodes = B_TRUE; + os->os_freed_dnodes = 0; + } + /* * Free intent log blocks up to this tx. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Fri Apr 14 17:08:37 2017 (r316867) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Fri Apr 14 17:13:49 2017 (r316868) @@ -672,6 +672,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) } if (freeing_dnode) { + dn->dn_objset->os_freed_dnodes++; dnode_sync_free(dn, tx); return; } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Fri Apr 14 17:08:37 2017 (r316867) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Fri Apr 14 17:13:49 2017 (r316868) @@ -112,6 +112,8 @@ struct objset { zil_header_t os_zil_header; list_t os_synced_dnodes; uint64_t os_flags; + uint64_t os_freed_dnodes; + boolean_t os_rescan_dnodes; /* Protected by os_obj_lock */ kmutex_t os_obj_lock; From owner-svn-src-all@freebsd.org Fri Apr 14 17:13:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 495A0D3DB09; Fri, 14 Apr 2017 17:13:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24A37CD1; Fri, 14 Apr 2017 17:13:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHDw2H039406; Fri, 14 Apr 2017 17:13:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHDwdp039404; Fri, 14 Apr 2017 17:13:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704141713.v3EHDwdp039404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 14 Apr 2017 17:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316869 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:13:59 -0000 Author: markj Date: Fri Apr 14 17:13:57 2017 New Revision: 316869 URL: https://svnweb.freebsd.org/changeset/base/316869 Log: Rename two gmirror state flags to make their meanings slightly clearer. No functional change. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Apr 14 17:13:49 2017 (r316868) +++ head/sys/geom/mirror/g_mirror.c Fri Apr 14 17:13:57 2017 (r316869) @@ -1825,7 +1825,7 @@ g_mirror_try_destroy(struct g_mirror_sof } sc->sc_geom->softc = NULL; sc->sc_sync.ds_geom->softc = NULL; - if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_WAIT) != 0) { + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DRAIN) != 0) { g_topology_unlock(); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, &sc->sc_worker); @@ -2911,8 +2911,8 @@ g_mirror_destroy_delayed(void *arg, int sx_xlock(&sc->sc_lock); KASSERT((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) == 0, ("DESTROY flag set on %s.", sc->sc_name)); - KASSERT((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROYING) != 0, - ("DESTROYING flag not set on %s.", sc->sc_name)); + KASSERT((sc->sc_flags & G_MIRROR_DEVICE_FLAG_CLOSEWAIT) != 0, + ("CLOSEWAIT flag not set on %s.", sc->sc_name)); G_MIRROR_DEBUG(1, "Destroying %s (delayed).", sc->sc_name); error = g_mirror_destroy(sc, G_MIRROR_DESTROY_SOFT); if (error != 0) { @@ -2939,7 +2939,7 @@ g_mirror_access(struct g_provider *pp, i g_topology_unlock(); sx_xlock(&sc->sc_lock); if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0 || - (sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROYING) != 0 || + (sc->sc_flags & G_MIRROR_DEVICE_FLAG_CLOSEWAIT) != 0 || LIST_EMPTY(&sc->sc_disks)) { if (acr > 0 || acw > 0 || ace > 0) error = ENXIO; @@ -2948,7 +2948,7 @@ g_mirror_access(struct g_provider *pp, i sc->sc_provider_open += acr + acw + ace; if (pp->acw + acw == 0) g_mirror_idle(sc, 0); - if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROYING) != 0 && + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_CLOSEWAIT) != 0 && sc->sc_provider_open == 0) g_post_event(g_mirror_destroy_delayed, sc, M_WAITOK, sc, NULL); end: @@ -3068,7 +3068,7 @@ g_mirror_destroy(struct g_mirror_softc * g_mirror_sync_stop(disk, 1); } } - sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROYING; + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_CLOSEWAIT; return (EBUSY); case G_MIRROR_DESTROY_HARD: G_MIRROR_DEBUG(1, "Device %s is still open, so it " @@ -3079,7 +3079,7 @@ g_mirror_destroy(struct g_mirror_softc * if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) return (0); sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROY; - sc->sc_flags |= G_MIRROR_DEVICE_FLAG_WAIT; + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DRAIN; G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); sx_xunlock(&sc->sc_lock); mtx_lock(&sc->sc_queue_mtx); Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Fri Apr 14 17:13:49 2017 (r316868) +++ head/sys/geom/mirror/g_mirror.h Fri Apr 14 17:13:57 2017 (r316869) @@ -157,8 +157,8 @@ struct g_mirror_event { }; #define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL -#define G_MIRROR_DEVICE_FLAG_WAIT 0x0200000000000000ULL -#define G_MIRROR_DEVICE_FLAG_DESTROYING 0x0400000000000000ULL +#define G_MIRROR_DEVICE_FLAG_DRAIN 0x0200000000000000ULL +#define G_MIRROR_DEVICE_FLAG_CLOSEWAIT 0x0400000000000000ULL #define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL #define G_MIRROR_DEVICE_FLAG_WIPE 0x1000000000000000ULL From owner-svn-src-all@freebsd.org Fri Apr 14 17:15:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A37DCD3DE89; Fri, 14 Apr 2017 17:15:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EA7F217; Fri, 14 Apr 2017 17:15:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHFBoa039515; Fri, 14 Apr 2017 17:15:11 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHFBfs039513; Fri, 14 Apr 2017 17:15:11 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141715.v3EHFBfs039513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316870 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:15:12 -0000 Author: avg Date: Fri Apr 14 17:15:11 2017 New Revision: 316870 URL: https://svnweb.freebsd.org/changeset/base/316870 Log: 7448 ZFS doesn't notice when disk vdevs have no write cache illumos/illumos-gate@295438ba3230419314faaa889a2616f561658bd5 https://github.com/illumos/illumos-gate/commit/295438ba3230419314faaa889a2616f561658bd5 https://www.illumos.org/issues/7448 I built a SmartOS image with all the NVMe commits including 7372 (support NVMe volatile write cache) and repeated my dd testing: > #!/bin/bash > for i in `seq 1 1000`; do > dd if=/dev/zero of=file00 bs=1M count=102400 oflag=sync & > dd if=/dev/zero of=file01 bs=1M count=102400 oflag=sync & > wait > rm file00 file01 > done > Previously each dd command took ~145 seconds to finish, now it takes ~400 seconds. Eventually I figured out it is 7372 that causes unnecessary nvme_bd_sync() executions which wasted CPU cycles. If a NVMe device doesn't support a write cache, the nvme_bd_sync function will return ENOTSUP to indicate this to upper layers. It seems this returned value is ignored by ZFS, and as such this bug is not really specific to NVMe. In vdev_disk_io_start() ZFS sends the flush to the disk driver (blkdev) with a callback to vdev_disk_ioctl_done(). As nvme filled in the bd_sync_cache function pointer, blkdev will not return ENOTSUP, as the nvme driver in general does support cache flush. Instead it will issue an asynchronous flush to nvme and immediately return 0, and hence ZFS will not set vdev_nowritecache here. The nvme driver will at some point process the cache flush command, and if there is no write cache on the device it will return ENOTSUP, which will be delivered to the vdev_disk_ioctl_done() callback. This function will not check the error code and not set nowritecache. The right place to check the error code from the cache flush is in zio_vdev_io_assess(). This would catch both cases, synchronous and asynchronous cache flushes. This would also be independent of the implementation detail that some drivers can return ENOTSUP immediately. Reviewed by: Dan Fields Reviewed by: Alek Pinchuk Reviewed by: George Wilson Approved by: Dan McDonald Author: Hans Rosenfeld Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Fri Apr 14 17:13:57 2017 (r316869) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Fri Apr 14 17:15:11 2017 (r316870) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2016 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ @@ -743,16 +743,6 @@ vdev_disk_io_start(zio_t *zio) return; } - if (error == ENOTSUP || error == ENOTTY) { - /* - * If we get ENOTSUP or ENOTTY, we know that - * no future attempts will ever succeed. - * In this case we set a persistent bit so - * that we don't bother with the ioctl in the - * future. - */ - vd->vdev_nowritecache = B_TRUE; - } zio->io_error = error; break; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Apr 14 17:13:57 2017 (r316869) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Apr 14 17:15:11 2017 (r316870) @@ -3126,6 +3126,16 @@ zio_vdev_io_assess(zio_t *zio) vd->vdev_cant_write = B_TRUE; } + /* + * If a cache flush returns ENOTSUP or ENOTTY, we know that no future + * attempts will ever succeed. In this case we set a persistent bit so + * that we don't bother with it in the future. + */ + if ((zio->io_error == ENOTSUP || zio->io_error == ENOTTY) && + zio->io_type == ZIO_TYPE_IOCTL && + zio->io_cmd == DKIOCFLUSHWRITECACHE && vd != NULL) + vd->vdev_nowritecache = B_TRUE; + if (zio->io_error) zio->io_pipeline = ZIO_INTERLOCK_PIPELINE; From owner-svn-src-all@freebsd.org Fri Apr 14 17:15:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32D60D3DF16; Fri, 14 Apr 2017 17:15:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD1F0392; Fri, 14 Apr 2017 17:15:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHFoDR039632; Fri, 14 Apr 2017 17:15:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHFovE039631; Fri, 14 Apr 2017 17:15:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141715.v3EHFovE039631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316871 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:15:51 -0000 Author: avg Date: Fri Apr 14 17:15:49 2017 New Revision: 316871 URL: https://svnweb.freebsd.org/changeset/base/316871 Log: 7490 real checksum errors are silenced when zinject is on illumos/illumos-gate@6cedfc397d92d64e442f0aae4445ac507beaf58f https://github.com/illumos/illumos-gate/commit/6cedfc397d92d64e442f0aae4445ac507beaf58f https://www.illumos.org/issues/7490 When zinject is on, error codes from zfs_checksum_error() can be overwritten due to an incorrect and overly-complex if condition. Reviewed by: George Wilson Reviewed by: Paul Dagnelie Reviewed by: Dan Kimmel Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Pavel Zakharov Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c Fri Apr 14 17:15:11 2017 (r316870) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c Fri Apr 14 17:15:49 2017 (r316871) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2015 by Delphix. All rights reserved. + * Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. */ @@ -388,12 +388,13 @@ zio_checksum_error(zio_t *zio, zio_bad_c error = zio_checksum_error_impl(spa, bp, checksum, data, size, offset, info); - if (error != 0 && zio_injection_enabled && !zio->io_error && - (error = zio_handle_fault_injection(zio, ECKSUM)) != 0) { - info->zbc_injected = 1; - return (error); + if (zio_injection_enabled && error == 0 && zio->io_error == 0) { + error = zio_handle_fault_injection(zio, ECKSUM); + if (error != 0) + info->zbc_injected = 1; } + return (error); } From owner-svn-src-all@freebsd.org Fri Apr 14 17:20:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7599D3E1F8; Fri, 14 Apr 2017 17:20:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 843BCAF5; Fri, 14 Apr 2017 17:20:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHKQYJ040081; Fri, 14 Apr 2017 17:20:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHKQ5I040080; Fri, 14 Apr 2017 17:20:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141720.v3EHKQ5I040080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316872 - vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:20:27 -0000 Author: avg Date: Fri Apr 14 17:20:26 2017 New Revision: 316872 URL: https://svnweb.freebsd.org/changeset/base/316872 Log: 7502 ztest should run zdb with -G (debug mode) illumos/illumos-gate@c3c65d17f7b6689bbd6568a1a1fcc0c4a3bac127 https://github.com/illumos/illumos-gate/commit/c3c65d17f7b6689bbd6568a1a1fcc0c4a3bac127 https://www.illumos.org/issues/7502 Right now ztest executes zdb without -G, so when it has errors, the messages are often not very helpful: Executing zdb -bccsv -d -U /rpool/tmp/zpool.cache ztest zdb: can't open 'ztest': Operation not supported ztest: '/usr/sbin/amd64/zdb -bccsv -d -U /rpool/tmp/zpool.cache ztest' exit code 1 With -G, we'd have: /usr/sbin/amd64/zdb -bccsv -d -U /rpool/tmp/zpool.cache -G ztest zdb: can't open 'ztest': Operation not supported ZFS_DBGMSG(zdb): spa_open_common: opening ztest spa_load(ztest): LOADING spa_load(ztest): FAILED: unable to parse config [error=48] spa_load(ztest): UNLOADING Which indicates where the error came from Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Approved by: Gordon Ross Author: Pavel Zakharov Modified: vendor/illumos/dist/cmd/ztest/ztest.c Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Fri Apr 14 17:15:49 2017 (r316871) +++ vendor/illumos/dist/cmd/ztest/ztest.c Fri Apr 14 17:20:26 2017 (r316872) @@ -5262,7 +5262,7 @@ ztest_run_zdb(char *pool) isa = strdup(isa); /* LINTED */ (void) sprintf(bin, - "/usr/sbin%.*s/zdb -bcc%s%s -d -U %s %s", + "/usr/sbin%.*s/zdb -bcc%s%s -G -d -U %s %s", isalen, isa, ztest_opts.zo_verbose >= 3 ? "s" : "", From owner-svn-src-all@freebsd.org Fri Apr 14 17:22:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37C1BD3E384; Fri, 14 Apr 2017 17:22:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E19C6EC2; Fri, 14 Apr 2017 17:22:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHMtfn043830; Fri, 14 Apr 2017 17:22:55 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHMtS6043829; Fri, 14 Apr 2017 17:22:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141722.v3EHMtS6043829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316873 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:22:56 -0000 Author: avg Date: Fri Apr 14 17:22:54 2017 New Revision: 316873 URL: https://svnweb.freebsd.org/changeset/base/316873 Log: 7233 dir_is_empty should open directory with CLOEXEC illumos/illumos-gate@d420209d9c807f782c1d31f5683be74798142198 https://github.com/illumos/illumos-gate/commit/d420209d9c807f782c1d31f5683be74798142198 https://www.illumos.org/issues/7233 This fixes a race where one thread is executing zfs_mount() while another thread forks and execs. If the fork occurs while the directory is open, the child process will inherit (but not necessarily close immediately) the open fd for the directory, preventing the mount. Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Approved by: Richard Lowe Author: Alex Reece Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Fri Apr 14 17:20:26 2017 (r316872) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Fri Apr 14 17:22:54 2017 (r316873) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014 by Delphix. All rights reserved. + * Copyright (c) 2014, 2015 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov */ @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -179,9 +180,16 @@ dir_is_empty(const char *dirname) { DIR *dirp; struct dirent64 *dp; + int dirfd; - if ((dirp = opendir(dirname)) == NULL) + if ((dirfd = openat(AT_FDCWD, dirname, + O_RDONLY | O_NDELAY | O_LARGEFILE | O_CLOEXEC, 0)) < 0) { return (B_TRUE); + } + + if ((dirp = fdopendir(dirfd)) == NULL) { + return (B_TRUE); + } while ((dp = readdir64(dirp)) != NULL) { From owner-svn-src-all@freebsd.org Fri Apr 14 17:23:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10D85D3E3D2; Fri, 14 Apr 2017 17:23:30 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8FBAFED; Fri, 14 Apr 2017 17:23:29 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHNSDt043903; Fri, 14 Apr 2017 17:23:28 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHNS3B043902; Fri, 14 Apr 2017 17:23:28 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201704141723.v3EHNS3B043902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 14 Apr 2017 17:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316874 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:23:30 -0000 Author: sobomax Date: Fri Apr 14 17:23:28 2017 New Revision: 316874 URL: https://svnweb.freebsd.org/changeset/base/316874 Log: Restore ability to shutdown DGRAM sockets, still forcing ENOTCONN to be returned by the shutdown(2) system call. This ability has been lost as part of the svn revision 285910. Reviewed by: ed, rwatson, glebius, hiren MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10351 Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Apr 14 17:22:54 2017 (r316873) +++ head/sys/kern/uipc_socket.c Fri Apr 14 17:23:28 2017 (r316874) @@ -2343,13 +2343,27 @@ int soshutdown(struct socket *so, int how) { struct protosw *pr = so->so_proto; - int error; + int error, soerror_enotconn; if (!(how == SHUT_RD || how == SHUT_WR || how == SHUT_RDWR)) return (EINVAL); + + soerror_enotconn = 0; if ((so->so_state & - (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) - return (ENOTCONN); + (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) { + /* + * POSIX mandates us to return ENOTCONN when shutdown(2) is + * invoked on a datagram sockets, however historically we would + * actually tear socket down. This is known to be leveraged by + * some applications to unblock process waiting in recvXXX(2) + * by other process that it shares that socket with. Try to meet + * both backward-compatibility and POSIX requirements by forcing + * ENOTCONN but still asking protocol to perform pru_shutdown(). + */ + if (so->so_type != SOCK_DGRAM) + return (ENOTCONN); + soerror_enotconn = 1; + } CURVNET_SET(so->so_vnet); if (pr->pr_usrreqs->pru_flush != NULL) @@ -2360,11 +2374,12 @@ soshutdown(struct socket *so, int how) error = (*pr->pr_usrreqs->pru_shutdown)(so); wakeup(&so->so_timeo); CURVNET_RESTORE(); - return (error); + return ((error == 0 && soerror_enotconn) ? ENOTCONN : error); } wakeup(&so->so_timeo); CURVNET_RESTORE(); - return (0); + + return (soerror_enotconn ? ENOTCONN : 0); } void From owner-svn-src-all@freebsd.org Fri Apr 14 17:23:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC7C9D3E447; Fri, 14 Apr 2017 17:23:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFF2D1FA; Fri, 14 Apr 2017 17:23:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHNq1N043959; Fri, 14 Apr 2017 17:23:52 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHNqu3043958; Fri, 14 Apr 2017 17:23:52 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141723.v3EHNqu3043958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316875 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:23:54 -0000 Author: avg Date: Fri Apr 14 17:23:52 2017 New Revision: 316875 URL: https://svnweb.freebsd.org/changeset/base/316875 Log: 7336 vfork and O_CLOEXEC causes zfs_mount EBUSY illumos/illumos-gate@873c4903a52d089cd8234b79d24f5a3fc3bccc82 https://github.com/illumos/illumos-gate/commit/873c4903a52d089cd8234b79d24f5a3fc3bccc82 https://www.illumos.org/issues/7336 We can run into a problem where we call into zfs_mount, which in turn calls is_dir_empty, which opens the directory to try and make sure it's empty. The issue with the current approach is that it holds the directory open while it traverses it with readdir, which, due to subtle interaction with the Java JVM, vfork, and exec can cause a tricky race condition resulting in zfs_mount failures. The approach to resolving the issue in this patch is to drop the usage of readdir altogether, and instead rely on the fact that ZFS stores the number of entries contained in a directory using the st_size field of the stat structure. Thus, if the directory in question is a ZFS directory, we can check to see if it's empty by calling stat() and inspecting the st_size field of structure returned. =============================================================================== The root cause appears to be an interesting race between vfork, exec, and zfs_mount's usage of O_CLOEXEC when calling openat. Here's what is going on: 1. We call zfs_mount, and this in turn calls openat to check if the directory is empty, which results in opening the directory we're trying to mount onto, and increment v_count. 2. As we're in the middle of reading the directory, vfork is called by the JVM and proceeds to exec the jspawnhelper utility. As a result of the vfork, we take an additional hold on the directory, which increments v_count a second time. The semantics of vfork mean the parent process will wait for the child process to exit or exec before the parent can continue; at this point the parent is in the middle of zfs_mount, reading the directory to determine if it's empty or not. 3. The child process exec-ing jspawnhelper gets to the relvm call within exec_args (which is called by exec_common). relvm is the function that releases the parent process, allowing the parent to proceed. The problem is, at this point of calling relvm, the child hasn't yet called close_exec which is responsible for closing the file descriptors inherited from the parent process Reviewed by: Matt Ahrens Reviewed by: Paul Dagnelie Reviewed by: Robert Mustacchi Approved by: Dan McDonald Author: Prakash Surya Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Fri Apr 14 17:23:28 2017 (r316874) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Fri Apr 14 17:23:52 2017 (r316875) @@ -75,6 +75,7 @@ #include #include #include +#include #include @@ -170,13 +171,32 @@ is_shared(libzfs_handle_t *hdl, const ch return (SHARED_NOT_SHARED); } -/* - * Returns true if the specified directory is empty. If we can't open the - * directory at all, return true so that the mount can fail with a more - * informative error message. - */ static boolean_t -dir_is_empty(const char *dirname) +dir_is_empty_stat(const char *dirname) +{ + struct stat st; + + /* + * We only want to return false if the given path is a non empty + * directory, all other errors are handled elsewhere. + */ + if (stat(dirname, &st) < 0 || !S_ISDIR(st.st_mode)) { + return (B_TRUE); + } + + /* + * An empty directory will still have two entries in it, one + * entry for each of "." and "..". + */ + if (st.st_size > 2) { + return (B_FALSE); + } + + return (B_TRUE); +} + +static boolean_t +dir_is_empty_readdir(const char *dirname) { DIR *dirp; struct dirent64 *dp; @@ -206,6 +226,42 @@ dir_is_empty(const char *dirname) } /* + * Returns true if the specified directory is empty. If we can't open the + * directory at all, return true so that the mount can fail with a more + * informative error message. + */ +static boolean_t +dir_is_empty(const char *dirname) +{ + struct statvfs64 st; + + /* + * If the statvfs call fails or the filesystem is not a ZFS + * filesystem, fall back to the slow path which uses readdir. + */ + if ((statvfs64(dirname, &st) != 0) || + (strcmp(st.f_basetype, "zfs") != 0)) { + return (dir_is_empty_readdir(dirname)); + } + + /* + * At this point, we know the provided path is on a ZFS + * filesystem, so we can use stat instead of readdir to + * determine if the directory is empty or not. We try to avoid + * using readdir because that requires opening "dirname"; this + * open file descriptor can potentially end up in a child + * process if there's a concurrent fork, thus preventing the + * zfs_mount() from otherwise succeeding (the open file + * descriptor inherited by the child process will cause the + * parent's mount to fail with EBUSY). The performance + * implications of replacing the open, read, and close with a + * single stat is nice; but is not the main motivation for the + * added complexity. + */ + return (dir_is_empty_stat(dirname)); +} + +/* * Checks to see if the mount is active. If the filesystem is mounted, we fill * in 'where' with the current mountpoint, and return 1. Otherwise, we return * 0. From owner-svn-src-all@freebsd.org Fri Apr 14 17:24:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 613AED3E49B; Fri, 14 Apr 2017 17:24:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2374D386; Fri, 14 Apr 2017 17:24:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHONem044033; Fri, 14 Apr 2017 17:24:23 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHONpS044031; Fri, 14 Apr 2017 17:24:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141724.v3EHONpS044031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316876 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:24:24 -0000 Author: avg Date: Fri Apr 14 17:24:22 2017 New Revision: 316876 URL: https://svnweb.freebsd.org/changeset/base/316876 Log: 7542 zfs_unmount failed with EZFS_UNSHARENFSFAILED illumos/illumos-gate@09c9e6dc9b69d10b771bb87e01040ec320a0bfd3 https://github.com/illumos/illumos-gate/commit/09c9e6dc9b69d10b771bb87e01040ec320a0bfd3 https://www.illumos.org/issues/7542 libshare keeps a cached copy of the sharetab listing in memory, which can become out of date if shares are destroyed or created while leaving a libzfs handle open. This results in a spurious unmounting failure when an NFS share exists but isn't in the stale libshare cache. Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Reviewed by: Matt Amdur Approved by: Robert Mustacchi Author: Chris Williamson Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h Fri Apr 14 17:23:52 2017 (r316875) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h Fri Apr 14 17:24:22 2017 (r316876) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. */ #ifndef _LIBZFS_IMPL_H @@ -72,7 +72,6 @@ struct libzfs_handle { int libzfs_printerr; int libzfs_storeerr; /* stuff error messages into buffer */ void *libzfs_sharehdl; /* libshare handle */ - uint_t libzfs_shareflags; boolean_t libzfs_mnttab_enable; avl_tree_t libzfs_mnttab_cache; int libzfs_pool_iter; @@ -82,8 +81,6 @@ struct libzfs_handle { char libzfs_chassis_id[256]; }; -#define ZFSSHARE_MISS 0x01 /* Didn't find entry in cache */ - struct zfs_handle { libzfs_handle_t *zfs_hdl; zpool_handle_t *zpool_hdl; Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Fri Apr 14 17:23:52 2017 (r316875) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Fri Apr 14 17:24:22 2017 (r316876) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, 2015 by Delphix. All rights reserved. + * Copyright (c) 2014, 2016 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov */ @@ -657,35 +657,30 @@ _zfs_init_libshare(void) int zfs_init_libshare(libzfs_handle_t *zhandle, int service) { - int ret = SA_OK; - if (_sa_init == NULL) - ret = SA_CONFIG_ERR; + return (SA_CONFIG_ERR); - if (ret == SA_OK && zhandle->libzfs_shareflags & ZFSSHARE_MISS) { - /* - * We had a cache miss. Most likely it is a new ZFS - * dataset that was just created. We want to make sure - * so check timestamps to see if a different process - * has updated any of the configuration. If there was - * some non-ZFS change, we need to re-initialize the - * internal cache. - */ - zhandle->libzfs_shareflags &= ~ZFSSHARE_MISS; - if (_sa_needs_refresh != NULL && - _sa_needs_refresh(zhandle->libzfs_sharehdl)) { - zfs_uninit_libshare(zhandle); - zhandle->libzfs_sharehdl = _sa_init(service); - } + /* + * Attempt to refresh libshare. This is necessary if there was a cache + * miss for a new ZFS dataset that was just created, or if state of the + * sharetab file has changed since libshare was last initialized. We + * want to make sure so check timestamps to see if a different process + * has updated any of the configuration. If there was some non-ZFS + * change, we need to re-initialize the internal cache. + */ + if (_sa_needs_refresh != NULL && + _sa_needs_refresh(zhandle->libzfs_sharehdl)) { + zfs_uninit_libshare(zhandle); + zhandle->libzfs_sharehdl = _sa_init(service); } - if (ret == SA_OK && zhandle && zhandle->libzfs_sharehdl == NULL) + if (zhandle && zhandle->libzfs_sharehdl == NULL) zhandle->libzfs_sharehdl = _sa_init(service); - if (ret == SA_OK && zhandle->libzfs_sharehdl == NULL) - ret = SA_NO_MEMORY; + if (zhandle->libzfs_sharehdl == NULL) + return (SA_NO_MEMORY); - return (ret); + return (SA_OK); } /* @@ -831,7 +826,6 @@ zfs_share_proto(zfs_handle_t *zhp, zfs_s zfs_get_name(zhp)); return (-1); } - hdl->libzfs_shareflags |= ZFSSHARE_MISS; share = zfs_sa_find_share(hdl->libzfs_sharehdl, mountpoint); } From owner-svn-src-all@freebsd.org Fri Apr 14 17:27:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85137D3E548; Fri, 14 Apr 2017 17:27:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B6D076F; Fri, 14 Apr 2017 17:27:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHR9fW044188; Fri, 14 Apr 2017 17:27:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHR9Vt044187; Fri, 14 Apr 2017 17:27:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141727.v3EHR9Vt044187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316877 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:27:10 -0000 Author: avg Date: Fri Apr 14 17:27:09 2017 New Revision: 316877 URL: https://svnweb.freebsd.org/changeset/base/316877 Log: 7571 non-present readonly numeric ZFS props do not have default value illumos/illumos-gate@ad2760acbd9c3b479bf632f05c6f03d89830799d https://github.com/illumos/illumos-gate/commit/ad2760acbd9c3b479bf632f05c6f03d89830799d https://www.illumos.org/issues/7571 ZFS displays the default value for non-present readonly numeric (and index) properties. However, these properties default values are not meaningful. Instead, we should display a "-", indicating that they are not present. For example, on a version-12 pool, the usedby* properties are not available, but they show up as the incorrect value "0": 1. zfs get all test12 ... test12 usedbysnapshots 0 - test12 usedbydataset 0 - test12 usedbychildren 0 - test12 usedbyrefreservation 0 - We will be introducing more sometimes-present numeric readonly properties, so it would be nice to fix this. Reviewed by: Dan Kimmel Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Fri Apr 14 17:24:22 2017 (r316876) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Fri Apr 14 17:27:09 2017 (r316877) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. * Copyright (c) 2013 Martin Matuska. All rights reserved. @@ -2038,6 +2038,7 @@ get_numeric_property(zfs_handle_t *zhp, if (zfs_prop_readonly(prop) && *source != NULL && (*source)[0] == '\0') { *source = NULL; + return (-1); } break; From owner-svn-src-all@freebsd.org Fri Apr 14 17:38:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB645D3E8D9; Fri, 14 Apr 2017 17:38:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D924EB6; Fri, 14 Apr 2017 17:38:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHcht5048365; Fri, 14 Apr 2017 17:38:43 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHch8f048364; Fri, 14 Apr 2017 17:38:43 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704141738.v3EHch8f048364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 14 Apr 2017 17:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316878 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:38:44 -0000 Author: bde Date: Fri Apr 14 17:38:43 2017 New Revision: 316878 URL: https://svnweb.freebsd.org/changeset/base/316878 Log: Oops, the previous revision was missing the update of the shift variable. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Fri Apr 14 17:27:09 2017 (r316877) +++ head/sys/dev/syscons/scvgarndr.c Fri Apr 14 17:38:43 2017 (r316878) @@ -1030,7 +1030,7 @@ draw_pxlmouse_planar(scr_stat *scp, int int line_width; int xoff, yoff; int ymax; - u_short m; + uint32_t m; int i, j, k; uint8_t m1; From owner-svn-src-all@freebsd.org Fri Apr 14 17:43:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23D56D3EAFD; Fri, 14 Apr 2017 17:43:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9C0F3B7; Fri, 14 Apr 2017 17:43:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHhqEP052307; Fri, 14 Apr 2017 17:43:52 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHhqIt052306; Fri, 14 Apr 2017 17:43:52 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141743.v3EHhqIt052306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316879 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:43:53 -0000 Author: avg Date: Fri Apr 14 17:43:51 2017 New Revision: 316879 URL: https://svnweb.freebsd.org/changeset/base/316879 Log: missing zfs.1m changes from r286704 Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:38:43 2017 (r316878) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:43:51 2017 (r316879) @@ -175,11 +175,13 @@ .Nm .Cm receive .Op Fl Fnuv +.Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm receive .Op Fl Fnuv .Op Fl d Ns | Ns Fl e +.Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem .Nm .Cm allow @@ -2635,12 +2637,14 @@ origin, etc. .Nm .Cm receive .Op Fl Fnuv +.Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .br .Nm .Cm receive .Op Fl Fnuv .Op Fl d Ns | Ns Fl e +.Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem .Xc Creates a snapshot whose contents are as specified in the stream provided on @@ -2730,6 +2734,10 @@ snapshot as described in the paragraph a Do not actually receive the stream. This can be useful in conjunction with the .Fl v option to verify the name the receive operation would use. +.It Fl o Sy origin Ns = Ns Ar snapshot +Forces the stream to be received as a clone of the given snapshot. +This is only valid if the stream is an incremental stream whose source +is the same as the provided origin. .It Fl u File system that is associated with the received stream is not mounted. .It Fl v From owner-svn-src-all@freebsd.org Fri Apr 14 17:46:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 960FED3EB65; Fri, 14 Apr 2017 17:46:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6661077F; Fri, 14 Apr 2017 17:46:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHkeGV052541; Fri, 14 Apr 2017 17:46:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHkeAu052540; Fri, 14 Apr 2017 17:46:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141746.v3EHkeAu052540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316880 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:46:41 -0000 Author: avg Date: Fri Apr 14 17:46:40 2017 New Revision: 316880 URL: https://svnweb.freebsd.org/changeset/base/316880 Log: missing zfs.1m changes from r289310 Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:43:51 2017 (r316879) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:46:40 2017 (r316880) @@ -908,7 +908,8 @@ command. This property is not inherited. .It Xo .Sy checksum Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy fletcher2 Ns | Ns -.Sy fletcher4 Ns | Ns Sy sha256 Ns | Ns Sy noparity +.Sy fletcher4 Ns | Ns Sy sha256 Ns | Ns Sy noparity Ns | Ns +.Sy sha512 Ns | Ns Sy skein Ns | Ns Sy edonr .Xc Controls the checksum used to verify data integrity. The default value is .Sy on , @@ -927,6 +928,16 @@ should not be used by any other dataset. .Sy NOT a recommended practice. .Pp +The +.Sy sha512 , +.Sy skein , +and +.Sy edonr +checksum algorithms require enabling the appropriate features on the +pool. Please see +.Xr zpool-features 5 +for more information on these algorithms. +.Pp Changing this property affects only newly-written data. .It Xo .Sy compression Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy gzip Ns | Ns From owner-svn-src-all@freebsd.org Fri Apr 14 17:48:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8931D3EBCF; Fri, 14 Apr 2017 17:48:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85BDC8D1; Fri, 14 Apr 2017 17:48:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHmj3P052750; Fri, 14 Apr 2017 17:48:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHmjOA052749; Fri, 14 Apr 2017 17:48:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141748.v3EHmjOA052749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316881 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:48:46 -0000 Author: avg Date: Fri Apr 14 17:48:45 2017 New Revision: 316881 URL: https://svnweb.freebsd.org/changeset/base/316881 Log: missing zfs.1m changes from r289312 Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:46:40 2017 (r316880) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:48:45 2017 (r316881) @@ -173,17 +173,25 @@ .Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm +.Cm send +.Op Fl Penv +.Fl t Ar receive_resume_token +.Nm .Cm receive -.Op Fl Fnuv +.Op Fl Fnsuv .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm receive -.Op Fl Fnuv +.Op Fl Fnsuv .Op Fl d Ns | Ns Fl e .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem .Nm +.Cm receive +.Fl A +.Ar filesystem Ns | Ns Ar volume +.Nm .Cm allow .Ar filesystem Ns | Ns Ar volume .Nm @@ -569,6 +577,13 @@ For cloned file systems or volumes, the created. See also the .Sy clones property. +.It Sy receive_resume_token +For filesystems or volumes which have saved partially-completed state from +.Sy zfs receive -s , +this opaque token can be provided to +.Sy zfs send -t +to resume and complete the +.Sy zfs receive . .It Sy referenced The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it @@ -2646,14 +2661,27 @@ origin, etc. .El .It Xo .Nm +.Cm send +.Op Fl Penv +.Fl t +.Ar receive_resume_token +.Xc +Creates a send stream which resumes an interrupted receive. The +.Ar receive_resume_token +is the value of this property on the filesystem +or volume that was being received into. See the documentation for +.Sy zfs receive -s +for more details. +.It Xo +.Nm .Cm receive -.Op Fl Fnuv +.Op Fl Fnsuv .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .br .Nm .Cm receive -.Op Fl Fnuv +.Op Fl Fnsuv .Op Fl d Ns | Ns Fl e .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem @@ -2754,9 +2782,42 @@ File system that is associated with the .It Fl v Print verbose information about the stream and the time required to perform the receive operation. +.It Fl s +If the receive is interrupted, save the partially received state, rather +than deleting it. Interruption may be due to premature termination of +the stream +.Po e.g. due to network failure or failure of the remote system +if the stream is being read over a network connection +.Pc , +a checksum error in the stream, termination of the +.Nm zfs Cm receive +process, or unclean shutdown of the system. +.Pp +The receive can be resumed with a stream generated by +.Nm zfs Cm send Fl t Ar token , +where the +.Ar token +is the value of the +.Sy receive_resume_token +property of the filesystem or volume which is received into. +.Pp +To use this flag, the storage pool must have the +.Sy extensible_dataset +feature enabled. See +.Xr zpool-features 5 +for details on ZFS feature flags. .El .It Xo .Nm +.Cm receive +.Fl A +.Ar filesystem Ns | Ns Ar volume +.Xc +Abort an interrupted +.Nm zfs Cm receive Fl s , +deleting its saved partially received state. +.It Xo +.Nm .Cm allow .Ar filesystem Ns | Ns Ar volume .Xc From owner-svn-src-all@freebsd.org Fri Apr 14 17:49:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7B34D3EC27; Fri, 14 Apr 2017 17:49:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E11A9F9; Fri, 14 Apr 2017 17:49:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHnb4R052827; Fri, 14 Apr 2017 17:49:37 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHnbUd052826; Fri, 14 Apr 2017 17:49:37 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141749.v3EHnbUd052826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316882 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:49:38 -0000 Author: avg Date: Fri Apr 14 17:49:37 2017 New Revision: 316882 URL: https://svnweb.freebsd.org/changeset/base/316882 Log: 6346 zfs(1M) has spurious comma illumos/illumos-gate@1058dba45ec5d6876a5bbb0b9174347e13e5748d https://github.com/illumos/illumos-gate/commit/1058dba45ec5d6876a5bbb0b9174347e13e5748d https://www.illumos.org/issues/6346 The xref to gzip(1) in the SEE ALSO puts the comma inside the parens, because a space is missing in the source .Xr gzip 1, should be .Xr gzip 1 , It'd be cool if the manual page checks in pbchk could catch this, too, but I'm not sure how easy that'd be. Reviewed by: Garrett D'Amore Reviewed by: Igor Kozhukhov Reviewed by: Robert Mustacchi Approved by: Gordon Ross Author: Yuri Pankov Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:48:45 2017 (r316881) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:49:37 2017 (r316882) @@ -773,7 +773,7 @@ in which case it will be interpreted as this dataset. The .Em snapshot may be a full snapshot name -.No Po Em filesystem Ns @ Ns Em snapshot Pc , +.Po Em filesystem Ns @ Ns Em snapshot Pc , which for clones may be a snapshot in the origin's filesystem .Pq or the origin of the origin's filesystem, etc. .El @@ -1620,7 +1620,7 @@ administrators can use them to annotate .Pq file systems, volumes, and snapshots . .Pp User property names must contain a colon -.No Po Ns Sy \&: Ns Pc +.Pq Qq Sy \&: character to distinguish them from native properties. They may contain lowercase letters, numbers, and the following punctuation characters: colon .Pq Qq Sy \&: , @@ -3527,7 +3527,7 @@ M F /tank/test/modified .Sh INTERFACE STABILITY .Sy Commited . .Sh SEE ALSO -.Xr gzip 1, +.Xr gzip 1 , .Xr ssh 1 , .Xr mount 1M , .Xr share 1M , From owner-svn-src-all@freebsd.org Fri Apr 14 17:52:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8353D3EFCD; Fri, 14 Apr 2017 17:52:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88615EA8; Fri, 14 Apr 2017 17:52:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHql6Y056721; Fri, 14 Apr 2017 17:52:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHql2l056720; Fri, 14 Apr 2017 17:52:47 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141752.v3EHql2l056720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316883 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:52:48 -0000 Author: avg Date: Fri Apr 14 17:52:47 2017 New Revision: 316883 URL: https://svnweb.freebsd.org/changeset/base/316883 Log: missing zfs.1m changes from r294814 Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:49:37 2017 (r316882) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:52:47 2017 (r316883) @@ -21,7 +21,7 @@ .\" .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 2011 Joshua M. Clulow -.\" Copyright (c) 2011, 2014 by Delphix. All rights reserved. +.\" Copyright (c) 2011, 2015 by Delphix. All rights reserved. .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright (c) 2014 by Adam Stevko. All rights reserved. @@ -2775,8 +2775,11 @@ Do not actually receive the stream. This option to verify the name the receive operation would use. .It Fl o Sy origin Ns = Ns Ar snapshot Forces the stream to be received as a clone of the given snapshot. -This is only valid if the stream is an incremental stream whose source -is the same as the provided origin. +If the stream is a full send stream, this will create the filesystem +described by the stream as a clone of the specified snapshot. Which +snapshot was specified will not affect the success or failure of the +receive, as long as the snapshot does exist. If the stream is an +incremental send stream, all the normal verification will be performed. .It Fl u File system that is associated with the received stream is not mounted. .It Fl v From owner-svn-src-all@freebsd.org Fri Apr 14 17:55:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F2ED3E039; Fri, 14 Apr 2017 17:55:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44B6AFED; Fri, 14 Apr 2017 17:55:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHt60R056898; Fri, 14 Apr 2017 17:55:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHt68C056897; Fri, 14 Apr 2017 17:55:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141755.v3EHt68C056897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:55:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316884 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:55:07 -0000 Author: avg Date: Fri Apr 14 17:55:06 2017 New Revision: 316884 URL: https://svnweb.freebsd.org/changeset/base/316884 Log: missing zfs.1m changes from r296518 Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:52:47 2017 (r316883) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:55:06 2017 (r316884) @@ -26,6 +26,7 @@ .\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright (c) 2014 by Adam Stevko. All rights reserved. .\" Copyright 2015 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright (c) 2014 Integros [integros.com] .\" .Dd June 8, 2015 .Dt ZFS 1M From owner-svn-src-all@freebsd.org Fri Apr 14 17:57:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29B2BD3E0BF; Fri, 14 Apr 2017 17:57:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0179195; Fri, 14 Apr 2017 17:57:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHvBJ6057025; Fri, 14 Apr 2017 17:57:11 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHvBAb057024; Fri, 14 Apr 2017 17:57:11 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141757.v3EHvBAb057024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316885 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:57:12 -0000 Author: avg Date: Fri Apr 14 17:57:10 2017 New Revision: 316885 URL: https://svnweb.freebsd.org/changeset/base/316885 Log: missing zfs.1m changes from r299449 Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:55:06 2017 (r316884) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:57:10 2017 (r316885) @@ -25,10 +25,10 @@ .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright (c) 2014 by Adam Stevko. All rights reserved. -.\" Copyright 2015 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2014 Integros [integros.com] +.\" Copyright 2016 Nexenta Systems, Inc. .\" -.Dd June 8, 2015 +.Dd March 20, 2016 .Dt ZFS 1M .Os .Sh NAME @@ -786,17 +786,12 @@ dataset. .Sy aclinherit Ns = Ns Sy discard Ns | Ns Sy noallow Ns | Ns .Sy restricted Ns | Ns Sy passthrough Ns | Ns Sy passthrough-x .Xc -Controls how -.Sy ACE Ns s -are inherited when files and directories are created. +Controls how ACEs are inherited when files and directories are created. .Bl -tag -width "passthrough-x" .It Sy discard -does not inherit any -.Sy ACE Ns s . +does not inherit any ACEs. .It Sy noallow -only inherits inheritable -.Sy ACE Ns s -that specify +only inherits inheritable ACEs that specify .Qq deny permissions. .It Sy restricted @@ -804,13 +799,9 @@ default, removes the .Sy write_acl and .Sy write_owner -permissions when the -.Sy ACE -is inherited. +permissions when the ACE is inherited. .It Sy passthrough -inherits all inheritable -.Sy ACE Ns s -without any modifications. +inherits all inheritable ACEs without any modifications. .It Sy passthrough-x same meaning as .Sy passthrough , @@ -819,69 +810,51 @@ except that the .Sy group@ , and .Sy everyone@ -.Sy ACE Ns s -inherit the execute permission only if the file creation mode also requests the -execute bit. +ACEs inherit the execute permission only if the file creation mode also requests +the execute bit. .El .Pp When the property value is set to .Sy passthrough , -files are created with a mode determined by the inheritable -.Sy ACE Ns s . -If no inheritable -.Sy ACE Ns s -exist that affect the mode, then the mode is set in accordance to the requested -mode from the application. +files are created with a mode determined by the inheritable ACEs. +If no inheritable ACEs exist that affect the mode, then the mode is set in +accordance to the requested mode from the application. .It Xo .Sy aclmode Ns = Ns Sy discard Ns | Ns Sy groupmask Ns | Ns .Sy passthrough Ns | Ns Sy restricted .Xc -Controls how an -.Sy ACL -is modified during -.Xr chmod 2 . +Controls how an ACL is modified during +.Xr chmod 2 +and how inherited ACEs are modified by the file creation mode. .Bl -tag -width "passthrough" .It Sy discard -default, deletes all -.Sy ACE Ns s -that do not represent the mode of the file. +default, deletes all ACEs except for those representing the mode of the file or +directory requested by +.Xr chmod 2 . .It Sy groupmask -reduces permissions granted in all +reduces permissions granted by all .Sy ALLOW -entries found in the -.Sy ACL -such that they are no greater than the group permissions specified by -.Xr chmod 2 . +entries found in the ACL such that they are no greater than the group +permissions specified by the mode. .It Sy passthrough -indicates that no changes are made to the -.Sy ACL -other than creating or updating the necessary -.Sy ACE Ns s -to represent the new mode of the file or directory. +indicates that no changes are made to the ACL other than creating or updating +the necessary ACEs to represent the new mode of the file or directory. .It Sy restricted causes the .Xr chmod 2 operation to return an error when used on any file or directory which has a -non-trivial -.Sy ACE Ns s -whose entries can not be represented by a mode. +non-trivial ACL, with entries in addition to those that represent the mode. .El .Pp .Xr chmod 2 -is required to change the set user ID, set group ID, or sticky bits on a file or -directory, as they do not have equivalent -.Sy ACE Ns s. -In order to use +is required to change the set user ID, set group ID, or sticky bit on a file or +directory, as they do not have equivalent ACEs. In order to use .Xr chmod 2 -on a file or directory with a non-trivial -.Sy ACL -when +on a file or directory with a non-trivial ACL when .Sy aclmode is set to .Sy restricted , -you must first remove all -.Sy ACE Ns s -which do not represent the current mode. +you must first remove all ACEs except for those that represent the current mode. .It Sy atime Ns = Ns Sy on Ns | Ns Sy off Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and @@ -3437,9 +3410,7 @@ mount point permission is set to 755 by .Sy cindys will be unable to mount file systems under .Em tank/cindys . -Add an -.Sy ACE -similar to the following syntax to provide mount point access: +Add an ACE similar to the following syntax to provide mount point access: .Bd -literal # chmod A+user:cindys:add_subdirectory:allow /tank/cindys .Ed From owner-svn-src-all@freebsd.org Fri Apr 14 17:58:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9802D3E11F; Fri, 14 Apr 2017 17:58:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7362EC; Fri, 14 Apr 2017 17:58:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHw0T0057112; Fri, 14 Apr 2017 17:58:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHw0Gb057111; Fri, 14 Apr 2017 17:58:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141758.v3EHw0Gb057111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316886 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:58:01 -0000 Author: avg Date: Fri Apr 14 17:58:00 2017 New Revision: 316886 URL: https://svnweb.freebsd.org/changeset/base/316886 Log: 7041 Fix spelling mistakes in sections 1 and 1M illumos/illumos-gate@df23d905b96680e56379c5a5ecb4b363f36b9e74 https://github.com/illumos/illumos-gate/commit/df23d905b96680e56379c5a5ecb4b363f36b9e74 https://www.illumos.org/issues/7041 With the changes made in #7040, I found and fixed misspellings in sections 1 and 1M of the manual pages. Reviewed by: Marcel Telka Approved by: Dan McDonald Author: Cody Peter Mello Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:57:10 2017 (r316885) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:58:00 2017 (r316886) @@ -28,7 +28,7 @@ .\" Copyright (c) 2014 Integros [integros.com] .\" Copyright 2016 Nexenta Systems, Inc. .\" -.Dd March 20, 2016 +.Dd April 9, 2016 .Dt ZFS 1M .Os .Sh NAME @@ -2459,7 +2459,7 @@ By default, a full stream is generated. .It Fl D Generate a deduplicated stream. Blocks which would have been sent multiple times in the send stream will only be sent once. The receiving system must also -support this feature to recieve a deduplicated stream. This flag can be used +support this feature to receive a deduplicated stream. This flag can be used regardless of the dataset's .Sy dedup property, but performance will be much better if the filesystem uses a @@ -3500,7 +3500,7 @@ M F /tank/test/modified .Ed .El .Sh INTERFACE STABILITY -.Sy Commited . +.Sy Committed . .Sh SEE ALSO .Xr gzip 1 , .Xr ssh 1 , From owner-svn-src-all@freebsd.org Fri Apr 14 17:58:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB481D3E16F; Fri, 14 Apr 2017 17:58:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A31E663C; Fri, 14 Apr 2017 17:58:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHwVl8057175; Fri, 14 Apr 2017 17:58:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHwVgV057174; Fri, 14 Apr 2017 17:58:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141758.v3EHwVgV057174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316887 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:58:33 -0000 Author: avg Date: Fri Apr 14 17:58:31 2017 New Revision: 316887 URL: https://svnweb.freebsd.org/changeset/base/316887 Log: 7257 zfs manpage user property length needs to be updated illumos/illumos-gate@3bc71695036246c52af58ab0ad58a23a0feb5a0c https://github.com/illumos/illumos-gate/commit/3bc71695036246c52af58ab0ad58a23a0feb5a0c https://www.illumos.org/issues/7257 The zfs.1m manpage says: User Properties ... Property values are limited to 1024 characters. Since zpool version 16, this limit is actually 8192 characters. Additionally, this limit is actually 8192 bytes, as it supports UTF-8. Reviewed by: Paul Dagnelie Reviewed by: Matthew Ahrens Reviewed by: Yuri Pankov Reviewed by: Igor Kozhukhov Reviewed by: Robert Mustacchi Approved by: Richard Lowe Author: Eli Rosenthal Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:58:00 2017 (r316886) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:58:31 2017 (r316887) @@ -1629,9 +1629,8 @@ and so forth .Pc can be used to manipulate both native properties and user properties. Use the .Nm zfs Cm inherit -command to clear a user property . If the property is not defined in any parent -dataset, it is removed entirely. Property values are limited to 1024 -characters. +command to clear a user property. If the property is not defined in any parent +dataset, it is removed entirely. Property values are limited to 8192 bytes. .Ss ZFS Volumes as Swap or Dump Devices During an initial installation a swap device and dump device are created on ZFS volumes in the ZFS root pool. By default, the swap area size is based on 1/2 the From owner-svn-src-all@freebsd.org Fri Apr 14 17:59:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2325D3E1C3; Fri, 14 Apr 2017 17:59:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0A77E3; Fri, 14 Apr 2017 17:59:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHxAc5057260; Fri, 14 Apr 2017 17:59:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHxApZ057259; Fri, 14 Apr 2017 17:59:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141759.v3EHxApZ057259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316888 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:59:11 -0000 Author: avg Date: Fri Apr 14 17:59:10 2017 New Revision: 316888 URL: https://svnweb.freebsd.org/changeset/base/316888 Log: 7276 zfs(1m) manpage could better describe space properties illumos/illumos-gate@5749c35234ed96d3a61ee7c44d2ef37e043c7c59 https://github.com/illumos/illumos-gate/commit/5749c35234ed96d3a61ee7c44d2ef37e043c7c59 https://www.illumos.org/issues/7276 The "used" and "written" properties could be described better by the zfs.1m manpage. "written" could be better described as "The amount of space referenced by this dataset, that was written since the previous snapshot (i.e. that is not referenced by the previous snapshot)." The "used" section needs more work, but at a minimum it could say that the "used" space of a snapshot is the space unique to the snapshot (i.e. the space referenced only by this snapshot). The "used" space of a snapshot is a subset of the "written" space of the snapshot. Reviewed by: Dan Kimmel Reviewed by: Matthew Ahrens Reviewed by: Robert Mustacchi Approved by: Richard Lowe Author: Pavel Zakharov Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:58:31 2017 (r316887) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:59:10 2017 (r316888) @@ -21,7 +21,7 @@ .\" .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 2011 Joshua M. Clulow -.\" Copyright (c) 2011, 2015 by Delphix. All rights reserved. +.\" Copyright (c) 2011, 2016 by Delphix. All rights reserved. .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright (c) 2014 by Adam Stevko. All rights reserved. @@ -615,22 +615,27 @@ The amount of space consumed by this dat the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets. The amount of space that a -dataset consumes from its parent, as well as the amount of space that are freed +dataset consumes from its parent, as well as the amount of space that is freed if this dataset is recursively destroyed, is the greater of its space used and its reservation. .Pp -When snapshots +The used space of a snapshot .Po see the .Sx Snapshots section .Pc -are created, their space is initially shared between the snapshot and -the file system, and possibly with previous snapshots. As the file system -changes, space that was previously shared becomes unique to the snapshot, and -counted in the snapshot's space used. Additionally, deleting snapshots can -increase the amount of space unique to -.Pq and used by -other snapshots. +is space that is referenced exclusively by this snapshot. If this snapshot is +destroyed, the amount of +.Sy used +space will be freed. Space that is shared by multiple snapshots isn't accounted +for in this metric. When a snapshot is destroyed, space that was previously +shared with this snapshot can become unique to snapshots adjacent to it, thus +changing the used space of those snapshots. The used space of the latest +snapshot can also be affected by changes in the file system. Note that the +.Sy used +space of a snapshot is a subset of the +.Sy written +space of the snapshot. .Pp The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few @@ -754,8 +759,10 @@ for volumes is 8 Kbytes. Any power of 2 This property can also be referred to by its shortened column name, .Sy volblock . .It Sy written -The amount of +The amount of space .Sy referenced +by this dataset, that was written since the previous snapshot +.Pq i.e. that is not referenced by the previous snapshot . space written to this dataset since the previous snapshot. .It Sy written Ns @ Ns Em snapshot The amount of From owner-svn-src-all@freebsd.org Fri Apr 14 17:59:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6329DD3E231; Fri, 14 Apr 2017 17:59:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 192CD938; Fri, 14 Apr 2017 17:59:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EHxucR057337; Fri, 14 Apr 2017 17:59:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EHxuQ6057336; Fri, 14 Apr 2017 17:59:56 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141759.v3EHxuQ6057336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 17:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316889 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:59:57 -0000 Author: avg Date: Fri Apr 14 17:59:56 2017 New Revision: 316889 URL: https://svnweb.freebsd.org/changeset/base/316889 Log: 7345 zfs(1m): Description for -d depth appeared in -r illumos/illumos-gate@cb3c687bb9b8537283a9a4ce7309ff66fc266f2d https://github.com/illumos/illumos-gate/commit/cb3c687bb9b8537283a9a4ce7309ff66fc266f2d https://www.illumos.org/issues/7345 The following part of the zfs(1m) man page: -d depth Recursively display any children of the dataset, limiting the recursion to ... -r Recursively display any children of the dataset on the command line. depth. A depth of 1 will display only the dataset and its direct children. should be changed to: -d depth Recursively display any children of the dataset, limiting the recursion to depth. A depth of 1 will display only the dataset and its direct children. ... -r Recursively display any children of the dataset on the command line. Reviewed by: Yuri Pankov Approved by: Richard Lowe Author: Marcel Telka Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:59:10 2017 (r316888) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:59:56 2017 (r316889) @@ -28,7 +28,7 @@ .\" Copyright (c) 2014 Integros [integros.com] .\" Copyright 2016 Nexenta Systems, Inc. .\" -.Dd April 9, 2016 +.Dd September 3, 2016 .Dt ZFS 1M .Os .Sh NAME @@ -2019,6 +2019,12 @@ Same as the option, but sorts by property in descending order. .It Fl d Ar depth Recursively display any children of the dataset, limiting the recursion to +.Ar depth . +A +.Ar depth +of +.Sy 1 +will display only the dataset and its direct children. .It Fl o Ar property A comma-separated list of properties to display. The property must be: .Bl -bullet @@ -2048,10 +2054,6 @@ Display numbers in parsable values. .It Fl r Recursively display any children of the dataset on the command line. -.Ar depth . -A depth of -.Sy 1 -will display only the dataset and its direct children. .It Fl s Ar property A property for sorting the output by column in ascending order based on the value of the property. The property must be one of the properties described in From owner-svn-src-all@freebsd.org Fri Apr 14 18:00:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B63D3E2A8; Fri, 14 Apr 2017 18:00:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFFC6A9C; Fri, 14 Apr 2017 18:00:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EI0gag058128; Fri, 14 Apr 2017 18:00:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EI0gOD058127; Fri, 14 Apr 2017 18:00:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141800.v3EI0gOD058127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316890 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:00:44 -0000 Author: avg Date: Fri Apr 14 18:00:42 2017 New Revision: 316890 URL: https://svnweb.freebsd.org/changeset/base/316890 Log: 7276 zfs(1m) manpage could better describe space properties (remove extra line) illumos/illumos-gate@079d2996640860ff94d139e2c8cff6849c849af7 https://github.com/illumos/illumos-gate/commit/079d2996640860ff94d139e2c8cff6849c849af7 https://www.illumos.org/issues/7276 The "used" and "written" properties could be described better by the zfs.1m manpage. "written" could be better described as "The amount of space referenced by this dataset, that was written since the previous snapshot (i.e. that is not referenced by the previous snapshot)." The "used" section needs more work, but at a minimum it could say that the "used" space of a snapshot is the space unique to the snapshot (i.e. the space referenced only by this snapshot). The "used" space of a snapshot is a subset of the "written" space of the snapshot. Author: Matthew Ahrens Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 17:59:56 2017 (r316889) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 18:00:42 2017 (r316890) @@ -763,7 +763,6 @@ The amount of space .Sy referenced by this dataset, that was written since the previous snapshot .Pq i.e. that is not referenced by the previous snapshot . -space written to this dataset since the previous snapshot. .It Sy written Ns @ Ns Em snapshot The amount of .Sy referenced From owner-svn-src-all@freebsd.org Fri Apr 14 18:01:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20BADD3E313; Fri, 14 Apr 2017 18:01:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8353DB6; Fri, 14 Apr 2017 18:01:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EI1iBs060314; Fri, 14 Apr 2017 18:01:44 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EI1h3X060309; Fri, 14 Apr 2017 18:01:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141801.v3EI1h3X060309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316891 - vendor-sys/illumos/dist/common/zfs vendor/illumos/dist/cmd/zfs vendor/illumos/dist/lib/libzfs/common vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:01:45 -0000 Author: avg Date: Fri Apr 14 18:01:43 2017 New Revision: 316891 URL: https://svnweb.freebsd.org/changeset/base/316891 Log: 7386 zfs get does not work properly with bookmarks illumos/illumos-gate@edb901aab9c738b5eb15aa55933e82b0f2f9d9a2 https://github.com/illumos/illumos-gate/commit/edb901aab9c738b5eb15aa55933e82b0f2f9d9a2 https://www.illumos.org/issues/7386 The zfs get command does not work with the bookmark parameter while it works properly with both filesystem and snapshot: # zfs get -t all -r creation rpool/test NAME PROPERTY VALUE SOURCE rpool/test creation Fri Sep 16 15:00 2016 - rpool/test@snap creation Fri Sep 16 15:00 2016 - rpool/test#bkmark creation Fri Sep 16 15:00 2016 - # zfs get -t all -r creation rpool/test@snap NAME PROPERTY VALUE SOURCE rpool/test@snap creation Fri Sep 16 15:00 2016 - # zfs get -t all -r creation rpool/test#bkmark cannot open 'rpool/test#bkmark': invalid dataset name # The zfs get command should be modified to work properly with bookmarks too. Reviewed by: Simon Klinkert Reviewed by: Paul Dagnelie Approved by: Matthew Ahrens Author: Marcel Telka Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/lib/libzfs/common/libzfs_util.c vendor/illumos/dist/man/man1m/zfs.1m Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/common/zfs/zfs_namecheck.c vendor-sys/illumos/dist/common/zfs/zfs_namecheck.h Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_main.c Fri Apr 14 18:00:42 2017 (r316890) +++ vendor/illumos/dist/cmd/zfs/zfs_main.c Fri Apr 14 18:01:43 2017 (r316891) @@ -232,7 +232,7 @@ get_usage(zfs_help_t idx) "[-o \"all\" | field[,...]]\n" "\t [-t type[,...]] [-s source[,...]]\n" "\t <\"all\" | property[,...]> " - "[filesystem|volume|snapshot] ...\n")); + "[filesystem|volume|snapshot|bookmark] ...\n")); case HELP_INHERIT: return (gettext("\tinherit [-rS] " " ...\n")); @@ -1594,7 +1594,7 @@ zfs_do_get(int argc, char **argv) { zprop_get_cbdata_t cb = { 0 }; int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; - int types = ZFS_TYPE_DATASET; + int types = ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK; char *value, *fields; int ret = 0; int limit = 0; Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Fri Apr 14 18:00:42 2017 (r316890) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Fri Apr 14 18:01:43 2017 (r316891) @@ -105,7 +105,7 @@ zfs_validate_name(libzfs_handle_t *hdl, char what; (void) zfs_prop_get_table(); - if (dataset_namecheck(path, &why, &what) != 0) { + if (entity_namecheck(path, &why, &what) != 0) { if (hdl != NULL) { switch (why) { case NAME_ERR_TOOLONG: @@ -134,9 +134,10 @@ zfs_validate_name(libzfs_handle_t *hdl, "'%c' in name"), what); break; - case NAME_ERR_MULTIPLE_AT: + case NAME_ERR_MULTIPLE_DELIMITERS: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "multiple '@' delimiters in name")); + "multiple '@' and/or '#' delimiters in " + "name")); break; case NAME_ERR_NOLETTER: @@ -167,7 +168,7 @@ zfs_validate_name(libzfs_handle_t *hdl, if (!(type & ZFS_TYPE_SNAPSHOT) && strchr(path, '@') != NULL) { if (hdl != NULL) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "snapshot delimiter '@' in filesystem name")); + "snapshot delimiter '@' is not expected here")); return (0); } @@ -178,6 +179,20 @@ zfs_validate_name(libzfs_handle_t *hdl, return (0); } + if (!(type & ZFS_TYPE_BOOKMARK) && strchr(path, '#') != NULL) { + if (hdl != NULL) + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "bookmark delimiter '#' is not expected here")); + return (0); + } + + if (type == ZFS_TYPE_BOOKMARK && strchr(path, '#') == NULL) { + if (hdl != NULL) + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "missing '#' delimiter in bookmark name")); + return (0); + } + if (modifying && strchr(path, '%') != NULL) { if (hdl != NULL) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -615,8 +630,36 @@ make_bookmark_handle(zfs_handle_t *paren return (zhp); } +struct zfs_open_bookmarks_cb_data { + const char *path; + zfs_handle_t *zhp; +}; + +static int +zfs_open_bookmarks_cb(zfs_handle_t *zhp, void *data) +{ + struct zfs_open_bookmarks_cb_data *dp = data; + + /* + * Is it the one we are looking for? + */ + if (strcmp(dp->path, zfs_get_name(zhp)) == 0) { + /* + * We found it. Save it and let the caller know we are done. + */ + dp->zhp = zhp; + return (EEXIST); + } + + /* + * Not found. Close the handle and ask for another one. + */ + zfs_close(zhp); + return (0); +} + /* - * Opens the given snapshot, filesystem, or volume. The 'types' + * Opens the given snapshot, bookmark, filesystem, or volume. The 'types' * argument is a mask of acceptable types. The function will print an * appropriate error message and return NULL if it can't be opened. */ @@ -625,6 +668,7 @@ zfs_open(libzfs_handle_t *hdl, const cha { zfs_handle_t *zhp; char errbuf[1024]; + char *bookp; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot open '%s'"), path); @@ -632,20 +676,68 @@ zfs_open(libzfs_handle_t *hdl, const cha /* * Validate the name before we even try to open it. */ - if (!zfs_validate_name(hdl, path, ZFS_TYPE_DATASET, B_FALSE)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "invalid dataset name")); + if (!zfs_validate_name(hdl, path, types, B_FALSE)) { (void) zfs_error(hdl, EZFS_INVALIDNAME, errbuf); return (NULL); } /* - * Try to get stats for the dataset, which will tell us if it exists. + * Bookmarks needs to be handled separately. */ - errno = 0; - if ((zhp = make_dataset_handle(hdl, path)) == NULL) { - (void) zfs_standard_error(hdl, errno, errbuf); - return (NULL); + bookp = strchr(path, '#'); + if (bookp == NULL) { + /* + * Try to get stats for the dataset, which will tell us if it + * exists. + */ + errno = 0; + if ((zhp = make_dataset_handle(hdl, path)) == NULL) { + (void) zfs_standard_error(hdl, errno, errbuf); + return (NULL); + } + } else { + char dsname[ZFS_MAX_DATASET_NAME_LEN]; + zfs_handle_t *pzhp; + struct zfs_open_bookmarks_cb_data cb_data = {path, NULL}; + + /* + * We need to cut out '#' and everything after '#' + * to get the parent dataset name only. + */ + assert(bookp - path < sizeof (dsname)); + (void) strncpy(dsname, path, bookp - path); + dsname[bookp - path] = '\0'; + + /* + * Create handle for the parent dataset. + */ + errno = 0; + if ((pzhp = make_dataset_handle(hdl, dsname)) == NULL) { + (void) zfs_standard_error(hdl, errno, errbuf); + return (NULL); + } + + /* + * Iterate bookmarks to find the right one. + */ + errno = 0; + if ((zfs_iter_bookmarks(pzhp, zfs_open_bookmarks_cb, + &cb_data) == 0) && (cb_data.zhp == NULL)) { + (void) zfs_error(hdl, EZFS_NOENT, errbuf); + zfs_close(pzhp); + return (NULL); + } + if (cb_data.zhp == NULL) { + (void) zfs_standard_error(hdl, errno, errbuf); + zfs_close(pzhp); + return (NULL); + } + zhp = cb_data.zhp; + + /* + * Cleanup. + */ + zfs_close(pzhp); } if (!(types & zhp->zfs_type)) { Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Fri Apr 14 18:00:42 2017 (r316890) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Fri Apr 14 18:01:43 2017 (r316891) @@ -946,9 +946,10 @@ zpool_name_valid(libzfs_handle_t *hdl, b "trailing slash in name")); break; - case NAME_ERR_MULTIPLE_AT: + case NAME_ERR_MULTIPLE_DELIMITERS: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "multiple '@' delimiters in name")); + "multiple '@' and/or '#' delimiters in " + "name")); break; default: Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_util.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_util.c Fri Apr 14 18:00:42 2017 (r316890) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_util.c Fri Apr 14 18:01:43 2017 (r316891) @@ -689,7 +689,7 @@ zfs_get_pool_handle(const zfs_handle_t * * Given a name, determine whether or not it's a valid path * (starts with '/' or "./"). If so, walk the mnttab trying * to match the device number. If not, treat the path as an - * fs/vol/snap name. + * fs/vol/snap/bkmark name. */ zfs_handle_t * zfs_path_to_zhandle(libzfs_handle_t *hdl, char *path, zfs_type_t argtype) Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 18:00:42 2017 (r316890) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 18:01:43 2017 (r316891) @@ -28,7 +28,7 @@ .\" Copyright (c) 2014 Integros [integros.com] .\" Copyright 2016 Nexenta Systems, Inc. .\" -.Dd September 3, 2016 +.Dd September 16, 2016 .Dt ZFS 1M .Os .Sh NAME @@ -112,7 +112,7 @@ .Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc .Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ... -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Ns ... .Nm .Cm inherit .Op Fl rS @@ -2122,7 +2122,7 @@ section. .Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc .Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ... -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Ns ... .Xc Displays properties for the given datasets. If no datasets are specified, then the command displays properties for all datasets on the system. For each From owner-svn-src-all@freebsd.org Fri Apr 14 18:01:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69000D3E30F; Fri, 14 Apr 2017 18:01:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44858DB3; Fri, 14 Apr 2017 18:01:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EI1hh8060304; Fri, 14 Apr 2017 18:01:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EI1hIj060303; Fri, 14 Apr 2017 18:01:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141801.v3EI1hIj060303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316891 - vendor-sys/illumos/dist/common/zfs vendor/illumos/dist/cmd/zfs vendor/illumos/dist/lib/libzfs/common vendor/illumos/dist/man/man1m X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:01:44 -0000 Author: avg Date: Fri Apr 14 18:01:43 2017 New Revision: 316891 URL: https://svnweb.freebsd.org/changeset/base/316891 Log: 7386 zfs get does not work properly with bookmarks illumos/illumos-gate@edb901aab9c738b5eb15aa55933e82b0f2f9d9a2 https://github.com/illumos/illumos-gate/commit/edb901aab9c738b5eb15aa55933e82b0f2f9d9a2 https://www.illumos.org/issues/7386 The zfs get command does not work with the bookmark parameter while it works properly with both filesystem and snapshot: # zfs get -t all -r creation rpool/test NAME PROPERTY VALUE SOURCE rpool/test creation Fri Sep 16 15:00 2016 - rpool/test@snap creation Fri Sep 16 15:00 2016 - rpool/test#bkmark creation Fri Sep 16 15:00 2016 - # zfs get -t all -r creation rpool/test@snap NAME PROPERTY VALUE SOURCE rpool/test@snap creation Fri Sep 16 15:00 2016 - # zfs get -t all -r creation rpool/test#bkmark cannot open 'rpool/test#bkmark': invalid dataset name # The zfs get command should be modified to work properly with bookmarks too. Reviewed by: Simon Klinkert Reviewed by: Paul Dagnelie Approved by: Matthew Ahrens Author: Marcel Telka Modified: vendor-sys/illumos/dist/common/zfs/zfs_namecheck.c vendor-sys/illumos/dist/common/zfs/zfs_namecheck.h Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/lib/libzfs/common/libzfs_util.c vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor-sys/illumos/dist/common/zfs/zfs_namecheck.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfs_namecheck.c Fri Apr 14 18:00:42 2017 (r316890) +++ vendor-sys/illumos/dist/common/zfs/zfs_namecheck.c Fri Apr 14 18:01:43 2017 (r316891) @@ -120,9 +120,9 @@ permset_namecheck(const char *path, name } /* - * Dataset names must be of the following form: + * Entity names must be of the following form: * - * [component][/]*[component][@component] + * [component/]*[component][(@|#)component]? * * Where each component is made up of alphanumeric characters plus the following * characters: @@ -133,10 +133,10 @@ permset_namecheck(const char *path, name * names for temporary clones (for online recv). */ int -dataset_namecheck(const char *path, namecheck_err_t *why, char *what) +entity_namecheck(const char *path, namecheck_err_t *why, char *what) { - const char *loc, *end; - int found_snapshot; + const char *start, *end; + int found_delim; /* * Make sure the name is not too long. @@ -161,12 +161,13 @@ dataset_namecheck(const char *path, name return (-1); } - loc = path; - found_snapshot = 0; + start = path; + found_delim = 0; for (;;) { /* Find the end of this component */ - end = loc; - while (*end != '/' && *end != '@' && *end != '\0') + end = start; + while (*end != '/' && *end != '@' && *end != '#' && + *end != '\0') end++; if (*end == '\0' && end[-1] == '/') { @@ -176,25 +177,8 @@ dataset_namecheck(const char *path, name return (-1); } - /* Zero-length components are not allowed */ - if (loc == end) { - if (why) { - /* - * Make sure this is really a zero-length - * component and not a '@@'. - */ - if (*end == '@' && found_snapshot) { - *why = NAME_ERR_MULTIPLE_AT; - } else { - *why = NAME_ERR_EMPTY_COMPONENT; - } - } - - return (-1); - } - /* Validate the contents of this component */ - while (loc != end) { + for (const char *loc = start; loc != end; loc++) { if (!valid_char(*loc) && *loc != '%') { if (why) { *why = NAME_ERR_INVALCHAR; @@ -202,43 +186,64 @@ dataset_namecheck(const char *path, name } return (-1); } - loc++; } - /* If we've reached the end of the string, we're OK */ - if (*end == '\0') - return (0); - - if (*end == '@') { - /* - * If we've found an @ symbol, indicate that we're in - * the snapshot component, and report a second '@' - * character as an error. - */ - if (found_snapshot) { + /* Snapshot or bookmark delimiter found */ + if (*end == '@' || *end == '#') { + /* Multiple delimiters are not allowed */ + if (found_delim != 0) { if (why) - *why = NAME_ERR_MULTIPLE_AT; + *why = NAME_ERR_MULTIPLE_DELIMITERS; return (-1); } - found_snapshot = 1; + found_delim = 1; + } + + /* Zero-length components are not allowed */ + if (start == end) { + if (why) + *why = NAME_ERR_EMPTY_COMPONENT; + return (-1); } + /* If we've reached the end of the string, we're OK */ + if (*end == '\0') + return (0); + /* - * If there is a '/' in a snapshot name + * If there is a '/' in a snapshot or bookmark name * then report an error */ - if (*end == '/' && found_snapshot) { + if (*end == '/' && found_delim != 0) { if (why) *why = NAME_ERR_TRAILING_SLASH; return (-1); } /* Update to the next component */ - loc = end + 1; + start = end + 1; } } +/* + * Dataset is any entity, except bookmark + */ +int +dataset_namecheck(const char *path, namecheck_err_t *why, char *what) +{ + int ret = entity_namecheck(path, why, what); + + if (ret == 0 && strchr(path, '#') != NULL) { + if (why != NULL) { + *why = NAME_ERR_INVALCHAR; + *what = '#'; + } + return (-1); + } + + return (ret); +} /* * mountpoint names must be of the following form: Modified: vendor-sys/illumos/dist/common/zfs/zfs_namecheck.h ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfs_namecheck.h Fri Apr 14 18:00:42 2017 (r316890) +++ vendor-sys/illumos/dist/common/zfs/zfs_namecheck.h Fri Apr 14 18:01:43 2017 (r316891) @@ -38,7 +38,7 @@ typedef enum { NAME_ERR_EMPTY_COMPONENT, /* name contains an empty component */ NAME_ERR_TRAILING_SLASH, /* name ends with a slash */ NAME_ERR_INVALCHAR, /* invalid character found */ - NAME_ERR_MULTIPLE_AT, /* multiple '@' characters found */ + NAME_ERR_MULTIPLE_DELIMITERS, /* multiple '@'/'#' delimiters found */ NAME_ERR_NOLETTER, /* pool doesn't begin with a letter */ NAME_ERR_RESERVED, /* entire name is reserved */ NAME_ERR_DISKLIKE, /* reserved disk name (c[0-9].*) */ @@ -49,6 +49,7 @@ typedef enum { #define ZFS_PERMSET_MAXLEN 64 int pool_namecheck(const char *, namecheck_err_t *, char *); +int entity_namecheck(const char *, namecheck_err_t *, char *); int dataset_namecheck(const char *, namecheck_err_t *, char *); int mountpoint_namecheck(const char *, namecheck_err_t *); int zfs_component_namecheck(const char *, namecheck_err_t *, char *); From owner-svn-src-all@freebsd.org Fri Apr 14 18:02:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F66CD3E51C; Fri, 14 Apr 2017 18:02:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F304A11A3; Fri, 14 Apr 2017 18:02:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EI2Qlq061225; Fri, 14 Apr 2017 18:02:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EI2QxN061224; Fri, 14 Apr 2017 18:02:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141802.v3EI2QxN061224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316892 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:02:27 -0000 Author: avg Date: Fri Apr 14 18:02:25 2017 New Revision: 316892 URL: https://svnweb.freebsd.org/changeset/base/316892 Log: 7602 minor issues with zfs manpage illumos/illumos-gate@5c262fd00992208f65151758483eb8841166798b https://github.com/illumos/illumos-gate/commit/5c262fd00992208f65151758483eb8841166798b https://www.illumos.org/issues/7602 The line volblocksize=blocksize should just read volblocksize in the same rendering as the other properties in the same section. The zfs.1m man page renders one variant of unallow as zfs unallow [-r] -s -@setname [perm|@setname[,perm|@setname]...] filesystem|volume There is an extra dash preceeding @setname that should not be there. Reviewed by: Matthew Ahrens Reviewed by: Daniel Hoffman Approved by: Richard Lowe Author: Sara Hartse Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 18:01:43 2017 (r316891) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 18:02:25 2017 (r316892) @@ -748,7 +748,7 @@ or a user who has been granted the privilege with .Nm zfs Cm allow , can access all groups' usage. -.It Sy volblocksize Ns = Ns Em blocksize +.It Sy volblocksize For volumes, specifies the block size of the volume. The .Sy blocksize cannot be changed once the volume has been written, so it should be set at @@ -3026,7 +3026,7 @@ Recursively remove the permissions from .Nm .Cm unallow .Op Fl r -.Fl s @ Ns Ar setname +.Fl s No @ Ns Ar setname .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns .Ar setname Oc Ns ... Oc .Ar filesystem Ns | Ns Ar volume From owner-svn-src-all@freebsd.org Fri Apr 14 18:05:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A149D3E5CE; Fri, 14 Apr 2017 18:05:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D44713A2; Fri, 14 Apr 2017 18:05:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EI5KXi061397; Fri, 14 Apr 2017 18:05:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EI5Kdo061396; Fri, 14 Apr 2017 18:05:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141805.v3EI5Kdo061396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316893 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:05:21 -0000 Author: avg Date: Fri Apr 14 18:05:20 2017 New Revision: 316893 URL: https://svnweb.freebsd.org/changeset/base/316893 Log: 7604 if volblocksize property is the default, it displays as "-" rather than 8K illumos/illumos-gate@4d86c0eab246bdfddc2dd52410ba808433bd6266 https://github.com/illumos/illumos-gate/commit/4d86c0eab246bdfddc2dd52410ba808433bd6266 https://www.illumos.org/issues/7604 If a zvol has the default setting for the "volblocksize" property, it is 8KB. However, it is displayed as "-" (not present), rather than "8K". The problem was introduced by: commit 25228e830e86924a41243343b1de9daf2d7dd43a Author: Matthew Ahrens <mahrens@delphix.com> Date: Thu Nov 17 14:37:24 2016 -0800 7571 non-present readonly numeric ZFS props do not have default value which changed changed get_numeric_property() to indicate that readonly default properties are not present. However, zfs_prop_readonly() returns TRUE for both readonly and set-once properties (e.g. volblocksize). Amusingly, that commit essentially reverted: 6900484 default volblocksize is no longer being reported correctly from November 2009. However, that change was not correct either; the correct solution is to only do this check for "truly readonly" (i.e. not setonce) properties. $ zfs list -t volume -o name,volblocksize NAME VOLBLOCK domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/ archive - domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/ datafile - domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/ external - rpool/dump 128K rpool/swap 4K rpool/swap1 =============================================================================== Reviewed by: Pavel Zakharov Reviewed by: Paul Dagnelie Reviewed by: John Kennedy Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Fri Apr 14 18:02:25 2017 (r316892) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Fri Apr 14 18:05:20 2017 (r316893) @@ -2125,9 +2125,12 @@ get_numeric_property(zfs_handle_t *zhp, /* * If we tried to use a default value for a * readonly property, it means that it was not - * present. + * present. Note this only applies to "truly" + * readonly properties, not set-once properties + * like volblocksize. */ if (zfs_prop_readonly(prop) && + !zfs_prop_setonce(prop) && *source != NULL && (*source)[0] == '\0') { *source = NULL; return (-1); From owner-svn-src-all@freebsd.org Fri Apr 14 18:07:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C43CFD3E6A8; Fri, 14 Apr 2017 18:07:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61FC21671; Fri, 14 Apr 2017 18:07:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EI7hMB061724; Fri, 14 Apr 2017 18:07:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EI7h4L061722; Fri, 14 Apr 2017 18:07:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141807.v3EI7h4L061722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316894 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zfs vendor/illumos/dist/cmd/zstreamdump vendor/illumos/dist/lib... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:07:44 -0000 Author: avg Date: Fri Apr 14 18:07:43 2017 New Revision: 316894 URL: https://svnweb.freebsd.org/changeset/base/316894 Log: 7252 7628 compressed zfs send / receive illumos/illumos-gate@5602294fda888d923d57a78bafdaf48ae6223dea https://github.com/illumos/illumos-gate/commit/5602294fda888d923d57a78bafdaf48ae6223dea https://www.illumos.org/issues/7252 This feature includes code to allow a system with compressed ARC enabled to send data in its compressed form straight out of the ARC, and receive data in its compressed form directly into the ARC. https://www.illumos.org/issues/7628 We should have longer, more readable versions of the ZFS send / recv options. 7628 create long versions of ZFS send / receive options Reviewed by: George Wilson Reviewed by: John Kennedy Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Pavel Zakharov Reviewed by: Sebastien Roy Reviewed by: David Quigley Reviewed by: Thomas Caputi Approved by: Dan McDonald Author: Dan Kimmel Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_send.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_compress.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/cmd/zstreamdump/zstreamdump.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Fri Apr 14 18:05:20 2017 (r316893) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Fri Apr 14 18:07:43 2017 (r316894) @@ -77,10 +77,10 @@ * A new reference to a cache buffer can be obtained in two * ways: 1) via a hash table lookup using the DVA as a key, * or 2) via one of the ARC lists. The arc_read() interface - * uses method 1, while the internal arc algorithms for + * uses method 1, while the internal ARC algorithms for * adjusting the cache use method 2. We therefore provide two * types of locks: 1) the hash table lock array, and 2) the - * arc list locks. + * ARC list locks. * * Buffers do not have their own mutexes, rather they rely on the * hash table mutexes for the bulk of their protection (i.e. most @@ -93,21 +93,12 @@ * buf_hash_remove() expects the appropriate hash mutex to be * already held before it is invoked. * - * Each arc state also has a mutex which is used to protect the + * Each ARC state also has a mutex which is used to protect the * buffer list associated with the state. When attempting to - * obtain a hash table lock while holding an arc list lock you + * obtain a hash table lock while holding an ARC list lock you * must use: mutex_tryenter() to avoid deadlock. Also note that * the active state mutex must be held before the ghost state mutex. * - * Arc buffers may have an associated eviction callback function. - * This function will be invoked prior to removing the buffer (e.g. - * in arc_do_user_evicts()). Note however that the data associated - * with the buffer may be evicted prior to the callback. The callback - * must be made with *no locks held* (to prevent deadlock). Additionally, - * the users of callbacks must ensure that their private data is - * protected from simultaneous callbacks from arc_clear_callback() - * and arc_do_user_evicts(). - * * Note that the majority of the performance stats are manipulated * with atomic operations. * @@ -136,67 +127,81 @@ * are cached in the L1ARC. The L1ARC (l1arc_buf_hdr_t) is a structure within * the arc_buf_hdr_t that will point to the data block in memory. A block can * only be read by a consumer if it has an l1arc_buf_hdr_t. The L1ARC - * caches data in two ways -- in a list of arc buffers (arc_buf_t) and + * caches data in two ways -- in a list of ARC buffers (arc_buf_t) and * also in the arc_buf_hdr_t's private physical data block pointer (b_pdata). - * Each arc buffer (arc_buf_t) is being actively accessed by a specific ARC - * consumer, and always contains uncompressed data. The ARC will provide - * references to this data and will keep it cached until it is no longer in - * use. Typically, the arc will try to cache only the L1ARC's physical data - * block and will aggressively evict any arc_buf_t that is no longer referenced. - * The amount of memory consumed by the arc_buf_t's can be seen via the - * "overhead_size" kstat. - * * - * arc_buf_hdr_t - * +-----------+ - * | | - * | | - * | | - * +-----------+ - * l2arc_buf_hdr_t| | - * | | - * +-----------+ - * l1arc_buf_hdr_t| | - * | | arc_buf_t - * | b_buf +------------>+---------+ arc_buf_t - * | | |b_next +---->+---------+ - * | b_pdata +-+ |---------| |b_next +-->NULL - * +-----------+ | | | +---------+ - * | |b_data +-+ | | - * | +---------+ | |b_data +-+ - * +->+------+ | +---------+ | - * (potentially) | | | | - * compressed | | | | - * data +------+ | v - * +->+------+ +------+ - * uncompressed | | | | - * data | | | | - * +------+ +------+ - * - * The L1ARC's data pointer, however, may or may not be uncompressed. The - * ARC has the ability to store the physical data (b_pdata) associated with - * the DVA of the arc_buf_hdr_t. Since the b_pdata is a copy of the on-disk - * physical block, it will match its on-disk compression characteristics. - * If the block on-disk is compressed, then the physical data block - * in the cache will also be compressed and vice-versa. This behavior - * can be disabled by setting 'zfs_compressed_arc_enabled' to B_FALSE. When the + * The L1ARC's data pointer may or may not be uncompressed. The ARC has the + * ability to store the physical data (b_pdata) associated with the DVA of the + * arc_buf_hdr_t. Since the b_pdata is a copy of the on-disk physical block, + * it will match its on-disk compression characteristics. This behavior can be + * disabled by setting 'zfs_compressed_arc_enabled' to B_FALSE. When the * compressed ARC functionality is disabled, the b_pdata will point to an * uncompressed version of the on-disk data. * + * Data in the L1ARC is not accessed by consumers of the ARC directly. Each + * arc_buf_hdr_t can have multiple ARC buffers (arc_buf_t) which reference it. + * Each ARC buffer (arc_buf_t) is being actively accessed by a specific ARC + * consumer. The ARC will provide references to this data and will keep it + * cached until it is no longer in use. The ARC caches only the L1ARC's physical + * data block and will evict any arc_buf_t that is no longer referenced. The + * amount of memory consumed by the arc_buf_ts' data buffers can be seen via the + * "overhead_size" kstat. + * + * Depending on the consumer, an arc_buf_t can be requested in uncompressed or + * compressed form. The typical case is that consumers will want uncompressed + * data, and when that happens a new data buffer is allocated where the data is + * decompressed for them to use. Currently the only consumer who wants + * compressed arc_buf_t's is "zfs send", when it streams data exactly as it + * exists on disk. When this happens, the arc_buf_t's data buffer is shared + * with the arc_buf_hdr_t. + * + * Here is a diagram showing an arc_buf_hdr_t referenced by two arc_buf_t's. The + * first one is owned by a compressed send consumer (and therefore references + * the same compressed data buffer as the arc_buf_hdr_t) and the second could be + * used by any other consumer (and has its own uncompressed copy of the data + * buffer). + * + * arc_buf_hdr_t + * +-----------+ + * | fields | + * | common to | + * | L1- and | + * | L2ARC | + * +-----------+ + * | l2arc_buf_hdr_t + * | | + * +-----------+ + * | l1arc_buf_hdr_t + * | | arc_buf_t + * | b_buf +------------>+-----------+ arc_buf_t + * | b_pdata +-+ |b_next +---->+-----------+ + * +-----------+ | |-----------| |b_next +-->NULL + * | |b_comp = T | +-----------+ + * | |b_data +-+ |b_comp = F | + * | +-----------+ | |b_data +-+ + * +->+------+ | +-----------+ | + * compressed | | | | + * data | |<--------------+ | uncompressed + * +------+ compressed, | data + * shared +-->+------+ + * data | | + * | | + * +------+ + * * When a consumer reads a block, the ARC must first look to see if the - * arc_buf_hdr_t is cached. If the hdr is cached and already has an arc_buf_t, - * then an additional arc_buf_t is allocated and the uncompressed data is - * bcopied from the existing arc_buf_t. If the hdr is cached but does not - * have an arc_buf_t, then the ARC allocates a new arc_buf_t and decompresses - * the b_pdata contents into the arc_buf_t's b_data. If the arc_buf_hdr_t's - * b_pdata is not compressed, then the block is shared with the newly - * allocated arc_buf_t. This block sharing only occurs with one arc_buf_t - * in the arc buffer chain. Sharing the block reduces the memory overhead - * required when the hdr is caching uncompressed blocks or the compressed - * arc functionality has been disabled via 'zfs_compressed_arc_enabled'. + * arc_buf_hdr_t is cached. If the hdr is cached then the ARC allocates a new + * arc_buf_t and either copies uncompressed data into a new data buffer from an + * existing uncompressed arc_buf_t, decompresses the hdr's b_pdata buffer into a + * new data buffer, or shares the hdr's b_pdata buffer, depending on whether the + * hdr is compressed and the desired compression characteristics of the + * arc_buf_t consumer. If the arc_buf_t ends up sharing data with the + * arc_buf_hdr_t and both of them are uncompressed then the arc_buf_t must be + * the last buffer in the hdr's b_buf list, however a shared compressed buf can + * be anywhere in the hdr's list. * * The diagram below shows an example of an uncompressed ARC hdr that is - * sharing its data with an arc_buf_t: + * sharing its data with an arc_buf_t (note that the shared uncompressed buf is + * the last element in the buf list): * * arc_buf_hdr_t * +-----------+ @@ -225,20 +230,24 @@ * | +------+ | * +---------------------------------+ * - * Writing to the arc requires that the ARC first discard the b_pdata + * Writing to the ARC requires that the ARC first discard the hdr's b_pdata * since the physical block is about to be rewritten. The new data contents - * will be contained in the arc_buf_t (uncompressed). As the I/O pipeline - * performs the write, it may compress the data before writing it to disk. - * The ARC will be called with the transformed data and will bcopy the - * transformed on-disk block into a newly allocated b_pdata. + * will be contained in the arc_buf_t. As the I/O pipeline performs the write, + * it may compress the data before writing it to disk. The ARC will be called + * with the transformed data and will bcopy the transformed on-disk block into + * a newly allocated b_pdata. Writes are always done into buffers which have + * either been loaned (and hence are new and don't have other readers) or + * buffers which have been released (and hence have their own hdr, if there + * were originally other readers of the buf's original hdr). This ensures that + * the ARC only needs to update a single buf and its hdr after a write occurs. * * When the L2ARC is in use, it will also take advantage of the b_pdata. The * L2ARC will always write the contents of b_pdata to the L2ARC. This means - * that when compressed arc is enabled that the L2ARC blocks are identical + * that when compressed ARC is enabled that the L2ARC blocks are identical * to the on-disk block in the main data pool. This provides a significant * advantage since the ARC can leverage the bp's checksum when reading from the * L2ARC to determine if the contents are valid. However, if the compressed - * arc is disabled, then the L2ARC's block must be transformed to look + * ARC is disabled, then the L2ARC's block must be transformed to look * like the physical block in the main data pool before comparing the * checksum and determining its validity. */ @@ -804,6 +813,7 @@ struct arc_callback { void *acb_private; arc_done_func_t *acb_done; arc_buf_t *acb_buf; + boolean_t acb_compressed; zio_t *acb_zio_dummy; arc_callback_t *acb_next; }; @@ -855,7 +865,7 @@ typedef struct l1arc_buf_hdr { zio_cksum_t *b_freeze_cksum; #ifdef ZFS_DEBUG /* - * used for debugging wtih kmem_flags - by allocating and freeing + * Used for debugging with kmem_flags - by allocating and freeing * b_thawed when the buffer is thawed, we get a record of the stack * trace that thawed it. */ @@ -970,6 +980,8 @@ struct arc_buf_hdr { HDR_COMPRESS_OFFSET, SPA_COMPRESSBITS, (cmp)); #define ARC_BUF_LAST(buf) ((buf)->b_next == NULL) +#define ARC_BUF_SHARED(buf) ((buf)->b_flags & ARC_BUF_FLAG_SHARED) +#define ARC_BUF_COMPRESSED(buf) ((buf)->b_flags & ARC_BUF_FLAG_COMPRESSED) /* * Other sizes @@ -1064,7 +1076,7 @@ static kmutex_t l2arc_free_on_write_mtx; static uint64_t l2arc_ndev; /* number of devices */ typedef struct l2arc_read_callback { - arc_buf_hdr_t *l2rcb_hdr; /* read buffer */ + arc_buf_hdr_t *l2rcb_hdr; /* read header */ blkptr_t l2rcb_bp; /* original blkptr */ zbookmark_phys_t l2rcb_zb; /* original bookmark */ int l2rcb_flags; /* original flags */ @@ -1399,6 +1411,31 @@ retry: } } +/* + * This is the size that the buf occupies in memory. If the buf is compressed, + * it will correspond to the compressed size. You should use this method of + * getting the buf size unless you explicitly need the logical size. + */ +int32_t +arc_buf_size(arc_buf_t *buf) +{ + return (ARC_BUF_COMPRESSED(buf) ? + HDR_GET_PSIZE(buf->b_hdr) : HDR_GET_LSIZE(buf->b_hdr)); +} + +int32_t +arc_buf_lsize(arc_buf_t *buf) +{ + return (HDR_GET_LSIZE(buf->b_hdr)); +} + +enum zio_compress +arc_get_compression(arc_buf_t *buf) +{ + return (ARC_BUF_COMPRESSED(buf) ? + HDR_GET_COMPRESS(buf->b_hdr) : ZIO_COMPRESS_OFF); +} + #define ARC_MINTIME (hz>>4) /* 62 ms */ static inline boolean_t @@ -1407,9 +1444,21 @@ arc_buf_is_shared(arc_buf_t *buf) boolean_t shared = (buf->b_data != NULL && buf->b_data == buf->b_hdr->b_l1hdr.b_pdata); IMPLY(shared, HDR_SHARED_DATA(buf->b_hdr)); + IMPLY(shared, ARC_BUF_SHARED(buf)); + IMPLY(shared, ARC_BUF_COMPRESSED(buf) || ARC_BUF_LAST(buf)); + + /* + * It would be nice to assert arc_can_share() too, but the "hdr isn't + * already being shared" requirement prevents us from doing that. + */ + return (shared); } +/* + * Free the checksum associated with this header. If there is no checksum, this + * is a no-op. + */ static inline void arc_cksum_free(arc_buf_hdr_t *hdr) { @@ -1422,6 +1471,25 @@ arc_cksum_free(arc_buf_hdr_t *hdr) mutex_exit(&hdr->b_l1hdr.b_freeze_lock); } +/* + * Return true iff at least one of the bufs on hdr is not compressed. + */ +static boolean_t +arc_hdr_has_uncompressed_buf(arc_buf_hdr_t *hdr) +{ + for (arc_buf_t *b = hdr->b_l1hdr.b_buf; b != NULL; b = b->b_next) { + if (!ARC_BUF_COMPRESSED(b)) { + return (B_TRUE); + } + } + return (B_FALSE); +} + +/* + * If we've turned on the ZFS_DEBUG_MODIFY flag, verify that the buf's data + * matches the checksum that is stored in the hdr. If there is no checksum, + * or if the buf is compressed, this is a no-op. + */ static void arc_cksum_verify(arc_buf_t *buf) { @@ -1431,6 +1499,12 @@ arc_cksum_verify(arc_buf_t *buf) if (!(zfs_flags & ZFS_DEBUG_MODIFY)) return; + if (ARC_BUF_COMPRESSED(buf)) { + ASSERT(hdr->b_l1hdr.b_freeze_cksum == NULL || + arc_hdr_has_uncompressed_buf(hdr)); + return; + } + ASSERT(HDR_HAS_L1HDR(hdr)); mutex_enter(&hdr->b_l1hdr.b_freeze_lock); @@ -1438,7 +1512,8 @@ arc_cksum_verify(arc_buf_t *buf) mutex_exit(&hdr->b_l1hdr.b_freeze_lock); return; } - fletcher_2_native(buf->b_data, HDR_GET_LSIZE(hdr), NULL, &zc); + + fletcher_2_native(buf->b_data, arc_buf_size(buf), NULL, &zc); if (!ZIO_CHECKSUM_EQUAL(*hdr->b_l1hdr.b_freeze_cksum, zc)) panic("buffer modified while frozen!"); mutex_exit(&hdr->b_l1hdr.b_freeze_lock); @@ -1512,6 +1587,12 @@ arc_cksum_is_equal(arc_buf_hdr_t *hdr, z return (valid_cksum); } +/* + * Given a buf full of data, if ZFS_DEBUG_MODIFY is enabled this computes a + * checksum and attaches it to the buf's hdr so that we can ensure that the buf + * isn't modified later on. If buf is compressed or there is already a checksum + * on the hdr, this is a no-op (we only checksum uncompressed bufs). + */ static void arc_cksum_compute(arc_buf_t *buf) { @@ -1521,14 +1602,21 @@ arc_cksum_compute(arc_buf_t *buf) return; ASSERT(HDR_HAS_L1HDR(hdr)); + mutex_enter(&buf->b_hdr->b_l1hdr.b_freeze_lock); if (hdr->b_l1hdr.b_freeze_cksum != NULL) { + ASSERT(arc_hdr_has_uncompressed_buf(hdr)); + mutex_exit(&hdr->b_l1hdr.b_freeze_lock); + return; + } else if (ARC_BUF_COMPRESSED(buf)) { mutex_exit(&hdr->b_l1hdr.b_freeze_lock); return; } + + ASSERT(!ARC_BUF_COMPRESSED(buf)); hdr->b_l1hdr.b_freeze_cksum = kmem_alloc(sizeof (zio_cksum_t), KM_SLEEP); - fletcher_2_native(buf->b_data, HDR_GET_LSIZE(hdr), NULL, + fletcher_2_native(buf->b_data, arc_buf_size(buf), NULL, hdr->b_l1hdr.b_freeze_cksum); mutex_exit(&hdr->b_l1hdr.b_freeze_lock); arc_buf_watch(buf); @@ -1569,7 +1657,7 @@ arc_buf_watch(arc_buf_t *buf) procctl_t ctl; ctl.cmd = PCWATCH; ctl.prwatch.pr_vaddr = (uintptr_t)buf->b_data; - ctl.prwatch.pr_size = HDR_GET_LSIZE(buf->b_hdr); + ctl.prwatch.pr_size = arc_buf_size(buf); ctl.prwatch.pr_wflags = WA_WRITE; result = write(arc_procfd, &ctl, sizeof (ctl)); ASSERT3U(result, ==, sizeof (ctl)); @@ -1590,6 +1678,12 @@ arc_buf_type(arc_buf_hdr_t *hdr) return (type); } +boolean_t +arc_is_metadata(arc_buf_t *buf) +{ + return (HDR_ISTYPE_METADATA(buf->b_hdr) != 0); +} + static uint32_t arc_bufc_to_flags(arc_buf_contents_t type) { @@ -1611,12 +1705,19 @@ arc_buf_thaw(arc_buf_t *buf) { arc_buf_hdr_t *hdr = buf->b_hdr; - if (zfs_flags & ZFS_DEBUG_MODIFY) { - if (hdr->b_l1hdr.b_state != arc_anon) - panic("modifying non-anon buffer!"); - if (HDR_IO_IN_PROGRESS(hdr)) - panic("modifying buffer while i/o in progress!"); - arc_cksum_verify(buf); + ASSERT3P(hdr->b_l1hdr.b_state, ==, arc_anon); + ASSERT(!HDR_IO_IN_PROGRESS(hdr)); + + arc_cksum_verify(buf); + + /* + * Compressed buffers do not manipulate the b_freeze_cksum or + * allocate b_thawed. + */ + if (ARC_BUF_COMPRESSED(buf)) { + ASSERT(hdr->b_l1hdr.b_freeze_cksum == NULL || + arc_hdr_has_uncompressed_buf(hdr)); + return; } ASSERT(HDR_HAS_L1HDR(hdr)); @@ -1645,6 +1746,12 @@ arc_buf_freeze(arc_buf_t *buf) if (!(zfs_flags & ZFS_DEBUG_MODIFY)) return; + if (ARC_BUF_COMPRESSED(buf)) { + ASSERT(hdr->b_l1hdr.b_freeze_cksum == NULL || + arc_hdr_has_uncompressed_buf(hdr)); + return; + } + hash_lock = HDR_LOCK(hdr); mutex_enter(hash_lock); @@ -1653,7 +1760,6 @@ arc_buf_freeze(arc_buf_t *buf) hdr->b_l1hdr.b_state == arc_anon); arc_cksum_compute(buf); mutex_exit(hash_lock); - } /* @@ -1710,47 +1816,157 @@ arc_hdr_set_compress(arc_buf_hdr_t *hdr, } } +/* + * Looks for another buf on the same hdr which has the data decompressed, copies + * from it, and returns true. If no such buf exists, returns false. + */ +static boolean_t +arc_buf_try_copy_decompressed_data(arc_buf_t *buf) +{ + arc_buf_hdr_t *hdr = buf->b_hdr; + boolean_t copied = B_FALSE; + + ASSERT(HDR_HAS_L1HDR(hdr)); + ASSERT3P(buf->b_data, !=, NULL); + ASSERT(!ARC_BUF_COMPRESSED(buf)); + + for (arc_buf_t *from = hdr->b_l1hdr.b_buf; from != NULL; + from = from->b_next) { + /* can't use our own data buffer */ + if (from == buf) { + continue; + } + + if (!ARC_BUF_COMPRESSED(from)) { + bcopy(from->b_data, buf->b_data, arc_buf_size(buf)); + copied = B_TRUE; + break; + } + } + + /* + * There were no decompressed bufs, so there should not be a + * checksum on the hdr either. + */ + EQUIV(!copied, hdr->b_l1hdr.b_freeze_cksum == NULL); + + return (copied); +} + +/* + * Given a buf that has a data buffer attached to it, this function will + * efficiently fill the buf with data of the specified compression setting from + * the hdr and update the hdr's b_freeze_cksum if necessary. If the buf and hdr + * are already sharing a data buf, no copy is performed. + * + * If the buf is marked as compressed but uncompressed data was requested, this + * will allocate a new data buffer for the buf, remove that flag, and fill the + * buf with uncompressed data. You can't request a compressed buf on a hdr with + * uncompressed data, and (since we haven't added support for it yet) if you + * want compressed data your buf must already be marked as compressed and have + * the correct-sized data buffer. + */ static int -arc_decompress(arc_buf_t *buf) +arc_buf_fill(arc_buf_t *buf, boolean_t compressed) { arc_buf_hdr_t *hdr = buf->b_hdr; + boolean_t hdr_compressed = (HDR_GET_COMPRESS(hdr) != ZIO_COMPRESS_OFF); dmu_object_byteswap_t bswap = hdr->b_l1hdr.b_byteswap; - int error; - if (arc_buf_is_shared(buf)) { - ASSERT3U(HDR_GET_COMPRESS(hdr), ==, ZIO_COMPRESS_OFF); - } else if (HDR_GET_COMPRESS(hdr) == ZIO_COMPRESS_OFF) { - /* - * The arc_buf_hdr_t is either not compressed or is - * associated with an embedded block or a hole in which - * case they remain anonymous. - */ - IMPLY(HDR_COMPRESSION_ENABLED(hdr), HDR_GET_PSIZE(hdr) == 0 || - HDR_GET_PSIZE(hdr) == HDR_GET_LSIZE(hdr)); - ASSERT(!HDR_SHARED_DATA(hdr)); - bcopy(hdr->b_l1hdr.b_pdata, buf->b_data, HDR_GET_LSIZE(hdr)); + ASSERT3P(buf->b_data, !=, NULL); + IMPLY(compressed, hdr_compressed); + IMPLY(compressed, ARC_BUF_COMPRESSED(buf)); + + if (hdr_compressed == compressed) { + if (!arc_buf_is_shared(buf)) { + bcopy(hdr->b_l1hdr.b_pdata, buf->b_data, + arc_buf_size(buf)); + } } else { - ASSERT(!HDR_SHARED_DATA(hdr)); + ASSERT(hdr_compressed); + ASSERT(!compressed); ASSERT3U(HDR_GET_LSIZE(hdr), !=, HDR_GET_PSIZE(hdr)); - error = zio_decompress_data(HDR_GET_COMPRESS(hdr), - hdr->b_l1hdr.b_pdata, buf->b_data, HDR_GET_PSIZE(hdr), - HDR_GET_LSIZE(hdr)); - if (error != 0) { - zfs_dbgmsg("hdr %p, compress %d, psize %d, lsize %d", - hdr, HDR_GET_COMPRESS(hdr), HDR_GET_PSIZE(hdr), - HDR_GET_LSIZE(hdr)); - return (SET_ERROR(EIO)); + + /* + * If the buf is sharing its data with the hdr, unlink it and + * allocate a new data buffer for the buf. + */ + if (arc_buf_is_shared(buf)) { + ASSERT(ARC_BUF_COMPRESSED(buf)); + + /* We need to give the buf it's own b_data */ + buf->b_flags &= ~ARC_BUF_FLAG_SHARED; + buf->b_data = + arc_get_data_buf(hdr, HDR_GET_LSIZE(hdr), buf); + arc_hdr_clear_flags(hdr, ARC_FLAG_SHARED_DATA); + + /* Previously overhead was 0; just add new overhead */ + ARCSTAT_INCR(arcstat_overhead_size, HDR_GET_LSIZE(hdr)); + } else if (ARC_BUF_COMPRESSED(buf)) { + /* We need to reallocate the buf's b_data */ + arc_free_data_buf(hdr, buf->b_data, HDR_GET_PSIZE(hdr), + buf); + buf->b_data = + arc_get_data_buf(hdr, HDR_GET_LSIZE(hdr), buf); + + /* We increased the size of b_data; update overhead */ + ARCSTAT_INCR(arcstat_overhead_size, + HDR_GET_LSIZE(hdr) - HDR_GET_PSIZE(hdr)); + } + + /* + * Regardless of the buf's previous compression settings, it + * should not be compressed at the end of this function. + */ + buf->b_flags &= ~ARC_BUF_FLAG_COMPRESSED; + + /* + * Try copying the data from another buf which already has a + * decompressed version. If that's not possible, it's time to + * bite the bullet and decompress the data from the hdr. + */ + if (arc_buf_try_copy_decompressed_data(buf)) { + /* Skip byteswapping and checksumming (already done) */ + ASSERT3P(hdr->b_l1hdr.b_freeze_cksum, !=, NULL); + return (0); + } else { + int error = zio_decompress_data(HDR_GET_COMPRESS(hdr), + hdr->b_l1hdr.b_pdata, buf->b_data, + HDR_GET_PSIZE(hdr), HDR_GET_LSIZE(hdr)); + + /* + * Absent hardware errors or software bugs, this should + * be impossible, but log it anyway so we can debug it. + */ + if (error != 0) { + zfs_dbgmsg( + "hdr %p, compress %d, psize %d, lsize %d", + hdr, HDR_GET_COMPRESS(hdr), + HDR_GET_PSIZE(hdr), HDR_GET_LSIZE(hdr)); + return (SET_ERROR(EIO)); + } } } + + /* Byteswap the buf's data if necessary */ if (bswap != DMU_BSWAP_NUMFUNCS) { ASSERT(!HDR_SHARED_DATA(hdr)); ASSERT3U(bswap, <, DMU_BSWAP_NUMFUNCS); dmu_ot_byteswap[bswap].ob_func(buf->b_data, HDR_GET_LSIZE(hdr)); } + + /* Compute the hdr's checksum if necessary */ arc_cksum_compute(buf); + return (0); } +int +arc_decompress(arc_buf_t *buf) +{ + return (arc_buf_fill(buf, B_FALSE)); +} + /* * Return the size of the block, b_pdata, that is stored in the arc_buf_hdr_t. */ @@ -1778,7 +1994,6 @@ static void arc_evictable_space_increment(arc_buf_hdr_t *hdr, arc_state_t *state) { arc_buf_contents_t type = arc_buf_type(hdr); - uint64_t lsize = HDR_GET_LSIZE(hdr); ASSERT(HDR_HAS_L1HDR(hdr)); @@ -1786,7 +2001,8 @@ arc_evictable_space_increment(arc_buf_hd ASSERT0(hdr->b_l1hdr.b_bufcnt); ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL); ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL); - (void) refcount_add_many(&state->arcs_esize[type], lsize, hdr); + (void) refcount_add_many(&state->arcs_esize[type], + HDR_GET_LSIZE(hdr), hdr); return; } @@ -1797,11 +2013,10 @@ arc_evictable_space_increment(arc_buf_hd } for (arc_buf_t *buf = hdr->b_l1hdr.b_buf; buf != NULL; buf = buf->b_next) { - if (arc_buf_is_shared(buf)) { - ASSERT(ARC_BUF_LAST(buf)); + if (arc_buf_is_shared(buf)) continue; - } - (void) refcount_add_many(&state->arcs_esize[type], lsize, buf); + (void) refcount_add_many(&state->arcs_esize[type], + arc_buf_size(buf), buf); } } @@ -1811,10 +2026,9 @@ arc_evictable_space_increment(arc_buf_hd * so that we can add and remove them from the refcount individually. */ static void -arc_evitable_space_decrement(arc_buf_hdr_t *hdr, arc_state_t *state) +arc_evictable_space_decrement(arc_buf_hdr_t *hdr, arc_state_t *state) { arc_buf_contents_t type = arc_buf_type(hdr); - uint64_t lsize = HDR_GET_LSIZE(hdr); ASSERT(HDR_HAS_L1HDR(hdr)); @@ -1823,7 +2037,7 @@ arc_evitable_space_decrement(arc_buf_hdr ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL); ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL); (void) refcount_remove_many(&state->arcs_esize[type], - lsize, hdr); + HDR_GET_LSIZE(hdr), hdr); return; } @@ -1834,12 +2048,10 @@ arc_evitable_space_decrement(arc_buf_hdr } for (arc_buf_t *buf = hdr->b_l1hdr.b_buf; buf != NULL; buf = buf->b_next) { - if (arc_buf_is_shared(buf)) { - ASSERT(ARC_BUF_LAST(buf)); + if (arc_buf_is_shared(buf)) continue; - } (void) refcount_remove_many(&state->arcs_esize[type], - lsize, buf); + arc_buf_size(buf), buf); } } @@ -1867,7 +2079,7 @@ add_reference(arc_buf_hdr_t *hdr, void * if (state != arc_l2c_only) { multilist_remove(&state->arcs_list[arc_buf_type(hdr)], hdr); - arc_evitable_space_decrement(hdr, state); + arc_evictable_space_decrement(hdr, state); } /* remove the prefetch flag if we get a reference */ arc_hdr_clear_flags(hdr, ARC_FLAG_PREFETCH); @@ -1955,7 +2167,7 @@ arc_change_state(arc_state_t *new_state, ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL); update_old = B_TRUE; } - arc_evitable_space_decrement(hdr, old_state); + arc_evictable_space_decrement(hdr, old_state); } if (new_state != arc_anon && new_state != arc_l2c_only) { @@ -2018,13 +2230,11 @@ arc_change_state(arc_state_t *new_state, * add to the refcount if the arc_buf_t is * not shared. */ - if (arc_buf_is_shared(buf)) { - ASSERT(ARC_BUF_LAST(buf)); + if (arc_buf_is_shared(buf)) continue; - } (void) refcount_add_many(&new_state->arcs_size, - HDR_GET_LSIZE(hdr), buf); + arc_buf_size(buf), buf); } ASSERT3U(bufcnt, ==, buffers); @@ -2041,6 +2251,7 @@ arc_change_state(arc_state_t *new_state, ASSERT(HDR_HAS_L1HDR(hdr)); if (GHOST_STATE(old_state)) { ASSERT0(bufcnt); + ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL); /* * When moving a header off of a ghost state, @@ -2052,7 +2263,6 @@ arc_change_state(arc_state_t *new_state, (void) refcount_remove_many(&old_state->arcs_size, HDR_GET_LSIZE(hdr), hdr); - ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL); } else { uint32_t buffers = 0; @@ -2063,7 +2273,7 @@ arc_change_state(arc_state_t *new_state, */ for (arc_buf_t *buf = hdr->b_l1hdr.b_buf; buf != NULL; buf = buf->b_next) { - ASSERT3P(bufcnt, !=, 0); + ASSERT3U(bufcnt, !=, 0); buffers++; /* @@ -2073,13 +2283,11 @@ arc_change_state(arc_state_t *new_state, * add to the refcount if the arc_buf_t is * not shared. */ - if (arc_buf_is_shared(buf)) { - ASSERT(ARC_BUF_LAST(buf)); + if (arc_buf_is_shared(buf)) continue; - } (void) refcount_remove_many( - &old_state->arcs_size, HDR_GET_LSIZE(hdr), + &old_state->arcs_size, arc_buf_size(buf), buf); } ASSERT3U(bufcnt, ==, buffers); @@ -2164,11 +2372,50 @@ arc_space_return(uint64_t space, arc_spa } /* - * Allocate an initial buffer for this hdr, subsequent buffers will - * use arc_buf_clone(). + * Given a hdr and a buf, returns whether that buf can share its b_data buffer + * with the hdr's b_pdata. */ -static arc_buf_t * -arc_buf_alloc_impl(arc_buf_hdr_t *hdr, void *tag) +static boolean_t +arc_can_share(arc_buf_hdr_t *hdr, arc_buf_t *buf) +{ + /* + * The criteria for sharing a hdr's data are: + * 1. the hdr's compression matches the buf's compression + * 2. the hdr doesn't need to be byteswapped + * 3. the hdr isn't already being shared + * 4. the buf is either compressed or it is the last buf in the hdr list + * + * Criterion #4 maintains the invariant that shared uncompressed + * bufs must be the final buf in the hdr's b_buf list. Reading this, you + * might ask, "if a compressed buf is allocated first, won't that be the + * last thing in the list?", but in that case it's impossible to create + * a shared uncompressed buf anyway (because the hdr must be compressed + * to have the compressed buf). You might also think that #3 is + * sufficient to make this guarantee, however it's possible + * (specifically in the rare L2ARC write race mentioned in + * arc_buf_alloc_impl()) there will be an existing uncompressed buf that + * is sharable, but wasn't at the time of its allocation. Rather than + * allow a new shared uncompressed buf to be created and then shuffle + * the list around to make it the last element, this simply disallows + * sharing if the new buf isn't the first to be added. + */ + ASSERT3P(buf->b_hdr, ==, hdr); + boolean_t hdr_compressed = HDR_GET_COMPRESS(hdr) != ZIO_COMPRESS_OFF; + boolean_t buf_compressed = ARC_BUF_COMPRESSED(buf) != 0; + return (buf_compressed == hdr_compressed && + hdr->b_l1hdr.b_byteswap == DMU_BSWAP_NUMFUNCS && + !HDR_SHARED_DATA(hdr) && + (ARC_BUF_LAST(buf) || ARC_BUF_COMPRESSED(buf))); +} + +/* + * Allocate a buf for this hdr. If you care about the data that's in the hdr, + * or if you want a compressed buffer, pass those flags in. Returns 0 if the + * copy was made successfully, or an error code otherwise. + */ +static int +arc_buf_alloc_impl(arc_buf_hdr_t *hdr, void *tag, boolean_t compressed, + boolean_t fill, arc_buf_t **ret) { arc_buf_t *buf; @@ -2176,15 +2423,14 @@ arc_buf_alloc_impl(arc_buf_hdr_t *hdr, v ASSERT3U(HDR_GET_LSIZE(hdr), >, 0); VERIFY(hdr->b_type == ARC_BUFC_DATA || hdr->b_type == ARC_BUFC_METADATA); + ASSERT3P(ret, !=, NULL); + ASSERT3P(*ret, ==, NULL); - ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt)); - ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL); - ASSERT0(hdr->b_l1hdr.b_bufcnt); - - buf = kmem_cache_alloc(buf_cache, KM_PUSHPAGE); + buf = *ret = kmem_cache_alloc(buf_cache, KM_PUSHPAGE); buf->b_hdr = hdr; buf->b_data = NULL; - buf->b_next = NULL; + buf->b_next = hdr->b_l1hdr.b_buf; + buf->b_flags = 0; add_reference(hdr, tag); @@ -2195,58 +2441,63 @@ arc_buf_alloc_impl(arc_buf_hdr_t *hdr, v ASSERT(MUTEX_HELD(HDR_LOCK(hdr)) || HDR_EMPTY(hdr)); /* - * If the hdr's data can be shared (no byteswapping, hdr is - * uncompressed, hdr's data is not currently being written to the - * L2ARC write) then we share the data buffer and set the appropriate - * bit in the hdr's b_flags to indicate the hdr is sharing it's - * b_pdata with the arc_buf_t. Otherwise, we allocate a new buffer to - * store the buf's data. + * Only honor requests for compressed bufs if the hdr is actually + * compressed. */ - if (hdr->b_l1hdr.b_byteswap == DMU_BSWAP_NUMFUNCS && - HDR_GET_COMPRESS(hdr) == ZIO_COMPRESS_OFF && !HDR_L2_WRITING(hdr)) { + if (compressed && HDR_GET_COMPRESS(hdr) != ZIO_COMPRESS_OFF) + buf->b_flags |= ARC_BUF_FLAG_COMPRESSED; + + /* + * If the hdr's data can be shared then we share the data buffer and + * set the appropriate bit in the hdr's b_flags to indicate the hdr is + * sharing it's b_pdata with the arc_buf_t. Otherwise, we allocate a new + * buffer to store the buf's data. + * + * There is one additional restriction here because we're sharing + * hdr -> buf instead of the usual buf -> hdr: the hdr can't be actively + * involved in an L2ARC write, because if this buf is used by an + * arc_write() then the hdr's data buffer will be released when the + * write completes, even though the L2ARC write might still be using it. + */ + boolean_t can_share = arc_can_share(hdr, buf) && !HDR_L2_WRITING(hdr); + + /* Set up b_data and sharing */ + if (can_share) { buf->b_data = hdr->b_l1hdr.b_pdata; + buf->b_flags |= ARC_BUF_FLAG_SHARED; arc_hdr_set_flags(hdr, ARC_FLAG_SHARED_DATA); } else { - buf->b_data = arc_get_data_buf(hdr, HDR_GET_LSIZE(hdr), buf); - ARCSTAT_INCR(arcstat_overhead_size, HDR_GET_LSIZE(hdr)); - arc_hdr_clear_flags(hdr, ARC_FLAG_SHARED_DATA); + buf->b_data = + arc_get_data_buf(hdr, arc_buf_size(buf), buf); + ARCSTAT_INCR(arcstat_overhead_size, arc_buf_size(buf)); } VERIFY3P(buf->b_data, !=, NULL); hdr->b_l1hdr.b_buf = buf; hdr->b_l1hdr.b_bufcnt += 1; - return (buf); -} + /* + * If the user wants the data from the hdr, we need to either copy or + * decompress the data. + */ + if (fill) { + return (arc_buf_fill(buf, ARC_BUF_COMPRESSED(buf) != 0)); + } -/* - * Used when allocating additional buffers. - */ -static arc_buf_t * -arc_buf_clone(arc_buf_t *from) -{ - arc_buf_t *buf; - arc_buf_hdr_t *hdr = from->b_hdr; - uint64_t size = HDR_GET_LSIZE(hdr); + return (0); +} - ASSERT(HDR_HAS_L1HDR(hdr)); - ASSERT(hdr->b_l1hdr.b_state != arc_anon); +static char *arc_onloan_tag = "onloan"; - buf = kmem_cache_alloc(buf_cache, KM_PUSHPAGE); - buf->b_hdr = hdr; - buf->b_data = NULL; - buf->b_next = hdr->b_l1hdr.b_buf; - hdr->b_l1hdr.b_buf = buf; - buf->b_data = arc_get_data_buf(hdr, HDR_GET_LSIZE(hdr), buf); - bcopy(from->b_data, buf->b_data, size); - hdr->b_l1hdr.b_bufcnt += 1; +static inline void +arc_loaned_bytes_update(int64_t delta) +{ + atomic_add_64(&arc_loaned_bytes, delta); - ARCSTAT_INCR(arcstat_overhead_size, HDR_GET_LSIZE(hdr)); - return (buf); + /* assert that it did not wrap around */ + ASSERT3S(atomic_add_64_nv(&arc_loaned_bytes, 0), >=, 0); } -static char *arc_onloan_tag = "onloan"; - /* * Loan out an anonymous arc buffer. Loaned buffers are not counted as in * flight data by arc_tempreserve_space() until they are "returned". Loaned @@ -2254,16 +2505,29 @@ static char *arc_onloan_tag = "onloan"; * freed. */ arc_buf_t * -arc_loan_buf(spa_t *spa, int size) +arc_loan_buf(spa_t *spa, boolean_t is_metadata, int size) { - arc_buf_t *buf; + arc_buf_t *buf = arc_alloc_buf(spa, arc_onloan_tag, + is_metadata ? ARC_BUFC_METADATA : ARC_BUFC_DATA, size); - buf = arc_alloc_buf(spa, size, arc_onloan_tag, ARC_BUFC_DATA); + arc_loaned_bytes_update(size); - atomic_add_64(&arc_loaned_bytes, size); return (buf); } +arc_buf_t * +arc_loan_compressed_buf(spa_t *spa, uint64_t psize, uint64_t lsize, + enum zio_compress compression_type) +{ + arc_buf_t *buf = arc_alloc_compressed_buf(spa, arc_onloan_tag, + psize, lsize, compression_type); + + arc_loaned_bytes_update(psize); + + return (buf); +} + + /* * Return a loaned arc buffer to the arc. */ @@ -2277,7 +2541,7 @@ arc_return_buf(arc_buf_t *buf, void *tag (void) refcount_add(&hdr->b_l1hdr.b_refcnt, tag); (void) refcount_remove(&hdr->b_l1hdr.b_refcnt, arc_onloan_tag); - atomic_add_64(&arc_loaned_bytes, -HDR_GET_LSIZE(hdr)); + arc_loaned_bytes_update(-arc_buf_size(buf)); } /* Detach an arc_buf from a dbuf (tag) */ @@ -2291,7 +2555,7 @@ arc_loan_inuse_buf(arc_buf_t *buf, void (void) refcount_add(&hdr->b_l1hdr.b_refcnt, arc_onloan_tag); (void) refcount_remove(&hdr->b_l1hdr.b_refcnt, tag); - atomic_add_64(&arc_loaned_bytes, HDR_GET_LSIZE(hdr)); + arc_loaned_bytes_update(arc_buf_size(buf)); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 14 18:07:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 672CED3E6AF; Fri, 14 Apr 2017 18:07:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F8FB1673; Fri, 14 Apr 2017 18:07:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EI7irV061736; Fri, 14 Apr 2017 18:07:44 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EI7hWe061729; Fri, 14 Apr 2017 18:07:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141807.v3EI7hWe061729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316894 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zfs vendor/illumos/dist/cmd/zstreamdump vendor/illumos/dist/lib... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:07:45 -0000 Author: avg Date: Fri Apr 14 18:07:43 2017 New Revision: 316894 URL: https://svnweb.freebsd.org/changeset/base/316894 Log: 7252 7628 compressed zfs send / receive illumos/illumos-gate@5602294fda888d923d57a78bafdaf48ae6223dea https://github.com/illumos/illumos-gate/commit/5602294fda888d923d57a78bafdaf48ae6223dea https://www.illumos.org/issues/7252 This feature includes code to allow a system with compressed ARC enabled to send data in its compressed form straight out of the ARC, and receive data in its compressed form directly into the ARC. https://www.illumos.org/issues/7628 We should have longer, more readable versions of the ZFS send / recv options. 7628 create long versions of ZFS send / receive options Reviewed by: George Wilson Reviewed by: John Kennedy Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Pavel Zakharov Reviewed by: Sebastien Roy Reviewed by: David Quigley Reviewed by: Thomas Caputi Approved by: Dan McDonald Author: Dan Kimmel Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/cmd/zstreamdump/zstreamdump.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h vendor/illumos/dist/man/man1m/zfs.1m Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_send.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_compress.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_main.c Fri Apr 14 18:05:20 2017 (r316893) +++ vendor/illumos/dist/cmd/zfs/zfs_main.c Fri Apr 14 18:07:43 2017 (r316894) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -262,7 +263,7 @@ get_usage(zfs_help_t idx) case HELP_ROLLBACK: return (gettext("\trollback [-rRf] \n")); case HELP_SEND: - return (gettext("\tsend [-DnPpRvLe] [-[iI] snapshot] " + return (gettext("\tsend [-DnPpRvLec] [-[iI] snapshot] " "\n" "\tsend [-Le] [-i snapshot|bookmark] " "\n" @@ -3704,8 +3705,23 @@ zfs_do_send(int argc, char **argv) nvlist_t *dbgnv = NULL; boolean_t extraverbose = B_FALSE; + struct option long_options[] = { + {"replicate", no_argument, NULL, 'R'}, + {"props", no_argument, NULL, 'p'}, + {"parsable", no_argument, NULL, 'P'}, + {"dedup", no_argument, NULL, 'D'}, + {"verbose", no_argument, NULL, 'v'}, + {"dryrun", no_argument, NULL, 'n'}, + {"large-block", no_argument, NULL, 'L'}, + {"embed", no_argument, NULL, 'e'}, + {"resume", required_argument, NULL, 't'}, + {"compressed", no_argument, NULL, 'c'}, + {0, 0, 0, 0} + }; + /* check options */ - while ((c = getopt(argc, argv, ":i:I:RDpvnPLet:")) != -1) { + while ((c = getopt_long(argc, argv, ":i:I:RbDpvnPLet:c", long_options, + NULL)) != -1) { switch (c) { case 'i': if (fromname) @@ -3749,12 +3765,17 @@ zfs_do_send(int argc, char **argv) case 't': resume_token = optarg; break; + case 'c': + flags.compress = B_TRUE; + break; case ':': (void) fprintf(stderr, gettext("missing argument for " "'%c' option\n"), optopt); usage(B_FALSE); break; case '?': + /*FALLTHROUGH*/ + default: (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); usage(B_FALSE); @@ -3825,6 +3846,8 @@ zfs_do_send(int argc, char **argv) lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; if (flags.embed_data) lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; + if (flags.compress) + lzc_flags |= LZC_SEND_FLAG_COMPRESS; if (fromname != NULL && (fromname[0] == '#' || fromname[0] == '@')) { Modified: vendor/illumos/dist/cmd/zstreamdump/zstreamdump.c ============================================================================== --- vendor/illumos/dist/cmd/zstreamdump/zstreamdump.c Fri Apr 14 18:05:20 2017 (r316893) +++ vendor/illumos/dist/cmd/zstreamdump/zstreamdump.c Fri Apr 14 18:07:43 2017 (r316894) @@ -25,8 +25,8 @@ */ /* - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #include @@ -39,6 +39,7 @@ #include #include +#include #include /* @@ -251,6 +252,7 @@ main(int argc, char *argv[]) (void) fprintf(stderr, "invalid option '%c'\n", optopt); usage(); + break; } } @@ -453,38 +455,50 @@ main(int argc, char *argv[]) drrw->drr_object = BSWAP_64(drrw->drr_object); drrw->drr_type = BSWAP_32(drrw->drr_type); drrw->drr_offset = BSWAP_64(drrw->drr_offset); - drrw->drr_length = BSWAP_64(drrw->drr_length); + drrw->drr_logical_size = + BSWAP_64(drrw->drr_logical_size); drrw->drr_toguid = BSWAP_64(drrw->drr_toguid); drrw->drr_key.ddk_prop = BSWAP_64(drrw->drr_key.ddk_prop); + drrw->drr_compressed_size = + BSWAP_64(drrw->drr_compressed_size); } + + uint64_t payload_size = DRR_WRITE_PAYLOAD_SIZE(drrw); + /* * If this is verbose and/or dump output, * print info on the modified block */ if (verbose) { (void) printf("WRITE object = %llu type = %u " - "checksum type = %u\n" - " offset = %llu length = %llu " + "checksum type = %u compression type = %u\n" + " offset = %llu logical_size = %llu " + "compressed_size = %llu " + "payload_size = %llu " "props = %llx\n", (u_longlong_t)drrw->drr_object, drrw->drr_type, drrw->drr_checksumtype, + drrw->drr_compressiontype, (u_longlong_t)drrw->drr_offset, - (u_longlong_t)drrw->drr_length, + (u_longlong_t)drrw->drr_logical_size, + (u_longlong_t)drrw->drr_compressed_size, + (u_longlong_t)payload_size, (u_longlong_t)drrw->drr_key.ddk_prop); } + /* * Read the contents of the block in from STDIN to buf */ - (void) ssread(buf, drrw->drr_length, &zc); + (void) ssread(buf, payload_size, &zc); /* * If in dump mode */ if (dump) { - print_block(buf, drrw->drr_length); + print_block(buf, payload_size); } - total_write_size += drrw->drr_length; + total_write_size += payload_size; break; case DRR_WRITE_BYREF: Modified: vendor/illumos/dist/lib/libzfs/common/libzfs.h ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs.h Fri Apr 14 18:05:20 2017 (r316893) +++ vendor/illumos/dist/lib/libzfs/common/libzfs.h Fri Apr 14 18:07:43 2017 (r316894) @@ -600,6 +600,9 @@ typedef struct sendflags { /* WRITE_EMBEDDED records of type DATA are permitted */ boolean_t embed_data; + + /* compressed WRITE records are permitted */ + boolean_t compress; } sendflags_t; typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *); Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Fri Apr 14 18:05:20 2017 (r316893) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Fri Apr 14 18:07:43 2017 (r316894) @@ -347,8 +347,10 @@ cksummer(void *arg) { struct drr_write *drrw = &drr->drr_u.drr_write; dataref_t dataref; + uint64_t payload_size; - (void) ssread(buf, drrw->drr_length, ofp); + payload_size = DRR_WRITE_PAYLOAD_SIZE(drrw); + (void) ssread(buf, payload_size, ofp); /* * Use the existing checksum if it's dedup-capable, @@ -362,7 +364,7 @@ cksummer(void *arg) zio_cksum_t tmpsha256; SHA256Init(&ctx); - SHA256Update(&ctx, buf, drrw->drr_length); + SHA256Update(&ctx, buf, payload_size); SHA256Final(&tmpsha256, &ctx); drrw->drr_key.ddk_cksum.zc_word[0] = BE_64(tmpsha256.zc_word[0]); @@ -392,7 +394,7 @@ cksummer(void *arg) wbr_drrr->drr_object = drrw->drr_object; wbr_drrr->drr_offset = drrw->drr_offset; - wbr_drrr->drr_length = drrw->drr_length; + wbr_drrr->drr_length = drrw->drr_logical_size; wbr_drrr->drr_toguid = drrw->drr_toguid; wbr_drrr->drr_refguid = dataref.ref_guid; wbr_drrr->drr_refobject = @@ -414,7 +416,7 @@ cksummer(void *arg) goto out; } else { /* block not previously seen */ - if (dump_record(drr, buf, drrw->drr_length, + if (dump_record(drr, buf, payload_size, &stream_cksum, outfd) != 0) goto out; } @@ -917,7 +919,7 @@ typedef struct send_dump_data { uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; boolean_t verbose, dryrun, parsable, progress, embed_data, std_out; - boolean_t large_block; + boolean_t large_block, compress; int outfd; boolean_t err; nvlist_t *fss; @@ -933,7 +935,7 @@ typedef struct send_dump_data { static int estimate_ioctl(zfs_handle_t *zhp, uint64_t fromsnap_obj, - boolean_t fromorigin, uint64_t *sizep) + boolean_t fromorigin, enum lzc_send_flags flags, uint64_t *sizep) { zfs_cmd_t zc = { 0 }; libzfs_handle_t *hdl = zhp->zfs_hdl; @@ -946,6 +948,7 @@ estimate_ioctl(zfs_handle_t *zhp, uint64 zc.zc_sendobj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID); zc.zc_fromobj = fromsnap_obj; zc.zc_guid = 1; /* estimate flag */ + zc.zc_flags = flags; if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_SEND, &zc) != 0) { char errbuf[1024]; @@ -1184,6 +1187,7 @@ dump_snapshot(zfs_handle_t *zhp, void *a progress_arg_t pa = { 0 }; pthread_t tid; char *thissnap; + enum lzc_send_flags flags = 0; int err; boolean_t isfromsnap, istosnap, fromorigin; boolean_t exclude = B_FALSE; @@ -1212,6 +1216,13 @@ dump_snapshot(zfs_handle_t *zhp, void *a if (istosnap) sdd->seento = B_TRUE; + if (sdd->large_block) + flags |= LZC_SEND_FLAG_LARGE_BLOCK; + if (sdd->embed_data) + flags |= LZC_SEND_FLAG_EMBED_DATA; + if (sdd->compress) + flags |= LZC_SEND_FLAG_COMPRESS; + if (!sdd->doall && !isfromsnap && !istosnap) { if (sdd->replicate) { char *snapname; @@ -1258,7 +1269,7 @@ dump_snapshot(zfs_handle_t *zhp, void *a if (sdd->verbose) { uint64_t size = 0; (void) estimate_ioctl(zhp, sdd->prevsnap_obj, - fromorigin, &size); + fromorigin, flags, &size); send_print_verbose(fout, zhp->zfs_name, sdd->prevsnap[0] ? sdd->prevsnap : NULL, @@ -1283,12 +1294,6 @@ dump_snapshot(zfs_handle_t *zhp, void *a } } - enum lzc_send_flags flags = 0; - if (sdd->large_block) - flags |= LZC_SEND_FLAG_LARGE_BLOCK; - if (sdd->embed_data) - flags |= LZC_SEND_FLAG_EMBED_DATA; - err = dump_ioctl(zhp, sdd->prevsnap, sdd->prevsnap_obj, fromorigin, sdd->outfd, flags, sdd->debugnv); @@ -1594,8 +1599,12 @@ zfs_send_resume(libzfs_handle_t *hdl, se fromguid = 0; (void) nvlist_lookup_uint64(resume_nvl, "fromguid", &fromguid); + if (flags->largeblock || nvlist_exists(resume_nvl, "largeblockok")) + lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; if (flags->embed_data || nvlist_exists(resume_nvl, "embedok")) lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; + if (flags->compress || nvlist_exists(resume_nvl, "compressok")) + lzc_flags |= LZC_SEND_FLAG_COMPRESS; if (guid_to_name(hdl, toname, toguid, B_FALSE, name) != 0) { if (zfs_dataset_exists(hdl, toname, ZFS_TYPE_DATASET)) { @@ -1628,7 +1637,8 @@ zfs_send_resume(libzfs_handle_t *hdl, se if (flags->verbose) { uint64_t size = 0; - error = lzc_send_space(zhp->zfs_name, fromname, &size); + error = lzc_send_space(zhp->zfs_name, fromname, + lzc_flags, &size); if (error == 0) size = MAX(0, (int64_t)(size - bytes)); send_print_verbose(stderr, zhp->zfs_name, fromname, @@ -1856,6 +1866,7 @@ zfs_send(zfs_handle_t *zhp, const char * sdd.dryrun = flags->dryrun; sdd.large_block = flags->largeblock; sdd.embed_data = flags->embed_data; + sdd.compress = flags->compress; sdd.filter_cb = filter_func; sdd.filter_cb_arg = cb_arg; if (debugnvp) @@ -2921,11 +2932,17 @@ recv_skip(libzfs_handle_t *hdl, int fd, case DRR_WRITE: if (byteswap) { - drr->drr_u.drr_write.drr_length = - BSWAP_64(drr->drr_u.drr_write.drr_length); + drr->drr_u.drr_write.drr_logical_size = + BSWAP_64( + drr->drr_u.drr_write.drr_logical_size); + drr->drr_u.drr_write.drr_compressed_size = + BSWAP_64( + drr->drr_u.drr_write.drr_compressed_size); } + uint64_t payload_size = + DRR_WRITE_PAYLOAD_SIZE(&drr->drr_u.drr_write); (void) recv_read(hdl, fd, buf, - drr->drr_u.drr_write.drr_length, B_FALSE, NULL); + payload_size, B_FALSE, NULL); break; case DRR_SPILL: if (byteswap) { Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Fri Apr 14 18:05:20 2017 (r316893) +++ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Fri Apr 14 18:07:43 2017 (r316894) @@ -487,6 +487,8 @@ lzc_send_resume(const char *snapname, co fnvlist_add_boolean(args, "largeblockok"); if (flags & LZC_SEND_FLAG_EMBED_DATA) fnvlist_add_boolean(args, "embedok"); + if (flags & LZC_SEND_FLAG_COMPRESS) + fnvlist_add_boolean(args, "compressok"); if (resumeobj != 0 || resumeoff != 0) { fnvlist_add_uint64(args, "resume_object", resumeobj); fnvlist_add_uint64(args, "resume_offset", resumeoff); @@ -512,7 +514,8 @@ lzc_send_resume(const char *snapname, co * an equivalent snapshot. */ int -lzc_send_space(const char *snapname, const char *from, uint64_t *spacep) +lzc_send_space(const char *snapname, const char *from, + enum lzc_send_flags flags, uint64_t *spacep) { nvlist_t *args; nvlist_t *result; @@ -521,6 +524,12 @@ lzc_send_space(const char *snapname, con args = fnvlist_alloc(); if (from != NULL) fnvlist_add_string(args, "from", from); + if (flags & LZC_SEND_FLAG_LARGE_BLOCK) + fnvlist_add_boolean(args, "largeblockok"); + if (flags & LZC_SEND_FLAG_EMBED_DATA) + fnvlist_add_boolean(args, "embedok"); + if (flags & LZC_SEND_FLAG_COMPRESS) + fnvlist_add_boolean(args, "compressok"); err = lzc_ioctl(ZFS_IOC_SEND_SPACE, snapname, args, &result); nvlist_free(args); if (err == 0) Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Fri Apr 14 18:05:20 2017 (r316893) +++ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Fri Apr 14 18:07:43 2017 (r316894) @@ -62,13 +62,14 @@ int lzc_get_holds(const char *, nvlist_t enum lzc_send_flags { LZC_SEND_FLAG_EMBED_DATA = 1 << 0, - LZC_SEND_FLAG_LARGE_BLOCK = 1 << 1 + LZC_SEND_FLAG_LARGE_BLOCK = 1 << 1, + LZC_SEND_FLAG_COMPRESS = 1 << 2 }; int lzc_send(const char *, const char *, int, enum lzc_send_flags); int lzc_send_resume(const char *, const char *, int, enum lzc_send_flags, uint64_t, uint64_t); -int lzc_send_space(const char *, const char *, uint64_t *); +int lzc_send_space(const char *, const char *, enum lzc_send_flags, uint64_t *); struct dmu_replay_record; Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 18:05:20 2017 (r316893) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Apr 14 18:07:43 2017 (r316894) @@ -165,12 +165,12 @@ .Ar snapshot bookmark .Nm .Cm send -.Op Fl DLPRenpv +.Op Fl DLPRcenpv .Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot .Ar snapshot .Nm .Cm send -.Op Fl Le +.Op Fl Lce .Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm @@ -2450,7 +2450,7 @@ feature. .It Xo .Nm .Cm send -.Op Fl DLPRenpv +.Op Fl DLPRcenpv .Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot .Ar snapshot .Xc @@ -2463,7 +2463,7 @@ to a different system .Pc . By default, a full stream is generated. .Bl -tag -width "-D" -.It Fl D +.It Fl D, -dedup Generate a deduplicated stream. Blocks which would have been sent multiple times in the send stream will only be sent once. The receiving system must also support this feature to receive a deduplicated stream. This flag can be used @@ -2483,7 +2483,7 @@ is similar to The incremental source may be specified as with the .Fl i option. -.It Fl L +.It Fl L, -large-block Generate a stream which may contain blocks larger than 128KB. This flag has no effect if the .Sy large_blocks @@ -2497,9 +2497,9 @@ pool feature enabled as well. See for details on ZFS feature flags and the .Sy large_blocks feature. -.It Fl P +.It Fl P, -parsable Print machine-parsable verbose information about the stream package generated. -.It Fl R +.It Fl R, -replicate Generate a replication stream package, which will replicate the specified file system, and all descendent file systems, up to the named snapshot. When received, all properties, snapshots, descendent file systems, and clones are @@ -2517,7 +2517,7 @@ is received. If the .Fl F flag is specified when this stream is received, snapshots and file systems that do not exist on the sending side are destroyed. -.It Fl e +.It Fl e, -embed Generate a more compact stream by using .Sy WRITE_EMBEDDED records for blocks which are stored more compactly on disk by the @@ -2534,6 +2534,16 @@ that feature enabled as well. See for details on ZFS feature flags and the .Sy embedded_data feature. +.It Fl c, -compressed +Generate a more compact stream by using compressed WRITE records for blocks +which are compressed on disk and in memory (see the +.Sy compression No property for details). If the Sy lz4_compress No feature +is active on the sending system, then the receiving system must have that +feature enabled as well. If the +.Sy large_blocks No feature is enabled on the sending system but the Fl L +option is not supplied in conjunction with +.Fl c, No then the data will be decompressed before sending so it can be split +into smaller block sizes. .It Fl i Ar snapshot Generate an incremental stream from the first .Ar snapshot @@ -2556,7 +2566,7 @@ be fully specified not just .Em @origin .Pc . -.It Fl n +.It Fl n, -dryrun Do a dry-run .Pq Qq No-op send. Do not generate any actual send data. This is useful in conjunction with @@ -2569,11 +2579,11 @@ be written to standard output .Po contrast with a non-dry-run, where the stream is written to standard output and the verbose output goes to standard error .Pc . -.It Fl p +.It Fl p, -props Include the dataset's properties in the stream. This flag is implicit when .Fl R is specified. The receiving system must also support this feature. -.It Fl v +.It Fl v, -verbose Print verbose information about the stream package generated. This information includes a per-second report of how much data has been sent. .Pp @@ -2583,7 +2593,7 @@ on future versions of ZFS . .It Xo .Nm .Cm send -.Op Fl Le +.Op Fl Lce .Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc @@ -2593,7 +2603,7 @@ read-only, or the filesystem must not be a filesystem or volume is received, the default snapshot name will be .Qq --head-- . .Bl -tag -width "-L" -.It Fl L +.It Fl L, -large-block Generate a stream which may contain blocks larger than 128KB. This flag has no effect if the .Sy large_blocks @@ -2607,7 +2617,17 @@ pool feature enabled as well. See for details on ZFS feature flags and the .Sy large_blocks feature. -.It Fl e +.It Fl c, -compressed +Generate a more compact stream by using compressed WRITE records for blocks +which are compressed on disk and in memory (see the +.Sy compression No property for details). If the Sy lz4_compress No feature is +active on the sending system, then the receiving system must have that feature +enabled as well. If the +.Sy large_blocks No feature is enabled on the sending system but the Fl L +option is not supplied in conjunction with +.Fl c, No then the data will be decompressed before sending so it can be split +into smaller block sizes. +.It Fl e, -embed Generate a more compact stream by using .Sy WRITE_EMBEDDED records for blocks which are stored more compactly on disk by the From owner-svn-src-all@freebsd.org Fri Apr 14 18:08:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAD62D3E7A6; Fri, 14 Apr 2017 18:08:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5EC61955; Fri, 14 Apr 2017 18:08:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EI8oek061972; Fri, 14 Apr 2017 18:08:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EI8ouF061971; Fri, 14 Apr 2017 18:08:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141808.v3EI8ouF061971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316895 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:08:52 -0000 Author: avg Date: Fri Apr 14 18:08:50 2017 New Revision: 316895 URL: https://svnweb.freebsd.org/changeset/base/316895 Log: 7606 dmu_objset_find_dp() takes a long time while importing pool illumos/illumos-gate@7588687e6ba67c47bf7c9805086dec4a97fcac7b https://github.com/illumos/illumos-gate/commit/7588687e6ba67c47bf7c9805086dec4a97fcac7b https://www.illumos.org/issues/7606 When importing a pool with a large number of filesystems within the same parent filesystem, we see that dmu_objset_find_dp() takes a long time. It is called from 3 places: spa_check_logs(), spa_ld_claim_log_blocks(), and spa_load_verify(). There are several ways to improve performance here: 1. We don't really need to do spa_check_logs() or spa_ld_claim_log_blocks() if the pool was closed cleanly. 2. spa_load_verify() uses dmu_objset_find_dp() to check that no datasets have too long of names. 3. dmu_objset_find_dp() is slow because it's doing zap_value_search() (which is O(N sibling datasets)) to determine the name of each dsl_dir when it's opened. In this case we actually know the name when we are opening it, so we can provide it and avoid the lookup. This change implements fix #3 from the above list; i.e. make dmu_objset_find_dp() provide the name of the dataset so that we don't have to search for it. Reviewed by: Steve Gonczi Reviewed by: George Wilson Reviewed by: Prashanth Sreenivasa Approved by: Gordon Ross Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Fri Apr 14 18:07:43 2017 (r316894) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Fri Apr 14 18:08:50 2017 (r316895) @@ -1705,6 +1705,7 @@ typedef struct dmu_objset_find_ctx { taskq_t *dc_tq; dsl_pool_t *dc_dp; uint64_t dc_ddobj; + char *dc_ddname; /* last component of ddobj's name */ int (*dc_func)(dsl_pool_t *, dsl_dataset_t *, void *); void *dc_arg; int dc_flags; @@ -1716,7 +1717,6 @@ static void dmu_objset_find_dp_impl(dmu_objset_find_ctx_t *dcp) { dsl_pool_t *dp = dcp->dc_dp; - dmu_objset_find_ctx_t *child_dcp; dsl_dir_t *dd; dsl_dataset_t *ds; zap_cursor_t zc; @@ -1728,7 +1728,12 @@ dmu_objset_find_dp_impl(dmu_objset_find_ if (*dcp->dc_error != 0) goto out; - err = dsl_dir_hold_obj(dp, dcp->dc_ddobj, NULL, FTAG, &dd); + /* + * Note: passing the name (dc_ddname) here is optional, but it + * improves performance because we don't need to call + * zap_value_search() to determine the name. + */ + err = dsl_dir_hold_obj(dp, dcp->dc_ddobj, dcp->dc_ddname, FTAG, &dd); if (err != 0) goto out; @@ -1753,9 +1758,11 @@ dmu_objset_find_dp_impl(dmu_objset_find_ sizeof (uint64_t)); ASSERT3U(attr->za_num_integers, ==, 1); - child_dcp = kmem_alloc(sizeof (*child_dcp), KM_SLEEP); + dmu_objset_find_ctx_t *child_dcp = + kmem_alloc(sizeof (*child_dcp), KM_SLEEP); *child_dcp = *dcp; child_dcp->dc_ddobj = attr->za_first_integer; + child_dcp->dc_ddname = spa_strdup(attr->za_name); if (dcp->dc_tq != NULL) (void) taskq_dispatch(dcp->dc_tq, dmu_objset_find_dp_cb, child_dcp, TQ_SLEEP); @@ -1798,16 +1805,25 @@ dmu_objset_find_dp_impl(dmu_objset_find_ } } - dsl_dir_rele(dd, FTAG); kmem_free(attr, sizeof (zap_attribute_t)); - if (err != 0) + if (err != 0) { + dsl_dir_rele(dd, FTAG); goto out; + } /* * Apply to self. */ err = dsl_dataset_hold_obj(dp, thisobj, FTAG, &ds); + + /* + * Note: we hold the dir while calling dsl_dataset_hold_obj() so + * that the dir will remain cached, and we won't have to re-instantiate + * it (which could be expensive due to finding its name via + * zap_value_search()). + */ + dsl_dir_rele(dd, FTAG); if (err != 0) goto out; err = dcp->dc_func(dp, ds, dcp->dc_arg); @@ -1822,6 +1838,8 @@ out: mutex_exit(dcp->dc_error_lock); } + if (dcp->dc_ddname != NULL) + spa_strfree(dcp->dc_ddname); kmem_free(dcp, sizeof (*dcp)); } @@ -1866,6 +1884,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 dcp->dc_tq = NULL; dcp->dc_dp = dp; dcp->dc_ddobj = ddobj; + dcp->dc_ddname = NULL; dcp->dc_func = func; dcp->dc_arg = arg; dcp->dc_flags = flags; From owner-svn-src-all@freebsd.org Fri Apr 14 18:09:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77490D3E82F; Fri, 14 Apr 2017 18:09:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52AD41B6C; Fri, 14 Apr 2017 18:09:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EI9WJh062045; Fri, 14 Apr 2017 18:09:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EI9WM2062043; Fri, 14 Apr 2017 18:09:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141809.v3EI9WM2062043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316896 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:09:33 -0000 Author: avg Date: Fri Apr 14 18:09:32 2017 New Revision: 316896 URL: https://svnweb.freebsd.org/changeset/base/316896 Log: 7580 ztest failure in dbuf_read_impl illumos/illumos-gate@1a01181fdc809f40c64d5c6881ae3e4521a9d9c7 https://github.com/illumos/illumos-gate/commit/1a01181fdc809f40c64d5c6881ae3e4521a9d9c7 https://www.illumos.org/issues/7580 We need to prevent any reader whenever we're about the zero out all the blkptrs. To do this we need to grab the dn_struct_rwlock as writer in dbuf_write_children_ready and free_children just prior to calling bzero. Reviewed by: Pavel Zakharov Reviewed by: Steve Gonczi Reviewed by: Matthew Ahrens Approved by: Dan McDonald Author: George Wilson Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:08:50 2017 (r316895) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:09:32 2017 (r316896) @@ -3313,13 +3313,13 @@ dbuf_write_children_ready(zio_t *zio, ar dmu_buf_impl_t *db = vdb; dnode_t *dn; blkptr_t *bp; - uint64_t i; - int epbs; + unsigned int epbs, i; ASSERT3U(db->db_level, >, 0); DB_DNODE_ENTER(db); dn = DB_DNODE(db); epbs = dn->dn_phys->dn_indblkshift - SPA_BLKPTRSHIFT; + ASSERT3U(epbs, <, 31); /* Determine if all our children are holes */ for (i = 0, bp = db->db.db_data; i < 1 << epbs; i++, bp++) { @@ -3332,8 +3332,14 @@ dbuf_write_children_ready(zio_t *zio, ar * we may get compressed away. */ if (i == 1 << epbs) { - /* didn't find any non-holes */ + /* + * We only found holes. Grab the rwlock to prevent + * anybody from reading the blocks we're about to + * zero out. + */ + rw_enter(&dn->dn_struct_rwlock, RW_WRITER); bzero(db->db.db_data, db->db.db_size); + rw_exit(&dn->dn_struct_rwlock); } DB_DNODE_EXIT(db); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Fri Apr 14 18:08:50 2017 (r316895) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Fri Apr 14 18:09:32 2017 (r316896) @@ -236,8 +236,8 @@ free_children(dmu_buf_impl_t *db, uint64 dnode_t *dn; blkptr_t *bp; dmu_buf_impl_t *subdb; - uint64_t start, end, dbstart, dbend, i; - int epbs, shift; + uint64_t start, end, dbstart, dbend; + unsigned int epbs, shift, i; /* * There is a small possibility that this block will not be cached: @@ -254,6 +254,7 @@ free_children(dmu_buf_impl_t *db, uint64 DB_DNODE_ENTER(db); dn = DB_DNODE(db); epbs = dn->dn_phys->dn_indblkshift - SPA_BLKPTRSHIFT; + ASSERT3U(epbs, <, 31); shift = (db->db_level - 1) * epbs; dbstart = db->db_blkid << epbs; start = blkid >> shift; @@ -273,12 +274,12 @@ free_children(dmu_buf_impl_t *db, uint64 FREE_VERIFY(db, start, end, tx); free_blocks(dn, bp, end-start+1, tx); } else { - for (i = start; i <= end; i++, bp++) { + for (uint64_t id = start; id <= end; id++, bp++) { if (BP_IS_HOLE(bp)) continue; rw_enter(&dn->dn_struct_rwlock, RW_READER); VERIFY0(dbuf_hold_impl(dn, db->db_level - 1, - i, TRUE, FALSE, FTAG, &subdb)); + id, TRUE, FALSE, FTAG, &subdb)); rw_exit(&dn->dn_struct_rwlock); ASSERT3P(bp, ==, subdb->db_blkptr); @@ -293,8 +294,14 @@ free_children(dmu_buf_impl_t *db, uint64 break; } if (i == 1 << epbs) { - /* didn't find any non-holes */ + /* + * We only found holes. Grab the rwlock to prevent + * anybody from reading the blocks we're about to + * zero out. + */ + rw_enter(&dn->dn_struct_rwlock, RW_WRITER); bzero(db->db.db_data, db->db.db_size); + rw_exit(&dn->dn_struct_rwlock); free_blocks(dn, db->db_blkptr, 1, tx); } else { /* From owner-svn-src-all@freebsd.org Fri Apr 14 18:10:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1633FD3E894; Fri, 14 Apr 2017 18:10:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E59821CD6; Fri, 14 Apr 2017 18:10:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIAO3V062145; Fri, 14 Apr 2017 18:10:24 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIANd1062143; Fri, 14 Apr 2017 18:10:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141810.v3EIANd1062143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316897 - vendor-sys/illumos/dist/uts/common/fs/zfs/sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:10:25 -0000 Author: avg Date: Fri Apr 14 18:10:23 2017 New Revision: 316897 URL: https://svnweb.freebsd.org/changeset/base/316897 Log: 7586 remove #ifdef __lint hack from dmu.h illumos/illumos-gate@4ba5b9616327ef64e8abc737d29b3faabc6ae68c https://github.com/illumos/illumos-gate/commit/4ba5b9616327ef64e8abc737d29b3faabc6ae68c https://www.illumos.org/issues/7586 The #ifdef __lint in dmu.h is ugly, and it would be nice not to duplicate it if we add other inline functions into header files in ZFS, especially since it is difficult to make any other solution work across all compilation targets. We should switch to disabling the lint flags that are failing instead. Reviewed by: Matthew Ahrens Reviewed by: Pavel Zakharov Approved by: Dan McDonald Author: Dan Kimmel Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Fri Apr 14 18:09:32 2017 (r316896) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Fri Apr 14 18:10:23 2017 (r316897) @@ -565,12 +565,7 @@ typedef struct dmu_buf_user { * NOTE: This function should only be called once on a given dmu_buf_user_t. * To allow enforcement of this, dbu must already be zeroed on entry. */ -#ifdef __lint -/* Very ugly, but it beats issuing suppression directives in many Makefiles. */ -extern void -dmu_buf_init_user(dmu_buf_user_t *dbu, dmu_buf_evict_func_t *evict_func, - dmu_buf_evict_func_t *evict_func_async, dmu_buf_t **clear_on_evict_dbufp); -#else /* __lint */ +/*ARGSUSED*/ inline void dmu_buf_init_user(dmu_buf_user_t *dbu, dmu_buf_evict_func_t *evict_func_sync, dmu_buf_evict_func_t *evict_func_async, dmu_buf_t **clear_on_evict_dbufp) @@ -586,7 +581,6 @@ dmu_buf_init_user(dmu_buf_user_t *dbu, d dbu->dbu_clear_on_evict_dbufp = clear_on_evict_dbufp; #endif } -#endif /* __lint */ /* * Attach user data to a dbuf and mark it for normal (when the dbuf's Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Fri Apr 14 18:09:32 2017 (r316896) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Fri Apr 14 18:10:23 2017 (r316897) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -595,8 +596,6 @@ _NOTE(CONSTCOND) } while (0) ASSERT(len < size); \ } -#include - #define BP_GET_BUFC_TYPE(bp) \ (((BP_GET_LEVEL(bp) > 0) || (DMU_OT_IS_METADATA(BP_GET_TYPE(bp)))) ? \ ARC_BUFC_METADATA : ARC_BUFC_DATA) From owner-svn-src-all@freebsd.org Fri Apr 14 18:11:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BE0ED3E90F; Fri, 14 Apr 2017 18:11:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 380CD1E9A; Fri, 14 Apr 2017 18:11:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIBGF5062245; Fri, 14 Apr 2017 18:11:16 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIBGJO062243; Fri, 14 Apr 2017 18:11:16 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141811.v3EIBGJO062243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316898 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:11:17 -0000 Author: avg Date: Fri Apr 14 18:11:16 2017 New Revision: 316898 URL: https://svnweb.freebsd.org/changeset/base/316898 Log: 7613 ms_freetree[4] is only used in syncing context illumos/illumos-gate@5f145778012b555e084eacc858ead9e1e42bd149 https://github.com/illumos/illumos-gate/commit/5f145778012b555e084eacc858ead9e1e42bd149 https://www.illumos.org/issues/7613 metaslab_t:ms_freetree[TXG_SIZE] is only used in syncing context. We should replace it with two trees: the freeing tree (ranges that we are freeing this syncing txg) and the freed tree (ranges which have been freed this txg). Reviewed by: George Wilson Reviewed by: Alex Reece Approved by: Dan McDonald Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Fri Apr 14 18:10:23 2017 (r316897) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Fri Apr 14 18:11:16 2017 (r316898) @@ -446,7 +446,6 @@ metaslab_verify_space(metaslab_t *msp, u { spa_t *spa = msp->ms_group->mg_vd->vdev_spa; uint64_t allocated = 0; - uint64_t freed = 0; uint64_t sm_free_space, msp_free_space; ASSERT(MUTEX_HELD(&msp->ms_lock)); @@ -476,10 +475,9 @@ metaslab_verify_space(metaslab_t *msp, u allocated += range_tree_space(msp->ms_alloctree[(txg + t) & TXG_MASK]); } - freed = range_tree_space(msp->ms_freetree[TXG_CLEAN(txg) & TXG_MASK]); msp_free_space = range_tree_space(msp->ms_tree) + allocated + - msp->ms_deferspace + freed; + msp->ms_deferspace + range_tree_space(msp->ms_freedtree); VERIFY3U(sm_free_space, ==, msp_free_space); } @@ -1410,7 +1408,7 @@ metaslab_init(metaslab_group_t *mg, uint /* * We create the main range tree here, but we don't create the - * alloctree and freetree until metaslab_sync_done(). This serves + * other range trees until metaslab_sync_done(). This serves * two purposes: it allows metaslab_sync_done() to detect the * addition of new space; and for debugging, it ensures that we'd * data fault on any attempt to use this metaslab before it's ready. @@ -1468,10 +1466,11 @@ metaslab_fini(metaslab_t *msp) metaslab_unload(msp); range_tree_destroy(msp->ms_tree); + range_tree_destroy(msp->ms_freeingtree); + range_tree_destroy(msp->ms_freedtree); for (int t = 0; t < TXG_SIZE; t++) { range_tree_destroy(msp->ms_alloctree[t]); - range_tree_destroy(msp->ms_freetree[t]); } for (int t = 0; t < TXG_DEFER_SIZE; t++) { @@ -2082,7 +2081,6 @@ static void metaslab_condense(metaslab_t *msp, uint64_t txg, dmu_tx_t *tx) { spa_t *spa = msp->ms_group->mg_vd->vdev_spa; - range_tree_t *freetree = msp->ms_freetree[txg & TXG_MASK]; range_tree_t *condense_tree; space_map_t *sm = msp->ms_sm; @@ -2113,9 +2111,9 @@ metaslab_condense(metaslab_t *msp, uint6 /* * Remove what's been freed in this txg from the condense_tree. * Since we're in sync_pass 1, we know that all the frees from - * this txg are in the freetree. + * this txg are in the freeingtree. */ - range_tree_walk(freetree, range_tree_remove, condense_tree); + range_tree_walk(msp->ms_freeingtree, range_tree_remove, condense_tree); for (int t = 0; t < TXG_DEFER_SIZE; t++) { range_tree_walk(msp->ms_defertree[t], @@ -2171,9 +2169,6 @@ metaslab_sync(metaslab_t *msp, uint64_t spa_t *spa = vd->vdev_spa; objset_t *mos = spa_meta_objset(spa); range_tree_t *alloctree = msp->ms_alloctree[txg & TXG_MASK]; - range_tree_t **freetree = &msp->ms_freetree[txg & TXG_MASK]; - range_tree_t **freed_tree = - &msp->ms_freetree[TXG_CLEAN(txg) & TXG_MASK]; dmu_tx_t *tx; uint64_t object = space_map_object(msp->ms_sm); @@ -2182,14 +2177,14 @@ metaslab_sync(metaslab_t *msp, uint64_t /* * This metaslab has just been added so there's no work to do now. */ - if (*freetree == NULL) { + if (msp->ms_freeingtree == NULL) { ASSERT3P(alloctree, ==, NULL); return; } ASSERT3P(alloctree, !=, NULL); - ASSERT3P(*freetree, !=, NULL); - ASSERT3P(*freed_tree, !=, NULL); + ASSERT3P(msp->ms_freeingtree, !=, NULL); + ASSERT3P(msp->ms_freedtree, !=, NULL); /* * Normally, we don't want to process a metaslab if there @@ -2197,14 +2192,14 @@ metaslab_sync(metaslab_t *msp, uint64_t * is being forced to condense we need to let it through. */ if (range_tree_space(alloctree) == 0 && - range_tree_space(*freetree) == 0 && + range_tree_space(msp->ms_freeingtree) == 0 && !msp->ms_condense_wanted) return; /* * The only state that can actually be changing concurrently with * metaslab_sync() is the metaslab's ms_tree. No other thread can - * be modifying this txg's alloctree, freetree, freed_tree, or + * be modifying this txg's alloctree, freeingtree, freedtree, or * space_map_phys_t. Therefore, we only hold ms_lock to satify * space map ASSERTs. We drop it whenever we call into the DMU, * because the DMU can call down to us (e.g. via zio_free()) at @@ -2241,7 +2236,7 @@ metaslab_sync(metaslab_t *msp, uint64_t metaslab_condense(msp, txg, tx); } else { space_map_write(msp->ms_sm, alloctree, SM_ALLOC, tx); - space_map_write(msp->ms_sm, *freetree, SM_FREE, tx); + space_map_write(msp->ms_sm, msp->ms_freeingtree, SM_FREE, tx); } if (msp->ms_loaded) { @@ -2261,7 +2256,7 @@ metaslab_sync(metaslab_t *msp, uint64_t * to accurately reflect all free space even if some space * is not yet available for allocation (i.e. deferred). */ - space_map_histogram_add(msp->ms_sm, *freed_tree, tx); + space_map_histogram_add(msp->ms_sm, msp->ms_freedtree, tx); /* * Add back any deferred free space that has not been @@ -2283,7 +2278,7 @@ metaslab_sync(metaslab_t *msp, uint64_t * then we will lose some accuracy but will correct it the next * time we load the space map. */ - space_map_histogram_add(msp->ms_sm, *freetree, tx); + space_map_histogram_add(msp->ms_sm, msp->ms_freeingtree, tx); metaslab_group_histogram_add(mg, msp); metaslab_group_histogram_verify(mg); @@ -2291,20 +2286,21 @@ metaslab_sync(metaslab_t *msp, uint64_t /* * For sync pass 1, we avoid traversing this txg's free range tree - * and instead will just swap the pointers for freetree and - * freed_tree. We can safely do this since the freed_tree is + * and instead will just swap the pointers for freeingtree and + * freedtree. We can safely do this since the freed_tree is * guaranteed to be empty on the initial pass. */ if (spa_sync_pass(spa) == 1) { - range_tree_swap(freetree, freed_tree); + range_tree_swap(&msp->ms_freeingtree, &msp->ms_freedtree); } else { - range_tree_vacate(*freetree, range_tree_add, *freed_tree); + range_tree_vacate(msp->ms_freeingtree, + range_tree_add, msp->ms_freedtree); } range_tree_vacate(alloctree, NULL, NULL); ASSERT0(range_tree_space(msp->ms_alloctree[txg & TXG_MASK])); ASSERT0(range_tree_space(msp->ms_alloctree[TXG_CLEAN(txg) & TXG_MASK])); - ASSERT0(range_tree_space(msp->ms_freetree[txg & TXG_MASK])); + ASSERT0(range_tree_space(msp->ms_freeingtree)); mutex_exit(&msp->ms_lock); @@ -2326,7 +2322,6 @@ metaslab_sync_done(metaslab_t *msp, uint metaslab_group_t *mg = msp->ms_group; vdev_t *vd = mg->mg_vd; spa_t *spa = vd->vdev_spa; - range_tree_t **freed_tree; range_tree_t **defer_tree; int64_t alloc_delta, defer_delta; boolean_t defer_allowed = B_TRUE; @@ -2337,20 +2332,24 @@ metaslab_sync_done(metaslab_t *msp, uint /* * If this metaslab is just becoming available, initialize its - * alloctrees, freetrees, and defertree and add its capacity to - * the vdev. + * range trees and add its capacity to the vdev. */ - if (msp->ms_freetree[TXG_CLEAN(txg) & TXG_MASK] == NULL) { + if (msp->ms_freedtree == NULL) { for (int t = 0; t < TXG_SIZE; t++) { ASSERT(msp->ms_alloctree[t] == NULL); - ASSERT(msp->ms_freetree[t] == NULL); msp->ms_alloctree[t] = range_tree_create(NULL, msp, &msp->ms_lock); - msp->ms_freetree[t] = range_tree_create(NULL, msp, - &msp->ms_lock); } + ASSERT3P(msp->ms_freeingtree, ==, NULL); + msp->ms_freeingtree = range_tree_create(NULL, msp, + &msp->ms_lock); + + ASSERT3P(msp->ms_freedtree, ==, NULL); + msp->ms_freedtree = range_tree_create(NULL, msp, + &msp->ms_lock); + for (int t = 0; t < TXG_DEFER_SIZE; t++) { ASSERT(msp->ms_defertree[t] == NULL); @@ -2361,7 +2360,6 @@ metaslab_sync_done(metaslab_t *msp, uint vdev_space_update(vd, 0, 0, msp->ms_size); } - freed_tree = &msp->ms_freetree[TXG_CLEAN(txg) & TXG_MASK]; defer_tree = &msp->ms_defertree[txg % TXG_DEFER_SIZE]; uint64_t free_space = metaslab_class_get_space(spa_normal_class(spa)) - @@ -2373,7 +2371,7 @@ metaslab_sync_done(metaslab_t *msp, uint defer_delta = 0; alloc_delta = space_map_alloc_delta(msp->ms_sm); if (defer_allowed) { - defer_delta = range_tree_space(*freed_tree) - + defer_delta = range_tree_space(msp->ms_freedtree) - range_tree_space(*defer_tree); } else { defer_delta -= range_tree_space(*defer_tree); @@ -2381,9 +2379,6 @@ metaslab_sync_done(metaslab_t *msp, uint vdev_space_update(vd, alloc_delta + defer_delta, defer_delta, 0); - ASSERT0(range_tree_space(msp->ms_alloctree[txg & TXG_MASK])); - ASSERT0(range_tree_space(msp->ms_freetree[txg & TXG_MASK])); - /* * If there's a metaslab_load() in progress, wait for it to complete * so that we have a consistent view of the in-core space map. @@ -2399,9 +2394,9 @@ metaslab_sync_done(metaslab_t *msp, uint range_tree_vacate(*defer_tree, msp->ms_loaded ? range_tree_add : NULL, msp->ms_tree); if (defer_allowed) { - range_tree_swap(freed_tree, defer_tree); + range_tree_swap(&msp->ms_freedtree, defer_tree); } else { - range_tree_vacate(*freed_tree, + range_tree_vacate(msp->ms_freedtree, msp->ms_loaded ? range_tree_add : NULL, msp->ms_tree); } @@ -3161,10 +3156,10 @@ metaslab_free_dva(spa_t *spa, const dva_ range_tree_add(msp->ms_tree, offset, size); msp->ms_max_size = metaslab_block_maxsize(msp); } else { - if (range_tree_space(msp->ms_freetree[txg & TXG_MASK]) == 0) + VERIFY3U(txg, ==, spa->spa_syncing_txg); + if (range_tree_space(msp->ms_freeingtree) == 0) vdev_dirty(vd, VDD_METASLAB, msp, txg); - range_tree_add(msp->ms_freetree[txg & TXG_MASK], - offset, size); + range_tree_add(msp->ms_freeingtree, offset, size); } mutex_exit(&msp->ms_lock); @@ -3396,8 +3391,8 @@ metaslab_check_free(spa_t *spa, const bl if (msp->ms_loaded) range_tree_verify(msp->ms_tree, offset, size); - for (int j = 0; j < TXG_SIZE; j++) - range_tree_verify(msp->ms_freetree[j], offset, size); + range_tree_verify(msp->ms_freeingtree, offset, size); + range_tree_verify(msp->ms_freedtree, offset, size); for (int j = 0; j < TXG_DEFER_SIZE; j++) range_tree_verify(msp->ms_defertree[j], offset, size); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h Fri Apr 14 18:10:23 2017 (r316897) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h Fri Apr 14 18:11:16 2017 (r316898) @@ -254,21 +254,24 @@ struct metaslab_group { #define MAX_LBAS 64 /* - * Each metaslab maintains a set of in-core trees to track metaslab operations. - * The in-core free tree (ms_tree) contains the current list of free segments. - * As blocks are allocated, the allocated segment are removed from the ms_tree - * and added to a per txg allocation tree (ms_alloctree). As blocks are freed, - * they are added to the per txg free tree (ms_freetree). These per txg - * trees allow us to process all allocations and frees in syncing context - * where it is safe to update the on-disk space maps. One additional in-core - * tree is maintained to track deferred frees (ms_defertree). Once a block - * is freed it will move from the ms_freetree to the ms_defertree. A deferred - * free means that a block has been freed but cannot be used by the pool - * until TXG_DEFER_SIZE transactions groups later. For example, a block - * that is freed in txg 50 will not be available for reallocation until - * txg 52 (50 + TXG_DEFER_SIZE). This provides a safety net for uberblock - * rollback. A pool could be safely rolled back TXG_DEFERS_SIZE - * transactions groups and ensure that no block has been reallocated. + * Each metaslab maintains a set of in-core trees to track metaslab + * operations. The in-core free tree (ms_tree) contains the list of + * free segments which are eligible for allocation. As blocks are + * allocated, the allocated segments are removed from the ms_tree and + * added to a per txg allocation tree (ms_alloctree). This allows us to + * process all allocations in syncing context where it is safe to update + * the on-disk space maps. Frees are also processed in syncing context. + * Most frees are generated from syncing context, and those that are not + * are held in the spa_free_bplist for processing in syncing context. + * An additional set of in-core trees is maintained to track deferred + * frees (ms_defertree). Once a block is freed it will move from the + * ms_freedtree to the ms_defertree. A deferred free means that a block + * has been freed but cannot be used by the pool until TXG_DEFER_SIZE + * transactions groups later. For example, a block that is freed in txg + * 50 will not be available for reallocation until txg 52 (50 + + * TXG_DEFER_SIZE). This provides a safety net for uberblock rollback. + * A pool could be safely rolled back TXG_DEFERS_SIZE transactions + * groups and ensure that no block has been reallocated. * * The simplified transition diagram looks like this: * @@ -276,33 +279,34 @@ struct metaslab_group { * ALLOCATE * | * V - * free segment (ms_tree) --------> ms_alloctree ----> (write to space map) + * free segment (ms_tree) -----> ms_alloctree[4] ----> (write to space map) * ^ - * | - * | ms_freetree <--- FREE - * | | + * | ms_freeingtree <--- FREE * | | + * | v + * | ms_freedtree * | | - * +----------- ms_defertree <-------+---------> (write to space map) + * +-------- ms_defertree[2] <-------+---------> (write to space map) * * * Each metaslab's space is tracked in a single space map in the MOS, - * which is only updated in syncing context. Each time we sync a txg, - * we append the allocs and frees from that txg to the space map. - * The pool space is only updated once all metaslabs have finished syncing. - * - * To load the in-core free tree we read the space map from disk. - * This object contains a series of alloc and free records that are - * combined to make up the list of all free segments in this metaslab. These + * which is only updated in syncing context. Each time we sync a txg, + * we append the allocs and frees from that txg to the space map. The + * pool space is only updated once all metaslabs have finished syncing. + * + * To load the in-core free tree we read the space map from disk. This + * object contains a series of alloc and free records that are combined + * to make up the list of all free segments in this metaslab. These * segments are represented in-core by the ms_tree and are stored in an * AVL tree. * * As the space map grows (as a result of the appends) it will - * eventually become space-inefficient. When the metaslab's in-core free tree - * is zfs_condense_pct/100 times the size of the minimal on-disk - * representation, we rewrite it in its minimized form. If a metaslab - * needs to condense then we must set the ms_condensing flag to ensure - * that allocations are not performed on the metaslab that is being written. + * eventually become space-inefficient. When the metaslab's in-core + * free tree is zfs_condense_pct/100 times the size of the minimal + * on-disk representation, we rewrite it in its minimized form. If a + * metaslab needs to condense then we must set the ms_condensing flag to + * ensure that allocations are not performed on the metaslab that is + * being written. */ struct metaslab { kmutex_t ms_lock; @@ -314,10 +318,17 @@ struct metaslab { uint64_t ms_fragmentation; range_tree_t *ms_alloctree[TXG_SIZE]; - range_tree_t *ms_freetree[TXG_SIZE]; - range_tree_t *ms_defertree[TXG_DEFER_SIZE]; range_tree_t *ms_tree; + /* + * The following range trees are accessed only from syncing context. + * ms_free*tree only have entries while syncing, and are empty + * between syncs. + */ + range_tree_t *ms_freeingtree; /* to free this syncing txg */ + range_tree_t *ms_freedtree; /* already freed this syncing txg */ + range_tree_t *ms_defertree[TXG_DEFER_SIZE]; + boolean_t ms_condensing; /* condensing? */ boolean_t ms_condense_wanted; From owner-svn-src-all@freebsd.org Fri Apr 14 18:11:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6EC5D3E967; Fri, 14 Apr 2017 18:11:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8B9EA4; Fri, 14 Apr 2017 18:11:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIBrFX064587; Fri, 14 Apr 2017 18:11:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIBrrx064586; Fri, 14 Apr 2017 18:11:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141811.v3EIBrrx064586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316899 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:11:55 -0000 Author: avg Date: Fri Apr 14 18:11:53 2017 New Revision: 316899 URL: https://svnweb.freebsd.org/changeset/base/316899 Log: 7659 Missing thread_exit() in dmu_send.c illumos/illumos-gate@f2c1e9bc48e4e20e8e9bd56203a75ff2e219b345 https://github.com/illumos/illumos-gate/commit/f2c1e9bc48e4e20e8e9bd56203a75ff2e219b345 https://www.illumos.org/issues/7659 Two threads send_traverse_thread() and receive_writer_thread() should end with thread_exit(); Mostly a cosmetic issue under IllumOS. https://github.com/openzfs/openzfs/pull/252 Reviewed by: Paul Dagnelie Reviewed by: Matt Ahrens Approved by: Richard Lowe Author: Jorgen Lundman Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Fri Apr 14 18:11:16 2017 (r316898) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Fri Apr 14 18:11:53 2017 (r316899) @@ -576,6 +576,7 @@ send_traverse_thread(void *arg) data = kmem_zalloc(sizeof (*data), KM_SLEEP); data->eos_marker = B_TRUE; bqueue_enqueue(&st_arg->q, data, 1); + thread_exit(); } /* @@ -2815,6 +2816,7 @@ receive_writer_thread(void *arg) rwa->done = B_TRUE; cv_signal(&rwa->cv); mutex_exit(&rwa->mutex); + thread_exit(); } static int From owner-svn-src-all@freebsd.org Fri Apr 14 18:13:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3967AD3EAD6; Fri, 14 Apr 2017 18:13:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 167A43C2; Fri, 14 Apr 2017 18:13:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EID7AA066066; Fri, 14 Apr 2017 18:13:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EID7Zi066064; Fri, 14 Apr 2017 18:13:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141813.v3EID7Zi066064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316900 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:13:08 -0000 Author: avg Date: Fri Apr 14 18:13:06 2017 New Revision: 316900 URL: https://svnweb.freebsd.org/changeset/base/316900 Log: 7743 per-vdev-zaps have no initialize path on upgrade illumos/illumos-gate@555da5111b0f2552c42d057b211aba89c9c79f6c https://github.com/illumos/illumos-gate/commit/555da5111b0f2552c42d057b211aba89c9c79f6c https://www.illumos.org/issues/7743 When loading a pool that had been created before the existance of per-vdev zaps, on a system that knows about per-vdev zaps, the per-vdev zaps will not be allocated and initialized. This appears to be because the logic that would have done so, in spa_sync_config_object(), is not reached under normal operation. It is only reached if spa_config_dirty_list is non-empty. The fix is to add another `AVZ_ACTION_` enum that will allow this code to be reached when we detect that we're loading an old pool, even when there are no dirty configs. Reviewed by: Matt Ahrens Reviewed by: Pavel Zakharov Reviewed by: George Wilson Reviewed by: Don Brady Approved by: Robert Mustacchi Author: Paul Dagnelie Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Fri Apr 14 18:11:53 2017 (r316899) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Fri Apr 14 18:13:06 2017 (r316900) @@ -2657,10 +2657,14 @@ spa_load_impl(spa_t *spa, uint64_t pool_ error = spa_dir_prop(spa, DMU_POOL_VDEV_ZAP_MAP, &spa->spa_all_vdev_zaps); - if (error != ENOENT && error != 0) { + if (error == ENOENT) { + VERIFY(!nvlist_exists(mos_config, + ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS)); + spa->spa_avz_action = AVZ_ACTION_INITIALIZE; + ASSERT0(vdev_count_verify_zaps(spa->spa_root_vdev)); + } else if (error != 0) { return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); - } else if (error == 0 && !nvlist_exists(mos_config, - ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS)) { + } else if (!nvlist_exists(mos_config, ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS)) { /* * An older version of ZFS overwrote the sentinel value, so * we have orphaned per-vdev ZAPs in the MOS. Defer their @@ -6156,6 +6160,7 @@ spa_sync_config_object(spa_t *spa, dmu_t spa_config_enter(spa, SCL_STATE, FTAG, RW_READER); ASSERT(spa->spa_avz_action == AVZ_ACTION_NONE || + spa->spa_avz_action == AVZ_ACTION_INITIALIZE || spa->spa_all_vdev_zaps != 0); if (spa->spa_avz_action == AVZ_ACTION_REBUILD) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Fri Apr 14 18:11:53 2017 (r316899) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Fri Apr 14 18:13:06 2017 (r316900) @@ -119,7 +119,8 @@ typedef struct spa_taskqs { typedef enum spa_all_vdev_zap_action { AVZ_ACTION_NONE = 0, AVZ_ACTION_DESTROY, /* Destroy all per-vdev ZAPs and the AVZ. */ - AVZ_ACTION_REBUILD /* Populate the new AVZ, see spa_avz_rebuild */ + AVZ_ACTION_REBUILD, /* Populate the new AVZ, see spa_avz_rebuild */ + AVZ_ACTION_INITIALIZE } spa_avz_action_t; struct spa { From owner-svn-src-all@freebsd.org Fri Apr 14 18:13:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CED27D3EB24; Fri, 14 Apr 2017 18:13:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84692759; Fri, 14 Apr 2017 18:13:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIDXBZ066125; Fri, 14 Apr 2017 18:13:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIDXiI066124; Fri, 14 Apr 2017 18:13:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141813.v3EIDXiI066124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316901 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:13:34 -0000 Author: avg Date: Fri Apr 14 18:13:33 2017 New Revision: 316901 URL: https://svnweb.freebsd.org/changeset/base/316901 Log: 7730 libzfs`add_config() leaks config nvl when reading spare/l2cache devices illumos/illumos-gate@105686550ee9cbf5d033166a8a2a5a763667d436 https://github.com/illumos/illumos-gate/commit/105686550ee9cbf5d033166a8a2a5a763667d436 https://www.illumos.org/issues/7730 antares:root:~# mdb /usr/sbin/zpool > ::sysbp _exit > ::run import pool: data id: 2093977168778024605 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: data ONLINE c6t0d0 ONLINE c6t1d0 ONLINE cache c6t2d0 mdb: stop on entry to _exit mdb: target stopped at: 0xfee556ba: nop mdb: You've got symbols! Loading modules: [ ld.so.1 libumem.so.1 libc.so.1 libtopo.so.1 libavl.so.1 libnvpair.so.1 ] > ::findleaks -d BYTES LEAKED VMEM_SEG CALLER 4096 10 fda7b000 MMAP 8192 1 fea8d000 MMAP 8192 1 fe76d000 MMAP 8192 1 fe66e000 MMAP 4096 1 fe570000 MMAP 8192 1 fe470000 MMAP 4096 1 fe372000 MMAP 4096 1 fe273000 MMAP Reviewed by: Matthew Ahrens Reviewed by: Serapheim Dimitropoulos Approved by: Robert Mustacchi Author: Yuri Pankov Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Fri Apr 14 18:13:06 2017 (r316900) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Fri Apr 14 18:13:33 2017 (r316901) @@ -237,9 +237,12 @@ add_config(libzfs_handle_t *hdl, pool_li free(ne); return (-1); } + ne->ne_guid = vdev_guid; ne->ne_next = pl->names; pl->names = ne; + + nvlist_free(config); return (0); } From owner-svn-src-all@freebsd.org Fri Apr 14 18:14:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B12ED3EB91; Fri, 14 Apr 2017 18:14:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC8C897; Fri, 14 Apr 2017 18:14:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIE3Fo066193; Fri, 14 Apr 2017 18:14:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIE3ea066190; Fri, 14 Apr 2017 18:14:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141814.v3EIE3ea066190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316902 - in vendor/illumos/dist/lib: libzfs/common libzfs_core/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:14:04 -0000 Author: avg Date: Fri Apr 14 18:14:02 2017 New Revision: 316902 URL: https://svnweb.freebsd.org/changeset/base/316902 Log: 7745 print error if lzc_* is called before libzfs_core_init illumos/illumos-gate@7c13517fff71be473e47531ef4330160c042bedc https://github.com/illumos/illumos-gate/commit/7c13517fff71be473e47531ef4330160c042bedc https://www.illumos.org/issues/7745 The problem is that consumers of `libZFS_Core` that forget to call `libzfs_core_init()` before calling any other function of the library are having a hard time realizing their mistake. The library's internal file descriptor is declared as global static, which is ok, but it is not initialized explicitly; therefore, it defaults to 0, which is a valid file descriptor. If `libzfs_core_init()`, which explicitly initializes the correct fd, is skipped, the ioctl functions return errors that do not have anything to do with `libZFS_Core`, where the problem is actually located. Even though assertions for that existed within `libZFS_Core` for debug builds, they were never enabled because the `-DDEBUG` flag was missing from the compiler flags. This patch applies the following changes: 1. It adds `-DDEBUG` for debug builds of `libZFS_Core` and `libzfs`, to enable their assertions on debug builds. 2. It corrects an assertion within `libzfs`, where a function had been spelled incorrectly (`zpool_prop_unsupported()`) and nobody knew because the `-DDEBUG` flag was missing, and the preprocessor was taking that part of the code away. 3. The library's internal fd is initialized to `-1` and `VERIFY` assertions have been placed to check that the fd is not equal to `-1` before issuing any ioctl. It is important here to note, that the `VERIFY` assertions exist in both debug and non-debug builds. 4. In `libzfs_core_fini` we make sure to never increment the refcount of our fd below 0, and also reset the fd to `-1` when no one refers to it. The reason for this, is for the rare case that the consumer closes all references but then calls one of the library's functions without using `libzfs_core_init()` first, and in the mean time, a previous call to `open()` decided to reuse our previous fd. This scenario would have passed our assertion in Reviewed by: Pavel Zakharov Reviewed by: Matthew Ahrens Approved by: Dan McDonald Author: Serapheim Dimitropoulos Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Fri Apr 14 18:13:33 2017 (r316901) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Fri Apr 14 18:14:02 2017 (r316902) @@ -818,7 +818,7 @@ zpool_prop_get_feature(zpool_handle_t *z const char *feature = strchr(propname, '@') + 1; supported = zpool_prop_feature(propname); - ASSERT(supported || zfs_prop_unsupported(propname)); + ASSERT(supported || zpool_prop_unsupported(propname)); /* * Convert from feature name to feature guid. This conversion is Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Fri Apr 14 18:13:33 2017 (r316901) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Fri Apr 14 18:14:02 2017 (r316902) @@ -266,6 +266,15 @@ cksummer(void *arg) ofp = fdopen(dda->inputfd, "r"); while (ssread(drr, sizeof (*drr), ofp) != 0) { + /* + * kernel filled in checksum, we are going to write same + * record, but need to regenerate checksum. + */ + if (drr->drr_type != DRR_BEGIN) { + bzero(&drr->drr_u.drr_checksum.drr_checksum, + sizeof (drr->drr_u.drr_checksum.drr_checksum)); + } + switch (drr->drr_type) { case DRR_BEGIN: { Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Fri Apr 14 18:13:33 2017 (r316901) +++ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Fri Apr 14 18:14:02 2017 (r316902) @@ -85,7 +85,7 @@ #include #include -static int g_fd; +static int g_fd = -1; static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER; static int g_refcount; @@ -110,9 +110,14 @@ libzfs_core_fini(void) { (void) pthread_mutex_lock(&g_lock); ASSERT3S(g_refcount, >, 0); - g_refcount--; - if (g_refcount == 0) + + if (g_refcount > 0) + g_refcount--; + + if (g_refcount == 0 && g_fd != -1) { (void) close(g_fd); + g_fd = -1; + } (void) pthread_mutex_unlock(&g_lock); } @@ -126,6 +131,7 @@ lzc_ioctl(zfs_ioc_t ioc, const char *nam size_t size; ASSERT3S(g_refcount, >, 0); + VERIFY3S(g_fd, !=, -1); (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name)); @@ -328,6 +334,9 @@ lzc_exists(const char *dataset) */ zfs_cmd_t zc = { 0 }; + ASSERT3S(g_refcount, >, 0); + VERIFY3S(g_fd, !=, -1); + (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name)); return (ioctl(g_fd, ZFS_IOC_OBJSET_STATS, &zc) == 0); } @@ -573,6 +582,7 @@ recv_impl(const char *snapname, nvlist_t int error; ASSERT3S(g_refcount, >, 0); + VERIFY3S(g_fd, !=, -1); /* zc_name is name of containing filesystem */ (void) strlcpy(zc.zc_name, snapname, sizeof (zc.zc_name)); From owner-svn-src-all@freebsd.org Fri Apr 14 18:14:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB3DDD3EBEB; Fri, 14 Apr 2017 18:14:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6B079C4; Fri, 14 Apr 2017 18:14:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIEfCX066258; Fri, 14 Apr 2017 18:14:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIEfkS066256; Fri, 14 Apr 2017 18:14:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141814.v3EIEfkS066256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316903 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:14:43 -0000 Author: avg Date: Fri Apr 14 18:14:41 2017 New Revision: 316903 URL: https://svnweb.freebsd.org/changeset/base/316903 Log: 7779 clean up unused definitions in zfs ctldir code illumos/illumos-gate@b7f9f60c8eb061c94244a6181a00288684164e1b https://github.com/illumos/illumos-gate/commit/b7f9f60c8eb061c94244a6181a00288684164e1b https://www.illumos.org/issues/7779 zfsctl_ops_shares_dir and ZFSCTL_INO_SHARES are essentially dead code. While there, fix the index range check in zfsctl_root_inode_cb. Reviewed by: Matt Ahrens Reviewed by: Serapheim Dimitropoulos Approved by: Dan McDonald Author: Andriy Gapon Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ctldir.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ctldir.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ctldir.h Fri Apr 14 18:14:02 2017 (r316902) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ctldir.h Fri Apr 14 18:14:41 2017 (r316903) @@ -64,7 +64,6 @@ int zfsctl_lookup_objset(vfs_t *vfsp, ui #define ZFSCTL_INO_ROOT 0x1 #define ZFSCTL_INO_SNAPDIR 0x2 -#define ZFSCTL_INO_SHARES 0x3 #ifdef __cplusplus } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c Fri Apr 14 18:14:02 2017 (r316902) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c Fri Apr 14 18:14:41 2017 (r316903) @@ -117,7 +117,6 @@ vnodeops_t *zfsctl_ops_root; vnodeops_t *zfsctl_ops_snapdir; vnodeops_t *zfsctl_ops_snapshot; vnodeops_t *zfsctl_ops_shares; -vnodeops_t *zfsctl_ops_shares_dir; static const fs_operation_def_t zfsctl_tops_root[]; static const fs_operation_def_t zfsctl_tops_snapdir[]; @@ -133,8 +132,7 @@ static gfs_opsvec_t zfsctl_opsvec[] = { { ".zfs", zfsctl_tops_root, &zfsctl_ops_root }, { ".zfs/snapshot", zfsctl_tops_snapdir, &zfsctl_ops_snapdir }, { ".zfs/snapshot/vnode", zfsctl_tops_snapshot, &zfsctl_ops_snapshot }, - { ".zfs/shares", zfsctl_tops_shares, &zfsctl_ops_shares_dir }, - { ".zfs/shares/vnode", zfsctl_tops_shares, &zfsctl_ops_shares }, + { ".zfs/shares", zfsctl_tops_shares, &zfsctl_ops_shares }, { NULL } }; @@ -178,14 +176,11 @@ zfsctl_fini(void) vn_freevnodeops(zfsctl_ops_snapshot); if (zfsctl_ops_shares) vn_freevnodeops(zfsctl_ops_shares); - if (zfsctl_ops_shares_dir) - vn_freevnodeops(zfsctl_ops_shares_dir); zfsctl_ops_root = NULL; zfsctl_ops_snapdir = NULL; zfsctl_ops_snapshot = NULL; zfsctl_ops_shares = NULL; - zfsctl_ops_shares_dir = NULL; } boolean_t @@ -194,8 +189,7 @@ zfsctl_is_node(vnode_t *vp) return (vn_matchops(vp, zfsctl_ops_root) || vn_matchops(vp, zfsctl_ops_snapdir) || vn_matchops(vp, zfsctl_ops_snapshot) || - vn_matchops(vp, zfsctl_ops_shares) || - vn_matchops(vp, zfsctl_ops_shares_dir)); + vn_matchops(vp, zfsctl_ops_shares)); } @@ -209,7 +203,7 @@ zfsctl_root_inode_cb(vnode_t *vp, int in { zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data; - ASSERT(index <= 2); + ASSERT(index < 2); if (index == 0) return (ZFSCTL_INO_SNAPDIR); From owner-svn-src-all@freebsd.org Fri Apr 14 18:15:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F142D3EC3E; Fri, 14 Apr 2017 18:15:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70F9DAF0; Fri, 14 Apr 2017 18:15:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIFDF0066332; Fri, 14 Apr 2017 18:15:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIFD5J066331; Fri, 14 Apr 2017 18:15:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141815.v3EIFD5J066331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316904 - vendor/illumos/dist/lib/libzfs_core/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:15:14 -0000 Author: avg Date: Fri Apr 14 18:15:13 2017 New Revision: 316904 URL: https://svnweb.freebsd.org/changeset/base/316904 Log: 7729 libzfs_core`lzc_rollback() leaks result nvl illumos/illumos-gate@ac428481f96be89add7a1edf43ae47dd71038553 https://github.com/illumos/illumos-gate/commit/ac428481f96be89add7a1edf43ae47dd71038553 https://www.illumos.org/issues/7729 libzfs_core`lzc_rollback() doesn't free the result nvl after lzc_ioctl() call. Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Approved by: Dan McDonald Author: Yuri Pankov Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Fri Apr 14 18:14:41 2017 (r316903) +++ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Fri Apr 14 18:15:13 2017 (r316904) @@ -722,6 +722,8 @@ lzc_rollback(const char *fsname, char *s const char *snapname = fnvlist_lookup_string(result, "target"); (void) strlcpy(snapnamebuf, snapname, snapnamelen); } + nvlist_free(result); + return (err); } From owner-svn-src-all@freebsd.org Fri Apr 14 18:15:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E93B3D3EC96; Fri, 14 Apr 2017 18:15:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAB33C34; Fri, 14 Apr 2017 18:15:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIFlKH066396; Fri, 14 Apr 2017 18:15:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIFlA4066394; Fri, 14 Apr 2017 18:15:47 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141815.v3EIFlA4066394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316905 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:15:49 -0000 Author: avg Date: Fri Apr 14 18:15:47 2017 New Revision: 316905 URL: https://svnweb.freebsd.org/changeset/base/316905 Log: 7740 fix for 6513 only works in hole punching case, not truncation illumos/illumos-gate@7de35a3ed0c2e6d4256bd2fb05b48b3798aaf553 https://github.com/illumos/illumos-gate/commit/7de35a3ed0c2e6d4256bd2fb05b48b3798aaf553 https://www.illumos.org/issues/7740 The problem is that dbuf_findbp will return ENOENT if the block it's trying to find is beyond the end of the file. If that happens, we assume there is no birth time, and so we lose that information when we write out new blkptrs. We should teach dbuf_findbp to look for things that are beyond the current end, but not beyond the absolute end of the file. To verify, create a large file, truncate it to a short length, and then write beyond the end. Check with zdb to make sure that there are no holes with birth time zero (will appear as gaps). Reviewed by: Steve Gonczi Reviewed by: Matthew Ahrens Approved by: Dan McDonald Author: Paul Dagnelie Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:15:13 2017 (r316904) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:15:47 2017 (r316905) @@ -2161,8 +2161,6 @@ static int dbuf_findbp(dnode_t *dn, int level, uint64_t blkid, int fail_sparse, dmu_buf_impl_t **parentp, blkptr_t **bpp) { - int nlevels, epbs; - *parentp = NULL; *bpp = NULL; @@ -2181,17 +2179,35 @@ dbuf_findbp(dnode_t *dn, int level, uint return (0); } - if (dn->dn_phys->dn_nlevels == 0) - nlevels = 1; - else - nlevels = dn->dn_phys->dn_nlevels; - - epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; + int nlevels = + (dn->dn_phys->dn_nlevels == 0) ? 1 : dn->dn_phys->dn_nlevels; + int epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; ASSERT3U(level * epbs, <, 64); ASSERT(RW_LOCK_HELD(&dn->dn_struct_rwlock)); + /* + * This assertion shouldn't trip as long as the max indirect block size + * is less than 1M. The reason for this is that up to that point, + * the number of levels required to address an entire object with blocks + * of size SPA_MINBLOCKSIZE satisfies nlevels * epbs + 1 <= 64. In + * other words, if N * epbs + 1 > 64, then if (N-1) * epbs + 1 > 55 + * (i.e. we can address the entire object), objects will all use at most + * N-1 levels and the assertion won't overflow. However, once epbs is + * 13, 4 * 13 + 1 = 53, but 5 * 13 + 1 = 66. Then, 4 levels will not be + * enough to address an entire object, so objects will have 5 levels, + * but then this assertion will overflow. + * + * All this is to say that if we ever increase DN_MAX_INDBLKSHIFT, we + * need to redo this logic to handle overflows. + */ + ASSERT(level >= nlevels || + ((nlevels - level - 1) * epbs) + + highbit64(dn->dn_phys->dn_nblkptr) <= 64); if (level >= nlevels || - (blkid > (dn->dn_phys->dn_maxblkid >> (level * epbs)))) { + blkid >= ((uint64_t)dn->dn_phys->dn_nblkptr << + ((nlevels - level - 1) * epbs)) || + (fail_sparse && + blkid > (dn->dn_phys->dn_maxblkid >> (level * epbs)))) { /* the buffer has no parent yet */ return (SET_ERROR(ENOENT)); } else if (level < nlevels-1) { @@ -2209,6 +2225,8 @@ dbuf_findbp(dnode_t *dn, int level, uint } *bpp = ((blkptr_t *)(*parentp)->db.db_data) + (blkid & ((1ULL << epbs) - 1)); + if (blkid > (dn->dn_phys->dn_maxblkid >> (level * epbs))) + ASSERT(BP_IS_HOLE(*bpp)); return (0); } else { /* the block is referenced from the dnode */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Fri Apr 14 18:15:13 2017 (r316904) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Fri Apr 14 18:15:47 2017 (r316905) @@ -58,6 +58,12 @@ extern "C" { */ #define DNODE_SHIFT 9 /* 512 bytes */ #define DN_MIN_INDBLKSHIFT 12 /* 4k */ +/* + * If we ever increase this value beyond 20, we need to revisit all logic that + * does x << level * ebps to handle overflow. With a 1M indirect block size, + * 4 levels of indirect blocks would not be able to guarantee addressing an + * entire object, so 5 levels will be used, but 5 * (20 - 7) = 65. + */ #define DN_MAX_INDBLKSHIFT 17 /* 128k */ #define DNODE_BLOCK_SHIFT 14 /* 16k */ #define DNODE_CORE_SIZE 64 /* 64 bytes for dnode sans blkptrs */ From owner-svn-src-all@freebsd.org Fri Apr 14 18:19:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EFF6D3ECF1; Fri, 14 Apr 2017 18:19:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E38FD88; Fri, 14 Apr 2017 18:19:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIJnOw066590; Fri, 14 Apr 2017 18:19:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIJnoY066587; Fri, 14 Apr 2017 18:19:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141819.v3EIJnoY066587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316906 - in vendor-sys/illumos/dist/uts/common: fs fs/zfs sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:19:50 -0000 Author: avg Date: Fri Apr 14 18:19:48 2017 New Revision: 316906 URL: https://svnweb.freebsd.org/changeset/base/316906 Log: 4242 file rename event fires before the rename happens illumos/illumos-gate@54207fd2e1e7ed01d0416da8cf296dbef920fbfc https://github.com/illumos/illumos-gate/commit/54207fd2e1e7ed01d0416da8cf296dbef920fbfc https://www.illumos.org/issues/4242 From Joyent's OS-2557: So we're basically just doing a check here that after we got a 'rename' event for our file, the file has actually been moved out of the way. What I've seen in bh1-stage2 is that this happens as you'd expect for all zones but many times over the last week it's failed because when we do the fs.exists () check here, the file that we got the rename event for, still exists. I've confirmed what's happening using the following dtrace script: #!/usr/sbin/dtrace -s #pragma D option quiet #pragma D option bufsize=256k syscall::open:entry, syscall::open64:entry /copyinstr(arg0) == "/var/svc/provisioning" || (strlen(copyinstr(arg0)) == 69 && substr(copyinstr(arg0), 48) == "/var/svc/provisioning")/ { this->watching_open = 1; printf("%d zone %s process %s(%d) [%s] open(%s)\\n", timestamp, zonename, execname, pid, curpsinfo->pr_psargs, copyinstr(arg0)); } syscall::open:return, syscall::open64:return /this->watching_open == 1/ Reviewed by: Robert Mustacchi Reviewed by: Marcel Telka Approved by: Dan McDonald Author: Jerry Jelinek Modified: vendor-sys/illumos/dist/uts/common/fs/vnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/sys/vnode.h Modified: vendor-sys/illumos/dist/uts/common/fs/vnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/vnode.c Fri Apr 14 18:15:47 2017 (r316905) +++ vendor-sys/illumos/dist/uts/common/fs/vnode.c Fri Apr 14 18:19:48 2017 (r316906) @@ -2557,6 +2557,36 @@ vnevent_rmdir(vnode_t *vp, vnode_t *dvp, } void +vnevent_pre_rename_src(vnode_t *vp, vnode_t *dvp, char *name, + caller_context_t *ct) +{ + if (vp == NULL || vp->v_femhead == NULL) { + return; + } + (void) VOP_VNEVENT(vp, VE_PRE_RENAME_SRC, dvp, name, ct); +} + +void +vnevent_pre_rename_dest(vnode_t *vp, vnode_t *dvp, char *name, + caller_context_t *ct) +{ + if (vp == NULL || vp->v_femhead == NULL) { + return; + } + (void) VOP_VNEVENT(vp, VE_PRE_RENAME_DEST, dvp, name, ct); +} + +void +vnevent_pre_rename_dest_dir(vnode_t *vp, vnode_t *nvp, char *name, + caller_context_t *ct) +{ + if (vp == NULL || vp->v_femhead == NULL) { + return; + } + (void) VOP_VNEVENT(vp, VE_PRE_RENAME_DEST_DIR, nvp, name, ct); +} + +void vnevent_create(vnode_t *vp, caller_context_t *ct) { if (vp == NULL || vp->v_femhead == NULL) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 18:15:47 2017 (r316905) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 18:19:48 2017 (r316906) @@ -23,6 +23,7 @@ * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2015 Joyent, Inc. */ /* Portions Copyright 2007 Jeremy Teo */ @@ -3447,7 +3448,7 @@ zfs_rename(vnode_t *sdvp, char *snm, vno dmu_tx_t *tx; zfs_zlock_t *zl; int cmp, serr, terr; - int error = 0; + int error = 0, rm_err = 0; int zflg = 0; boolean_t waited = B_FALSE; @@ -3659,16 +3660,16 @@ top: } } - vnevent_rename_src(ZTOV(szp), sdvp, snm, ct); + vnevent_pre_rename_src(ZTOV(szp), sdvp, snm, ct); if (tzp) - vnevent_rename_dest(ZTOV(tzp), tdvp, tnm, ct); + vnevent_pre_rename_dest(ZTOV(tzp), tdvp, tnm, ct); /* * notify the target directory if it is not the same * as source directory. */ if (tdvp != sdvp) { - vnevent_rename_dest_dir(tdvp, ct); + vnevent_pre_rename_dest_dir(tdvp, ZTOV(szp), tnm, ct); } tx = dmu_tx_create(zfsvfs->z_os); @@ -3712,7 +3713,7 @@ top: } if (tzp) /* Attempt to remove the existing target */ - error = zfs_link_destroy(tdl, tzp, tx, zflg, NULL); + error = rm_err = zfs_link_destroy(tdl, tzp, tx, zflg, NULL); if (error == 0) { error = zfs_link_create(tdl, szp, tx, ZRENAMING); @@ -3754,6 +3755,16 @@ top: } dmu_tx_commit(tx); + + if (tzp && rm_err == 0) + vnevent_rename_dest(ZTOV(tzp), tdvp, tnm, ct); + + if (error == 0) { + vnevent_rename_src(ZTOV(szp), sdvp, snm, ct); + /* notify the target dir if it is not the same as source dir */ + if (tdvp != sdvp) + vnevent_rename_dest_dir(tdvp, ct); + } out: if (zl != NULL) zfs_rename_unlock(&zl); Modified: vendor-sys/illumos/dist/uts/common/sys/vnode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/vnode.h Fri Apr 14 18:15:47 2017 (r316905) +++ vendor-sys/illumos/dist/uts/common/sys/vnode.h Fri Apr 14 18:19:48 2017 (r316906) @@ -724,7 +724,12 @@ typedef enum symfollow symfollow_t; typedef enum vcexcl vcexcl_t; typedef enum create create_t; -/* Vnode Events - Used by VOP_VNEVENT */ +/* + * Vnode Events - Used by VOP_VNEVENT + * The VE_PRE_RENAME_* events fire before the rename operation and are + * primarily used for specialized applications, such as NFSv4 delegation, which + * need to know about rename before it occurs. + */ typedef enum vnevent { VE_SUPPORT = 0, /* Query */ VE_RENAME_SRC = 1, /* Rename, with vnode as source */ @@ -735,7 +740,10 @@ typedef enum vnevent { VE_LINK = 6, /* Link with vnode's name as source */ VE_RENAME_DEST_DIR = 7, /* Rename with vnode as target dir */ VE_MOUNTEDOVER = 8, /* File or Filesystem got mounted over vnode */ - VE_TRUNCATE = 9 /* Truncate */ + VE_TRUNCATE = 9, /* Truncate */ + VE_PRE_RENAME_SRC = 10, /* Pre-rename, with vnode as source */ + VE_PRE_RENAME_DEST = 11, /* Pre-rename, with vnode as target/dest. */ + VE_PRE_RENAME_DEST_DIR = 12 /* Pre-rename with vnode as target dir */ } vnevent_t; /* @@ -1294,6 +1302,12 @@ void vnevent_rename_dest_dir(vnode_t *, void vnevent_mountedover(vnode_t *, caller_context_t *); void vnevent_truncate(vnode_t *, caller_context_t *); int vnevent_support(vnode_t *, caller_context_t *); +void vnevent_pre_rename_src(vnode_t *, vnode_t *, char *, + caller_context_t *); +void vnevent_pre_rename_dest(vnode_t *, vnode_t *, char *, + caller_context_t *); +void vnevent_pre_rename_dest_dir(vnode_t *, vnode_t *, char *, + caller_context_t *); /* Vnode specific data */ void vsd_create(uint_t *, void (*)(void *)); From owner-svn-src-all@freebsd.org Fri Apr 14 18:20:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01EDBD3ED5F; Fri, 14 Apr 2017 18:20:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C495CEC2; Fri, 14 Apr 2017 18:20:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIKM7R066686; Fri, 14 Apr 2017 18:20:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIKL4E066677; Fri, 14 Apr 2017 18:20:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141820.v3EIKL4E066677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316907 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:20:23 -0000 Author: avg Date: Fri Apr 14 18:20:20 2017 New Revision: 316907 URL: https://svnweb.freebsd.org/changeset/base/316907 Log: 1300 filename normalization doesn't work for removes illumos/illumos-gate@1c17160ac558f98048951327f4e9248d8f46acc0 https://github.com/illumos/illumos-gate/commit/1c17160ac558f98048951327f4e9248d8f46acc0 https://www.illumos.org/issues/1300 Problem: We can create invisible file in ZFS. How to reproduce: 0. Prepare normalization formD ZFS. # cat cat /etc/release cat: cat: No such file or directory OpenIndiana Development oi_151 X86 (powered by illumos) Copyright 2011 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Assembled 28 April 2011 # mkfile 100M 100M # zpool create -O utf8only=on -O normalization=formD test_pool $( pwd )/ 100M # zpool upgrade This system is currently running ZFS pool version 28. All pools are formatted using this version. # zfs get normalization test_pool NAME PROPERTY VALUE SOURCE test_pool normalization formD - # chmod 777 /test_pool 1. Create a NFD file. $ cd /test_pool/ $ cp /etc/release $( echo "\x75\xcc\x88" ) $ ls -la total 4 drwxrwxrwx 2 root root 3 2011-07-29 08:53 . drwxr-xr-x 25 root root 26 2011-07-29 08:53 .. -r--r--r-- 1 test1 staff 251 2011-07-29 08:53 u? Reviewed by: Yuri Pankov Reviewed by: Pavel Zakharov Reviewed by: Matt Ahrens Approved by: Dan McDonald Author: Kevin Crowe Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap_leaf.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Fri Apr 14 18:19:48 2017 (r316906) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Fri Apr 14 18:20:20 2017 (r316907) @@ -18,15 +18,16 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. - * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2015, STRATO AG, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2017 Nexenta Systems, Inc. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -1622,7 +1623,7 @@ dmu_snapshot_realname(objset_t *os, char return (zap_lookup_norm(ds->ds_dir->dd_pool->dp_meta_objset, dsl_dataset_phys(ds)->ds_snapnames_zapobj, name, 8, 1, &ignored, - MT_FIRST, real, maxlen, conflict)); + MT_NORMALIZE, real, maxlen, conflict)); } int Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c Fri Apr 14 18:19:48 2017 (r316906) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c Fri Apr 14 18:20:20 2017 (r316907) @@ -12,8 +12,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. */ #include @@ -59,16 +61,14 @@ dsl_dataset_bmark_lookup(dsl_dataset_t * { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; uint64_t bmark_zapobj = ds->ds_bookmarks; - matchtype_t mt; + matchtype_t mt = 0; int err; if (bmark_zapobj == 0) return (SET_ERROR(ESRCH)); if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) - mt = MT_FIRST; - else - mt = MT_EXACT; + mt = MT_NORMALIZE; err = zap_lookup_norm(mos, bmark_zapobj, shortname, sizeof (uint64_t), sizeof (*bmark_phys) / sizeof (uint64_t), bmark_phys, mt, @@ -339,12 +339,10 @@ dsl_dataset_bookmark_remove(dsl_dataset_ { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; uint64_t bmark_zapobj = ds->ds_bookmarks; - matchtype_t mt; + matchtype_t mt = 0; if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) - mt = MT_FIRST; - else - mt = MT_EXACT; + mt = MT_NORMALIZE; return (zap_remove_norm(mos, bmark_zapobj, name, mt, tx)); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Fri Apr 14 18:19:48 2017 (r316906) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Fri Apr 14 18:20:20 2017 (r316907) @@ -18,6 +18,7 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2016 by Delphix. All rights reserved. @@ -26,6 +27,7 @@ * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2016, OmniTI Computer Consulting, Inc. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. */ #include @@ -353,17 +355,15 @@ dsl_dataset_snap_lookup(dsl_dataset_t *d { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; uint64_t snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj; - matchtype_t mt; + matchtype_t mt = 0; int err; if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) - mt = MT_FIRST; - else - mt = MT_EXACT; + mt = MT_NORMALIZE; err = zap_lookup_norm(mos, snapobj, name, 8, 1, value, mt, NULL, 0, NULL); - if (err == ENOTSUP && mt == MT_FIRST) + if (err == ENOTSUP && (mt & MT_NORMALIZE)) err = zap_lookup(mos, snapobj, name, 8, 1, value); return (err); } @@ -374,18 +374,16 @@ dsl_dataset_snap_remove(dsl_dataset_t *d { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; uint64_t snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj; - matchtype_t mt; + matchtype_t mt = 0; int err; dsl_dir_snap_cmtime_update(ds->ds_dir); if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) - mt = MT_FIRST; - else - mt = MT_EXACT; + mt = MT_NORMALIZE; err = zap_remove_norm(mos, snapobj, name, mt, tx); - if (err == ENOTSUP && mt == MT_FIRST) + if (err == ENOTSUP && (mt & MT_NORMALIZE)) err = zap_remove(mos, snapobj, name, tx); if (err == 0 && adj_cnt) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h Fri Apr 14 18:19:48 2017 (r316906) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h Fri Apr 14 18:20:20 2017 (r316907) @@ -18,9 +18,11 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. */ #ifndef _SYS_ZAP_H @@ -88,22 +90,15 @@ extern "C" { /* * Specifies matching criteria for ZAP lookups. - */ -typedef enum matchtype -{ - /* Only find an exact match (non-normalized) */ - MT_EXACT, - /* - * If there is an exact match, find that, otherwise find the - * first normalized match. - */ - MT_BEST, - /* - * Find the "first" normalized (case and Unicode form) match; - * the designated "first" match will not change as long as the - * set of entries with this normalization doesn't change. - */ - MT_FIRST + * MT_NORMALIZE Use ZAP normalization flags, which can include both + * unicode normalization and case-insensitivity. + * MT_MATCH_CASE Do case-sensitive lookups even if MT_NORMALIZE is + * specified and ZAP normalization flags include + * U8_TEXTPREP_TOUPPER. + */ +typedef enum matchtype { + MT_NORMALIZE = 1 << 0, + MT_MATCH_CASE = 1 << 1, } matchtype_t; typedef enum zap_flags { @@ -120,16 +115,6 @@ typedef enum zap_flags { /* * Create a new zapobj with no attributes and return its object number. - * MT_EXACT will cause the zap object to only support MT_EXACT lookups, - * otherwise any matchtype can be used for lookups. - * - * normflags specifies what normalization will be done. values are: - * 0: no normalization (legacy on-disk format, supports MT_EXACT matching - * only) - * U8_TEXTPREP_TOLOWER: case normalization will be performed. - * MT_FIRST/MT_BEST matching will find entries that match without - * regard to case (eg. looking for "foo" can find an entry "Foo"). - * Eventually, other flags will permit unicode normalization as well. */ uint64_t zap_create(objset_t *ds, dmu_object_type_t ot, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h Fri Apr 14 18:19:48 2017 (r316906) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h Fri Apr 14 18:20:20 2017 (r316907) @@ -18,11 +18,13 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2017 Nexenta Systems, Inc. */ #ifndef _SYS_ZAP_IMPL_H @@ -189,6 +191,7 @@ typedef struct zap_name { int zn_key_norm_numints; uint64_t zn_hash; matchtype_t zn_matchtype; + int zn_normflags; char zn_normbuf[ZAP_MAXNAMELEN]; } zap_name_t; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zap_leaf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zap_leaf.c Fri Apr 14 18:19:48 2017 (r316906) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zap_leaf.c Fri Apr 14 18:20:20 2017 (r316907) @@ -18,9 +18,11 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2015 by Delphix. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. */ /* @@ -361,7 +363,7 @@ zap_leaf_array_match(zap_leaf_t *l, zap_ } ASSERT(zn->zn_key_intlen == 1); - if (zn->zn_matchtype == MT_FIRST) { + if (zn->zn_matchtype & MT_NORMALIZE) { char *thisname = kmem_alloc(array_numints, KM_SLEEP); boolean_t match; @@ -403,7 +405,6 @@ zap_leaf_lookup(zap_leaf_t *l, zap_name_ ASSERT3U(zap_leaf_phys(l)->l_hdr.lh_magic, ==, ZAP_LEAF_MAGIC); -again: for (chunkp = LEAF_HASH_ENTPTR(l, zn->zn_hash); *chunkp != CHAIN_END; chunkp = &le->le_next) { uint16_t chunk = *chunkp; @@ -418,9 +419,9 @@ again: /* * NB: the entry chain is always sorted by cd on * normalized zap objects, so this will find the - * lowest-cd match for MT_FIRST. + * lowest-cd match for MT_NORMALIZE. */ - ASSERT(zn->zn_matchtype == MT_EXACT || + ASSERT((zn->zn_matchtype == 0) || (zap_leaf_phys(l)->l_hdr.lh_flags & ZLF_ENTRIES_CDSORTED)); if (zap_leaf_array_match(l, zn, le->le_name_chunk, le->le_name_numints)) { @@ -434,15 +435,6 @@ again: } } - /* - * NB: we could of course do this in one pass, but that would be - * a pain. We'll see if MT_BEST is even used much. - */ - if (zn->zn_matchtype == MT_BEST) { - zn->zn_matchtype = MT_FIRST; - goto again; - } - return (SET_ERROR(ENOENT)); } @@ -697,7 +689,7 @@ zap_entry_normalization_conflict(zap_ent continue; if (zn == NULL) { - zn = zap_name_alloc(zap, name, MT_FIRST); + zn = zap_name_alloc(zap, name, MT_NORMALIZE); allocdzn = B_TRUE; } if (zap_leaf_array_match(zeh->zeh_leaf, zn, Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Fri Apr 14 18:19:48 2017 (r316906) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Fri Apr 14 18:20:20 2017 (r316907) @@ -18,11 +18,13 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2017 Nexenta Systems, Inc. */ #include @@ -133,7 +135,7 @@ zap_hash(zap_name_t *zn) } static int -zap_normalize(zap_t *zap, const char *name, char *namenorm) +zap_normalize(zap_t *zap, const char *name, char *namenorm, int normflags) { size_t inlen, outlen; int err; @@ -145,8 +147,8 @@ zap_normalize(zap_t *zap, const char *na err = 0; (void) u8_textprep_str((char *)name, &inlen, namenorm, &outlen, - zap->zap_normflags | U8_TEXTPREP_IGNORE_NULL | - U8_TEXTPREP_IGNORE_INVALID, U8_UNICODE_LATEST, &err); + normflags | U8_TEXTPREP_IGNORE_NULL | U8_TEXTPREP_IGNORE_INVALID, + U8_UNICODE_LATEST, &err); return (err); } @@ -156,15 +158,15 @@ zap_match(zap_name_t *zn, const char *ma { ASSERT(!(zap_getflags(zn->zn_zap) & ZAP_FLAG_UINT64_KEY)); - if (zn->zn_matchtype == MT_FIRST) { + if (zn->zn_matchtype & MT_NORMALIZE) { char norm[ZAP_MAXNAMELEN]; - if (zap_normalize(zn->zn_zap, matchname, norm) != 0) + if (zap_normalize(zn->zn_zap, matchname, norm, + zn->zn_normflags) != 0) return (B_FALSE); return (strcmp(zn->zn_key_norm, norm) == 0); } else { - /* MT_BEST or MT_EXACT */ return (strcmp(zn->zn_key_orig, matchname) == 0); } } @@ -185,15 +187,30 @@ zap_name_alloc(zap_t *zap, const char *k zn->zn_key_orig = key; zn->zn_key_orig_numints = strlen(zn->zn_key_orig) + 1; zn->zn_matchtype = mt; + zn->zn_normflags = zap->zap_normflags; + + /* + * If we're dealing with a case sensitive lookup on a mixed or + * insensitive fs, remove U8_TEXTPREP_TOUPPER or the lookup + * will fold case to all caps overriding the lookup request. + */ + if (mt & MT_MATCH_CASE) + zn->zn_normflags &= ~U8_TEXTPREP_TOUPPER; + if (zap->zap_normflags) { - if (zap_normalize(zap, key, zn->zn_normbuf) != 0) { + /* + * We *must* use zap_normflags because this normalization is + * what the hash is computed from. + */ + if (zap_normalize(zap, key, zn->zn_normbuf, + zap->zap_normflags) != 0) { zap_name_free(zn); return (NULL); } zn->zn_key_norm = zn->zn_normbuf; zn->zn_key_norm_numints = strlen(zn->zn_key_norm) + 1; } else { - if (mt != MT_EXACT) { + if (mt != 0) { zap_name_free(zn); return (NULL); } @@ -202,6 +219,20 @@ zap_name_alloc(zap_t *zap, const char *k } zn->zn_hash = zap_hash(zn); + + if (zap->zap_normflags != zn->zn_normflags) { + /* + * We *must* use zn_normflags because this normalization is + * what the matching is based on. (Not the hash!) + */ + if (zap_normalize(zap, key, zn->zn_normbuf, + zn->zn_normflags) != 0) { + zap_name_free(zn); + return (NULL); + } + zn->zn_key_norm_numints = strlen(zn->zn_key_norm) + 1; + } + return (zn); } @@ -215,7 +246,7 @@ zap_name_alloc_uint64(zap_t *zap, const zn->zn_key_intlen = sizeof (*key); zn->zn_key_orig = zn->zn_key_norm = key; zn->zn_key_orig_numints = zn->zn_key_norm_numints = numints; - zn->zn_matchtype = MT_EXACT; + zn->zn_matchtype = 0; zn->zn_hash = zap_hash(zn); return (zn); @@ -299,7 +330,6 @@ mze_find(zap_name_t *zn) mze_tofind.mze_hash = zn->zn_hash; mze_tofind.mze_cd = 0; -again: mze = avl_find(avl, &mze_tofind, &idx); if (mze == NULL) mze = avl_nearest(avl, idx, AVL_AFTER); @@ -308,10 +338,7 @@ again: if (zap_match(zn, MZE_PHYS(zn->zn_zap, mze)->mze_name)) return (mze); } - if (zn->zn_matchtype == MT_BEST) { - zn->zn_matchtype = MT_FIRST; - goto again; - } + return (NULL); } @@ -417,8 +444,7 @@ mzap_open(objset_t *os, uint64_t obj, dm zap_name_t *zn; zap->zap_m.zap_num_entries++; - zn = zap_name_alloc(zap, mze->mze_name, - MT_EXACT); + zn = zap_name_alloc(zap, mze->mze_name, 0); mze_insert(zap, i, zn->zn_hash); zap_name_free(zn); } @@ -618,7 +644,7 @@ mzap_upgrade(zap_t **zapp, void *tag, dm continue; dprintf("adding %s=%llu\n", mze->mze_name, mze->mze_value); - zn = zap_name_alloc(zap, mze->mze_name, MT_EXACT); + zn = zap_name_alloc(zap, mze->mze_name, 0); err = fzap_add_cd(zn, 8, 1, &mze->mze_value, mze->mze_cd, tag, tx); zap = zn->zn_zap; /* fzap_add_cd() may change zap */ @@ -631,6 +657,23 @@ mzap_upgrade(zap_t **zapp, void *tag, dm return (err); } +/* + * The "normflags" determine the behavior of the matchtype_t which is + * passed to zap_lookup_norm(). Names which have the same normalized + * version will be stored with the same hash value, and therefore we can + * perform normalization-insensitive lookups. We can be Unicode form- + * insensitive and/or case-insensitive. The following flags are valid for + * "normflags": + * + * U8_TEXTPREP_NFC + * U8_TEXTPREP_NFD + * U8_TEXTPREP_NFKC + * U8_TEXTPREP_NFKD + * U8_TEXTPREP_TOUPPER + * + * The *_NF* (Normalization Form) flags are mutually exclusive; at most one + * of them may be supplied. + */ void mzap_create_impl(objset_t *os, uint64_t obj, int normflags, zap_flags_t flags, dmu_tx_t *tx) @@ -789,7 +832,7 @@ again: if (zn == NULL) { zn = zap_name_alloc(zap, MZE_PHYS(zap, mze)->mze_name, - MT_FIRST); + MT_NORMALIZE); allocdzn = B_TRUE; } if (zap_match(zn, MZE_PHYS(zap, other)->mze_name)) { @@ -818,7 +861,7 @@ zap_lookup(objset_t *os, uint64_t zapobj uint64_t integer_size, uint64_t num_integers, void *buf) { return (zap_lookup_norm(os, zapobj, name, integer_size, - num_integers, buf, MT_EXACT, NULL, 0, NULL)); + num_integers, buf, 0, NULL, 0, NULL)); } static int @@ -886,7 +929,7 @@ zap_lookup_by_dnode(dnode_t *dn, const c uint64_t integer_size, uint64_t num_integers, void *buf) { return (zap_lookup_norm_by_dnode(dn, name, integer_size, - num_integers, buf, MT_EXACT, NULL, 0, NULL)); + num_integers, buf, 0, NULL, 0, NULL)); } int @@ -959,7 +1002,7 @@ int zap_contains(objset_t *os, uint64_t zapobj, const char *name) { int err = zap_lookup_norm(os, zapobj, name, 0, - 0, NULL, MT_EXACT, NULL, 0, NULL); + 0, NULL, 0, NULL, 0, NULL); if (err == EOVERFLOW || err == EINVAL) err = 0; /* found, but skipped reading the value */ return (err); @@ -977,7 +1020,7 @@ zap_length(objset_t *os, uint64_t zapobj err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, FTAG, &zap); if (err) return (err); - zn = zap_name_alloc(zap, name, MT_EXACT); + zn = zap_name_alloc(zap, name, 0); if (zn == NULL) { zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); @@ -1080,7 +1123,7 @@ zap_add(objset_t *os, uint64_t zapobj, c err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); if (err) return (err); - zn = zap_name_alloc(zap, key, MT_EXACT); + zn = zap_name_alloc(zap, key, 0); if (zn == NULL) { zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); @@ -1159,7 +1202,7 @@ zap_update(objset_t *os, uint64_t zapobj err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); if (err) return (err); - zn = zap_name_alloc(zap, name, MT_EXACT); + zn = zap_name_alloc(zap, name, 0); if (zn == NULL) { zap_unlockdir(zap, FTAG); return (SET_ERROR(ENOTSUP)); @@ -1222,7 +1265,7 @@ zap_update_uint64(objset_t *os, uint64_t int zap_remove(objset_t *os, uint64_t zapobj, const char *name, dmu_tx_t *tx) { - return (zap_remove_norm(os, zapobj, name, MT_EXACT, tx)); + return (zap_remove_norm(os, zapobj, name, 0, tx)); } int @@ -1474,7 +1517,7 @@ zap_count_write_by_dnode(dnode_t *dn, co return (err); if (!zap->zap_ismicro) { - zap_name_t *zn = zap_name_alloc(zap, name, MT_EXACT); + zap_name_t *zn = zap_name_alloc(zap, name, 0); if (zn) { err = fzap_count_write(zn, add, towrite, tooverwrite); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c Fri Apr 14 18:19:48 2017 (r316906) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c Fri Apr 14 18:20:20 2017 (r316907) @@ -18,9 +18,11 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2015 by Delphix. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. */ #include @@ -62,13 +64,12 @@ * of names after deciding which is the appropriate lookup interface. */ static int -zfs_match_find(zfsvfs_t *zfsvfs, znode_t *dzp, char *name, boolean_t exact, +zfs_match_find(zfsvfs_t *zfsvfs, znode_t *dzp, char *name, matchtype_t mt, boolean_t update, int *deflags, pathname_t *rpnp, uint64_t *zoid) { int error; if (zfsvfs->z_norm) { - matchtype_t mt = MT_FIRST; boolean_t conflict = B_FALSE; size_t bufsz = 0; char *buf = NULL; @@ -77,8 +78,7 @@ zfs_match_find(zfsvfs_t *zfsvfs, znode_t buf = rpnp->pn_buf; bufsz = rpnp->pn_bufsize; } - if (exact) - mt = MT_EXACT; + /* * In the non-mixed case we only expect there would ever * be one match, but we need to use the normalizing lookup. @@ -140,7 +140,7 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn zfsvfs_t *zfsvfs = dzp->z_zfsvfs; zfs_dirlock_t *dl; boolean_t update; - boolean_t exact; + matchtype_t mt = 0; uint64_t zoid; vnode_t *vp = NULL; int error = 0; @@ -175,13 +175,29 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn */ /* - * Decide if exact matches should be requested when performing - * a zap lookup on file systems supporting case-insensitive - * access. + * When matching we may need to normalize & change case according to + * FS settings. + * + * Note that a normalized match is necessary for a case insensitive + * filesystem when the lookup request is not exact because normalization + * can fold case independent of normalizing code point sequences. + * + * See the table above zfs_dropname(). */ - exact = - ((zfsvfs->z_case == ZFS_CASE_INSENSITIVE) && (flag & ZCIEXACT)) || - ((zfsvfs->z_case == ZFS_CASE_MIXED) && !(flag & ZCILOOK)); + if (zfsvfs->z_norm != 0) { + mt = MT_NORMALIZE; + + /* + * Determine if the match needs to honor the case specified in + * lookup, and if so keep track of that so that during + * normalization we don't fold case. + */ + if ((zfsvfs->z_case == ZFS_CASE_INSENSITIVE && + (flag & ZCIEXACT)) || + (zfsvfs->z_case == ZFS_CASE_MIXED && !(flag & ZCILOOK))) { + mt |= MT_MATCH_CASE; + } + } /* * Only look in or update the DNLC if we are looking for the @@ -194,7 +210,7 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn * case for performance improvement? */ update = !zfsvfs->z_norm || - ((zfsvfs->z_case == ZFS_CASE_MIXED) && + (zfsvfs->z_case == ZFS_CASE_MIXED && !(zfsvfs->z_norm & ~U8_TEXTPREP_TOUPPER) && !(flag & ZCILOOK)); /* @@ -308,7 +324,7 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn *zpp = VTOZ(vp); return (0); } else { - error = zfs_match_find(zfsvfs, dzp, name, exact, + error = zfs_match_find(zfsvfs, dzp, name, mt, update, direntflags, realpnp, &zoid); } } @@ -774,6 +790,28 @@ zfs_link_create(zfs_dirlock_t *dl, znode return (0); } +/* + * The match type in the code for this function should conform to: + * + * ------------------------------------------------------------------------ + * fs type | z_norm | lookup type | match type + * ---------|-------------|-------------|---------------------------------- + * CS !norm | 0 | 0 | 0 (exact) + * CS norm | formX | 0 | MT_NORMALIZE + * CI !norm | upper | !ZCIEXACT | MT_NORMALIZE + * CI !norm | upper | ZCIEXACT | MT_NORMALIZE | MT_MATCH_CASE + * CI norm | upper|formX | !ZCIEXACT | MT_NORMALIZE + * CI norm | upper|formX | ZCIEXACT | MT_NORMALIZE | MT_MATCH_CASE + * CM !norm | upper | !ZCILOOK | MT_NORMALIZE | MT_MATCH_CASE + * CM !norm | upper | ZCILOOK | MT_NORMALIZE + * CM norm | upper|formX | !ZCILOOK | MT_NORMALIZE | MT_MATCH_CASE + * CM norm | upper|formX | ZCILOOK | MT_NORMALIZE + * + * Abbreviations: + * CS = Case Sensitive, CI = Case Insensitive, CM = Case Mixed + * upper = case folding set by fs type on creation (U8_TEXTPREP_TOUPPER) + * formX = unicode normalization form set on fs creation + */ static int zfs_dropname(zfs_dirlock_t *dl, znode_t *zp, znode_t *dzp, dmu_tx_t *tx, int flag) @@ -781,18 +819,20 @@ zfs_dropname(zfs_dirlock_t *dl, znode_t int error; if (zp->z_zfsvfs->z_norm) { - if (((zp->z_zfsvfs->z_case == ZFS_CASE_INSENSITIVE) && + matchtype_t mt = MT_NORMALIZE; + + if ((zp->z_zfsvfs->z_case == ZFS_CASE_INSENSITIVE && (flag & ZCIEXACT)) || - ((zp->z_zfsvfs->z_case == ZFS_CASE_MIXED) && - !(flag & ZCILOOK))) - error = zap_remove_norm(zp->z_zfsvfs->z_os, - dzp->z_id, dl->dl_name, MT_EXACT, tx); - else - error = zap_remove_norm(zp->z_zfsvfs->z_os, - dzp->z_id, dl->dl_name, MT_FIRST, tx); + (zp->z_zfsvfs->z_case == ZFS_CASE_MIXED && + !(flag & ZCILOOK))) { + mt |= MT_MATCH_CASE; + } + + error = zap_remove_norm(zp->z_zfsvfs->z_os, dzp->z_id, + dl->dl_name, mt, tx); } else { - error = zap_remove(zp->z_zfsvfs->z_os, - dzp->z_id, dl->dl_name, tx); + error = zap_remove(zp->z_zfsvfs->z_os, dzp->z_id, dl->dl_name, + tx); } return (error); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 18:19:48 2017 (r316906) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 18:20:20 2017 (r316907) @@ -18,12 +18,13 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. - * Copyright 2014 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2015 Joyent, Inc. + * Copyright 2017 Nexenta Systems, Inc. */ /* Portions Copyright 2007 Jeremy Teo */ @@ -1237,7 +1238,15 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode zfsvfs_t *zfsvfs = zdp->z_zfsvfs; int error = 0; - /* fast path */ + /* + * Fast path lookup, however we must skip DNLC lookup + * for case folding or normalizing lookups because the + * DNLC code only stores the passed in name. This means + * creating 'a' and removing 'A' on a case insensitive + * file system would work, but DNLC still thinks 'a' + * exists and won't let you create it again on the next + * pass through fast path. + */ if (!(flags & (LOOKUP_XATTR | FIGNORECASE))) { if (dvp->v_type != VDIR) { @@ -1254,7 +1263,9 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode return (0); } return (error); - } else { + } else if (!zdp->z_zfsvfs->z_norm && + (zdp->z_zfsvfs->z_case == ZFS_CASE_SENSITIVE)) { + vnode_t *tvp = dnlc_lookup(dvp, nm); if (tvp) { From owner-svn-src-all@freebsd.org Fri Apr 14 18:20:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6B34D3EDB6; Fri, 14 Apr 2017 18:20:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A1B080; Fri, 14 Apr 2017 18:20:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIKuKi067419; Fri, 14 Apr 2017 18:20:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIKuUq067417; Fri, 14 Apr 2017 18:20:56 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141820.v3EIKuUq067417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316908 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:20:57 -0000 Author: avg Date: Fri Apr 14 18:20:56 2017 New Revision: 316908 URL: https://svnweb.freebsd.org/changeset/base/316908 Log: 7541 zpool import/tryimport ioctl returns ENOMEM because provided buffer is too small for config illumos/illumos-gate@8b65a70b763232c90a91f31eb2010314c02ed338 https://github.com/illumos/illumos-gate/commit/8b65a70b763232c90a91f31eb2010314c02ed338 https://www.illumos.org/issues/7541 When calling zpool import, zpool does a few ioctls to ZFS. zpool allocates a buffer in userland and passes it to the kernel so that ZFS can copy info into it. ZFS will use it to put the nvlist that describes the pool configuration. If the allocated buffer is too small, ZFS will return ENOMEM and the call will have to be redone. This wastes CPU time and slows down the import process. This happens very often for the ZFS_IOC_POOL_TRYIMPORT call. Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Approved by: Dan McDonald Author: Pavel Zakharov Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h Fri Apr 14 18:20:20 2017 (r316907) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h Fri Apr 14 18:20:56 2017 (r316908) @@ -130,6 +130,8 @@ typedef enum { SHARED_SMB = 0x4 } zfs_share_type_t; +#define CONFIG_BUF_MINSIZE 65536 + int zfs_error(libzfs_handle_t *, int, const char *); int zfs_error_fmt(libzfs_handle_t *, int, const char *, ...); void zfs_error_aux(libzfs_handle_t *, const char *, ...); Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Fri Apr 14 18:20:20 2017 (r316907) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Fri Apr 14 18:20:56 2017 (r316908) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright 2015 RackTop Systems. * Copyright 2016 Nexenta Systems, Inc. */ @@ -380,13 +380,14 @@ refresh_config(libzfs_handle_t *hdl, nvl { nvlist_t *nvl; zfs_cmd_t zc = { 0 }; - int err; + int err, dstbuf_size; if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) return (NULL); - if (zcmd_alloc_dst_nvlist(hdl, &zc, - zc.zc_nvlist_conf_size * 2) != 0) { + dstbuf_size = MAX(CONFIG_BUF_MINSIZE, zc.zc_nvlist_conf_size * 4); + + if (zcmd_alloc_dst_nvlist(hdl, &zc, dstbuf_size) != 0) { zcmd_free_nvlists(&zc); return (NULL); } From owner-svn-src-all@freebsd.org Fri Apr 14 18:21:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5C9CD3EF14; Fri, 14 Apr 2017 18:21:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68E4861E; Fri, 14 Apr 2017 18:21:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EILwMJ070317; Fri, 14 Apr 2017 18:21:58 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EILwpH070316; Fri, 14 Apr 2017 18:21:58 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141821.v3EILwpH070316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316909 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:21:59 -0000 Author: avg Date: Fri Apr 14 18:21:58 2017 New Revision: 316909 URL: https://svnweb.freebsd.org/changeset/base/316909 Log: 7803 want devid_str_from_path(3devid) illumos/illumos-gate@46d46cd4fa12218e54fa3d73a9be825ed504cabb https://github.com/illumos/illumos-gate/commit/46d46cd4fa12218e54fa3d73a9be825ed504cabb https://www.illumos.org/issues/7803 Make get_devid() from libzfs a public function in libdevid, as its pretty usable in other places and duplicating all the logic required to get string encoded devid from path seems counter-productive. Reviewed by: Dan McDonald Reviewed by: Jason King Reviewed by: Marcel Telka Reviewed by: Prakash Surya Approved by: Robert Mustacchi Author: Yuri Pankov Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Fri Apr 14 18:20:56 2017 (r316908) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Fri Apr 14 18:21:58 2017 (r316909) @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright 2015 RackTop Systems. - * Copyright 2016 Nexenta Systems, Inc. + * Copyright 2017 Nexenta Systems, Inc. */ /* @@ -95,31 +95,6 @@ typedef struct pool_list { name_entry_t *names; } pool_list_t; -static char * -get_devid(const char *path) -{ - int fd; - ddi_devid_t devid; - char *minor, *ret; - - if ((fd = open(path, O_RDONLY)) < 0) - return (NULL); - - minor = NULL; - ret = NULL; - if (devid_get(fd, &devid) == 0) { - if (devid_get_minor_name(fd, &minor) == 0) - ret = devid_str_encode(devid, minor); - if (minor != NULL) - devid_str_free(minor); - devid_free(devid); - } - (void) close(fd); - - return (ret); -} - - /* * Go through and fix up any path and/or devid information for the given vdev * configuration. @@ -195,7 +170,7 @@ fix_paths(nvlist_t *nv, name_entry_t *na if (nvlist_add_string(nv, ZPOOL_CONFIG_PATH, best->ne_name) != 0) return (-1); - if ((devid = get_devid(best->ne_name)) == NULL) { + if ((devid = devid_str_from_path(best->ne_name)) == NULL) { (void) nvlist_remove_all(nv, ZPOOL_CONFIG_DEVID); } else { if (nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, devid) != 0) { From owner-svn-src-all@freebsd.org Fri Apr 14 18:22:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 743B1D3EF7C; Fri, 14 Apr 2017 18:22:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FA22838; Fri, 14 Apr 2017 18:22:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIMgrj070417; Fri, 14 Apr 2017 18:22:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIMgVp070414; Fri, 14 Apr 2017 18:22:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141822.v3EIMgVp070414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316910 - in vendor-sys/illumos/dist: common/nvpair uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:22:43 -0000 Author: avg Date: Fri Apr 14 18:22:42 2017 New Revision: 316910 URL: https://svnweb.freebsd.org/changeset/base/316910 Log: 7812 Remove gender specific language illumos/illumos-gate@48bbca816818409505a6e214d0911fda44e622e3 https://github.com/illumos/illumos-gate/commit/48bbca816818409505a6e214d0911fda44e622e3 https://www.illumos.org/issues/7812 This change removes all gendered language that did not refer specifically to an individual person or pet. The convention taken was to use variations on "they" when referring to users and/or human beings, while using "it" when referring to code, functions, and/or libraries. Additionally, we took the liberty to fix up any whitespace issues that were found in any files that were already being modified. Reviewed by: Matt Ahrens Reviewed by: Prakash Surya Reviewed by: Steve Gonczi Reviewed by: Chris Williamson Reviewed by: George Wilson Reviewed by: Igor Kozhukhov Reviewed by: Dan McDonald Reviewed by: Robert Mustacchi Approved by: Richard Lowe Author: Daniel Hoffman Modified: vendor-sys/illumos/dist/common/nvpair/nvpair.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/common/nvpair/nvpair.c ============================================================================== --- vendor-sys/illumos/dist/common/nvpair/nvpair.c Fri Apr 14 18:21:58 2017 (r316909) +++ vendor-sys/illumos/dist/common/nvpair/nvpair.c Fri Apr 14 18:22:42 2017 (r316910) @@ -2375,7 +2375,7 @@ nvlist_xpack(nvlist_t *nvl, char **bufp, * 1. The nvlist has fixed allocator properties. * All other nvlist routines (like nvlist_add_*, ...) use * these properties. - * 2. When using nvlist_pack() the user can specify his own + * 2. When using nvlist_pack() the user can specify their own * allocator properties (e.g. by using KM_NOSLEEP). * * We use the user specified properties (2). A clearer solution Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c Fri Apr 14 18:21:58 2017 (r316909) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c Fri Apr 14 18:22:42 2017 (r316910) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2015 by Delphix. All rights reserved. + * Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright 2017 Nexenta Systems, Inc. */ @@ -287,8 +287,8 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn * dl_name in case the first thread goes away before we do. * Note that we initialize the new name before storing its * pointer into dl_name, because the first thread may load - * dl->dl_name at any time. He'll either see the old value, - * which is his, or the new shared copy; either is OK. + * dl->dl_name at any time. It'll either see the old value, + * which belongs to it, or the new shared copy; either is OK. */ dl->dl_namesize = strlen(dl->dl_name) + 1; name = kmem_alloc(dl->dl_namesize, KM_SLEEP); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Apr 14 18:21:58 2017 (r316909) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Apr 14 18:22:42 2017 (r316910) @@ -1679,7 +1679,7 @@ zio_reexecute(zio_t *pio) /* * Now that all children have been reexecuted, execute the parent. * We don't reexecute "The Godfather" I/O here as it's the - * responsibility of the caller to wait on him. + * responsibility of the caller to wait on it. */ if (!(pio->io_flags & ZIO_FLAG_GODFATHER)) { pio->io_queued_timestamp = gethrtime(); From owner-svn-src-all@freebsd.org Fri Apr 14 18:23:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63CE3D3EFDD; Fri, 14 Apr 2017 18:23:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C63D96A; Fri, 14 Apr 2017 18:23:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EINI81070488; Fri, 14 Apr 2017 18:23:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EINIcB070487; Fri, 14 Apr 2017 18:23:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141823.v3EINIcB070487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316911 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:23:19 -0000 Author: avg Date: Fri Apr 14 18:23:18 2017 New Revision: 316911 URL: https://svnweb.freebsd.org/changeset/base/316911 Log: 7816 remove static unused variable in zfs_vfsops.c illumos/illumos-gate@2e972bf18f2d3dc8a060f336db39dc8432ee887c https://github.com/illumos/illumos-gate/commit/2e972bf18f2d3dc8a060f336db39dc8432ee887c https://www.illumos.org/issues/7816 found by gcc6 build unused static variable: -static const fs_operation_def_t zfs_vfsops_eio_template[] = { - VFSNAME_FREEVFS, { .vfs_freevfs = zfs_freevfs }, - NULL, NULL -}; Reviewed by: Matt Ahrens Reviewed by: Andy Stormont astormont@racktopsystems.com Reviewed by: Pavel Zakharov Approved by: Dan McDonald Author: Igor Kozhukhov Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Fri Apr 14 18:22:42 2017 (r316910) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Fri Apr 14 18:23:18 2017 (r316911) @@ -96,11 +96,6 @@ static const fs_operation_def_t zfs_vfso NULL, NULL }; -static const fs_operation_def_t zfs_vfsops_eio_template[] = { - VFSNAME_FREEVFS, { .vfs_freevfs = zfs_freevfs }, - NULL, NULL -}; - /* * We need to keep a count of active fs's. * This is necessary to prevent our module From owner-svn-src-all@freebsd.org Fri Apr 14 18:24:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A1FFD3E042; Fri, 14 Apr 2017 18:24:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39F79A95; Fri, 14 Apr 2017 18:24:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIO30k070562; Fri, 14 Apr 2017 18:24:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIO3bb070558; Fri, 14 Apr 2017 18:24:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141824.v3EIO3bb070558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316912 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:24:04 -0000 Author: avg Date: Fri Apr 14 18:24:03 2017 New Revision: 316912 URL: https://svnweb.freebsd.org/changeset/base/316912 Log: 7793 ztest fails assertion in dmu_tx_willuse_space illumos/illumos-gate@61e255ce7267b52208af9daf434b77d37fb75622 https://github.com/illumos/illumos-gate/commit/61e255ce7267b52208af9daf434b77d37fb75622 https://www.illumos.org/issues/7793 Background information: This assertion about tx_space_* verifies that we are not dirtying more stuff than we thought we would. We “need†to know how much we will dirty so that we can check if we should fail this transaction with ENOSPC/EDQUOT, in dmu_tx_assign(). While the transaction is open (i.e. between dmu_tx_assign() and dmu_tx_commit() — typically less than a millisecond), we call dbuf_dirty() on the exact blocks that will be modified. Once this happens, the temporary accounting in tx_space_* is unnecessary, because we know exactly what blocks are newly dirtied; we call dnode_willuse_space() to track this more exact accounting. The fundamental problem causing this bug is that dmu_tx_hold_*() relies on the current state in the DMU (e.g. dn_nlevels) to predict how much will be dirtied by this transaction, but this state can change before we actually perform the transaction (i.e. call dbuf_dirty()). This bug will be fixed by removing the assertion that the tx_space_* accounting is perfectly accurate (i.e. we never dirty more than was predicted by dmu_tx_hold_*()). By removing the requirement that this accounting be perfectly accurate, we can also vastly simplify it, e.g. removing most of the logic in dmu_tx_count_*(). The new tx space accounting will be very approximate, and may be more or less than what is actually dirtied. It will still be used to determine if this transaction will put us over quota. Transactions that are marked by dmu_tx_mark_netfree() will be excepted from this check. We won’t make an attempt to determine how much space will be freed by the transaction — this was rarely accurate enough to determine if a transaction should be permitted when we are over quota, which is why dmu_tx_mark_netfree() was introduced in 2014. We also won’t attempt to give “credit†when overwriting existing blocks, if those blocks may be freed. This allows us to remove the do_free_accounting logic in dbuf_dirty(), and associated routines. This Reviewed by: Steve Gonczi Reviewed by: George Wilson Reviewed by: Pavel Zakharov Reviewed by: Brian Behlendorf Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_tx.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dir.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:23:18 2017 (r316911) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:24:03 2017 (r316912) @@ -1346,41 +1346,6 @@ dbuf_free_range(dnode_t *dn, uint64_t st mutex_exit(&dn->dn_dbufs_mtx); } -static int -dbuf_block_freeable(dmu_buf_impl_t *db) -{ - dsl_dataset_t *ds = db->db_objset->os_dsl_dataset; - uint64_t birth_txg = 0; - - /* - * We don't need any locking to protect db_blkptr: - * If it's syncing, then db_last_dirty will be set - * so we'll ignore db_blkptr. - * - * This logic ensures that only block births for - * filled blocks are considered. - */ - ASSERT(MUTEX_HELD(&db->db_mtx)); - if (db->db_last_dirty && (db->db_blkptr == NULL || - !BP_IS_HOLE(db->db_blkptr))) { - birth_txg = db->db_last_dirty->dr_txg; - } else if (db->db_blkptr != NULL && !BP_IS_HOLE(db->db_blkptr)) { - birth_txg = db->db_blkptr->blk_birth; - } - - /* - * If this block don't exist or is in a snapshot, it can't be freed. - * Don't pass the bp to dsl_dataset_block_freeable() since we - * are holding the db_mtx lock and might deadlock if we are - * prefetching a dedup-ed block. - */ - if (birth_txg != 0) - return (ds == NULL || - dsl_dataset_block_freeable(ds, NULL, birth_txg)); - else - return (B_FALSE); -} - void dbuf_new_size(dmu_buf_impl_t *db, int size, dmu_tx_t *tx) { @@ -1430,7 +1395,7 @@ dbuf_new_size(dmu_buf_impl_t *db, int si } mutex_exit(&db->db_mtx); - dnode_willuse_space(dn, size-osize, tx); + dmu_objset_willuse_space(dn->dn_objset, size - osize, tx); DB_DNODE_EXIT(db); } @@ -1480,7 +1445,6 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t objset_t *os; dbuf_dirty_record_t **drp, *dr; int drop_struct_lock = FALSE; - boolean_t do_free_accounting = B_FALSE; int txgoff = tx->tx_txg & TXG_MASK; ASSERT(tx->tx_txg != 0); @@ -1602,15 +1566,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t dprintf_dbuf(db, "size=%llx\n", (u_longlong_t)db->db.db_size); if (db->db_blkid != DMU_BONUS_BLKID) { - /* - * Update the accounting. - * Note: we delay "free accounting" until after we drop - * the db_mtx. This keeps us from grabbing other locks - * (and possibly deadlocking) in bp_get_dsize() while - * also holding the db_mtx. - */ - dnode_willuse_space(dn, db->db.db_size, tx); - do_free_accounting = dbuf_block_freeable(db); + dmu_objset_willuse_space(os, db->db.db_size, tx); } /* @@ -1703,21 +1659,13 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t drop_struct_lock = TRUE; } - if (do_free_accounting) { - blkptr_t *bp = db->db_blkptr; - int64_t willfree = (bp && !BP_IS_HOLE(bp)) ? - bp_get_dsize(os->os_spa, bp) : db->db.db_size; - /* - * This is only a guess -- if the dbuf is dirty - * in a previous txg, we don't know how much - * space it will use on disk yet. We should - * really have the struct_rwlock to access - * db_blkptr, but since this is just a guess, - * it's OK if we get an odd answer. - */ - ddt_prefetch(os->os_spa, bp); - dnode_willuse_space(dn, -willfree, tx); - } + /* + * If we are overwriting a dedup BP, then unless it is snapshotted, + * when we get to syncing context we will need to decrement its + * refcount in the DDT. Prefetch the relevant DDT block so that + * syncing context won't have to wait for the i/o. + */ + ddt_prefetch(os->os_spa, db->db_blkptr); if (db->db_level == 0) { dnode_new_blkid(dn, db->db_blkid, tx, drop_struct_lock); @@ -2927,19 +2875,6 @@ dmu_buf_user_evict_wait() taskq_wait(dbu_evict_taskq); } -boolean_t -dmu_buf_freeable(dmu_buf_t *dbuf) -{ - boolean_t res = B_FALSE; - dmu_buf_impl_t *db = (dmu_buf_impl_t *)dbuf; - - if (db->db_blkptr) - res = dsl_dataset_block_freeable(db->db_objset->os_dsl_dataset, - db->db_blkptr, db->db_blkptr->blk_birth); - - return (res); -} - blkptr_t * dmu_buf_get_blkptr(dmu_buf_t *db) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Fri Apr 14 18:23:18 2017 (r316911) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Fri Apr 14 18:24:03 2017 (r316912) @@ -2103,3 +2103,20 @@ dmu_fsname(const char *snapname, char *b (void) strlcpy(buf, snapname, atp - snapname + 1); return (0); } + +/* + * Call when we think we're going to write/free space in open context to track + * the amount of dirty data in the open txg, which is also the amount + * of memory that can not be evicted until this txg syncs. + */ +void +dmu_objset_willuse_space(objset_t *os, int64_t space, dmu_tx_t *tx) +{ + dsl_dataset_t *ds = os->os_dsl_dataset; + int64_t aspace = spa_get_worst_case_asize(os->os_spa, space); + + if (ds != NULL) { + dsl_dir_willuse_space(ds->ds_dir, aspace, tx); + dsl_pool_dirty_space(dmu_tx_pool(tx), space, tx); + } +} Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Fri Apr 14 18:23:18 2017 (r316911) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Fri Apr 14 18:24:03 2017 (r316912) @@ -30,10 +30,10 @@ #include #include #include -#include /* for dsl_dataset_block_freeable() */ -#include /* for dsl_dir_tempreserve_*() */ +#include +#include #include -#include /* for fzap_default_block_shift */ +#include #include #include #include @@ -56,10 +56,6 @@ dmu_tx_create_dd(dsl_dir_t *dd) list_create(&tx->tx_callbacks, sizeof (dmu_tx_callback_t), offsetof(dmu_tx_callback_t, dcb_node)); tx->tx_start = gethrtime(); -#ifdef ZFS_DEBUG - refcount_create(&tx->tx_space_written); - refcount_create(&tx->tx_space_freed); -#endif return (tx); } @@ -68,7 +64,6 @@ dmu_tx_create(objset_t *os) { dmu_tx_t *tx = dmu_tx_create_dd(os->os_dsl_dataset->ds_dir); tx->tx_objset = os; - tx->tx_lastsnap_txg = dsl_dataset_prev_snap_txg(os->os_dsl_dataset); return (tx); } @@ -130,16 +125,10 @@ dmu_tx_hold_object_impl(dmu_tx_t *tx, ob txh->txh_tx = tx; txh->txh_dnode = dn; refcount_create(&txh->txh_space_towrite); - refcount_create(&txh->txh_space_tofree); - refcount_create(&txh->txh_space_tooverwrite); - refcount_create(&txh->txh_space_tounref); refcount_create(&txh->txh_memory_tohold); - refcount_create(&txh->txh_fudge); -#ifdef ZFS_DEBUG txh->txh_type = type; txh->txh_arg1 = arg1; txh->txh_arg2 = arg2; -#endif list_insert_tail(&tx->tx_holds, txh); return (txh); @@ -158,6 +147,34 @@ dmu_tx_add_new_object(dmu_tx_t *tx, objs } } +/* + * This function reads specified data from disk. The specified data will + * be needed to perform the transaction -- i.e, it will be read after + * we do dmu_tx_assign(). There are two reasons that we read the data now + * (before dmu_tx_assign()): + * + * 1. Reading it now has potentially better performance. The transaction + * has not yet been assigned, so the TXG is not held open, and also the + * caller typically has less locks held when calling dmu_tx_hold_*() than + * after the transaction has been assigned. This reduces the lock (and txg) + * hold times, thus reducing lock contention. + * + * 2. It is easier for callers (primarily the ZPL) to handle i/o errors + * that are detected before they start making changes to the DMU state + * (i.e. now). Once the transaction has been assigned, and some DMU + * state has been changed, it can be difficult to recover from an i/o + * error (e.g. to undo the changes already made in memory at the DMU + * layer). Typically code to do so does not exist in the caller -- it + * assumes that the data has already been cached and thus i/o errors are + * not possible. + * + * It has been observed that the i/o initiated here can be a performance + * problem, and it appears to be optional, because we don't look at the + * data which is read. However, removing this read would only serve to + * move the work elsewhere (after the dmu_tx_assign()), where it may + * have a greater impact on performance (in addition to the impact on + * fault tolerance noted above). + */ static int dmu_tx_check_ioerr(zio_t *zio, dnode_t *dn, int level, uint64_t blkid) { @@ -174,259 +191,84 @@ dmu_tx_check_ioerr(zio_t *zio, dnode_t * return (err); } -static void -dmu_tx_count_twig(dmu_tx_hold_t *txh, dnode_t *dn, dmu_buf_impl_t *db, - int level, uint64_t blkid, boolean_t freeable, uint64_t *history) -{ - objset_t *os = dn->dn_objset; - dsl_dataset_t *ds = os->os_dsl_dataset; - int epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; - dmu_buf_impl_t *parent = NULL; - blkptr_t *bp = NULL; - uint64_t space; - - if (level >= dn->dn_nlevels || history[level] == blkid) - return; - - history[level] = blkid; - - space = (level == 0) ? dn->dn_datablksz : (1ULL << dn->dn_indblkshift); - - if (db == NULL || db == dn->dn_dbuf) { - ASSERT(level != 0); - db = NULL; - } else { - ASSERT(DB_DNODE(db) == dn); - ASSERT(db->db_level == level); - ASSERT(db->db.db_size == space); - ASSERT(db->db_blkid == blkid); - bp = db->db_blkptr; - parent = db->db_parent; - } - - freeable = (bp && (freeable || - dsl_dataset_block_freeable(ds, bp, bp->blk_birth))); - - if (freeable) { - (void) refcount_add_many(&txh->txh_space_tooverwrite, - space, FTAG); - } else { - (void) refcount_add_many(&txh->txh_space_towrite, - space, FTAG); - } - - if (bp) { - (void) refcount_add_many(&txh->txh_space_tounref, - bp_get_dsize(os->os_spa, bp), FTAG); - } - - dmu_tx_count_twig(txh, dn, parent, level + 1, - blkid >> epbs, freeable, history); -} - /* ARGSUSED */ static void dmu_tx_count_write(dmu_tx_hold_t *txh, uint64_t off, uint64_t len) { dnode_t *dn = txh->txh_dnode; - uint64_t start, end, i; - int min_bs, max_bs, min_ibs, max_ibs, epbs, bits; int err = 0; if (len == 0) return; - min_bs = SPA_MINBLOCKSHIFT; - max_bs = highbit64(txh->txh_tx->tx_objset->os_recordsize) - 1; - min_ibs = DN_MIN_INDBLKSHIFT; - max_ibs = DN_MAX_INDBLKSHIFT; - - if (dn) { - uint64_t history[DN_MAX_LEVELS]; - int nlvls = dn->dn_nlevels; - int delta; + (void) refcount_add_many(&txh->txh_space_towrite, len, FTAG); - /* - * For i/o error checking, read the first and last level-0 - * blocks (if they are not aligned), and all the level-1 blocks. - */ - if (dn->dn_maxblkid == 0) { - delta = dn->dn_datablksz; - start = (off < dn->dn_datablksz) ? 0 : 1; - end = (off+len <= dn->dn_datablksz) ? 0 : 1; - if (start == 0 && (off > 0 || len < dn->dn_datablksz)) { - err = dmu_tx_check_ioerr(NULL, dn, 0, 0); - if (err) - goto out; - delta -= off; - } - } else { - zio_t *zio = zio_root(dn->dn_objset->os_spa, - NULL, NULL, ZIO_FLAG_CANFAIL); - - /* first level-0 block */ - start = off >> dn->dn_datablkshift; - if (P2PHASE(off, dn->dn_datablksz) || - len < dn->dn_datablksz) { - err = dmu_tx_check_ioerr(zio, dn, 0, start); - if (err) - goto out; - } + if (refcount_count(&txh->txh_space_towrite) > 2 * DMU_MAX_ACCESS) + err = SET_ERROR(EFBIG); - /* last level-0 block */ - end = (off+len-1) >> dn->dn_datablkshift; - if (end != start && end <= dn->dn_maxblkid && - P2PHASE(off+len, dn->dn_datablksz)) { - err = dmu_tx_check_ioerr(zio, dn, 0, end); - if (err) - goto out; - } + if (dn == NULL) + return; - /* level-1 blocks */ - if (nlvls > 1) { - int shft = dn->dn_indblkshift - SPA_BLKPTRSHIFT; - for (i = (start>>shft)+1; i < end>>shft; i++) { - err = dmu_tx_check_ioerr(zio, dn, 1, i); - if (err) - goto out; - } + /* + * For i/o error checking, read the blocks that will be needed + * to perform the write: the first and last level-0 blocks (if + * they are not aligned, i.e. if they are partial-block writes), + * and all the level-1 blocks. + */ + if (dn->dn_maxblkid == 0) { + if (off < dn->dn_datablksz && + (off > 0 || len < dn->dn_datablksz)) { + err = dmu_tx_check_ioerr(NULL, dn, 0, 0); + if (err != 0) { + txh->txh_tx->tx_err = err; } - - err = zio_wait(zio); - if (err) - goto out; - delta = P2NPHASE(off, dn->dn_datablksz); - } - - min_ibs = max_ibs = dn->dn_indblkshift; - if (dn->dn_maxblkid > 0) { - /* - * The blocksize can't change, - * so we can make a more precise estimate. - */ - ASSERT(dn->dn_datablkshift != 0); - min_bs = max_bs = dn->dn_datablkshift; - } else { - /* - * The blocksize can increase up to the recordsize, - * or if it is already more than the recordsize, - * up to the next power of 2. - */ - min_bs = highbit64(dn->dn_datablksz - 1); - max_bs = MAX(max_bs, highbit64(dn->dn_datablksz - 1)); } + } else { + zio_t *zio = zio_root(dn->dn_objset->os_spa, + NULL, NULL, ZIO_FLAG_CANFAIL); - /* - * If this write is not off the end of the file - * we need to account for overwrites/unref. - */ - if (start <= dn->dn_maxblkid) { - for (int l = 0; l < DN_MAX_LEVELS; l++) - history[l] = -1ULL; + /* first level-0 block */ + uint64_t start = off >> dn->dn_datablkshift; + if (P2PHASE(off, dn->dn_datablksz) || len < dn->dn_datablksz) { + err = dmu_tx_check_ioerr(zio, dn, 0, start); + if (err != 0) { + txh->txh_tx->tx_err = err; + } } - while (start <= dn->dn_maxblkid) { - dmu_buf_impl_t *db; - - rw_enter(&dn->dn_struct_rwlock, RW_READER); - err = dbuf_hold_impl(dn, 0, start, - FALSE, FALSE, FTAG, &db); - rw_exit(&dn->dn_struct_rwlock); - if (err) { + /* last level-0 block */ + uint64_t end = (off + len - 1) >> dn->dn_datablkshift; + if (end != start && end <= dn->dn_maxblkid && + P2PHASE(off + len, dn->dn_datablksz)) { + err = dmu_tx_check_ioerr(zio, dn, 0, end); + if (err != 0) { txh->txh_tx->tx_err = err; - return; } + } - dmu_tx_count_twig(txh, dn, db, 0, start, B_FALSE, - history); - dbuf_rele(db, FTAG); - if (++start > end) { - /* - * Account for new indirects appearing - * before this IO gets assigned into a txg. - */ - bits = 64 - min_bs; - epbs = min_ibs - SPA_BLKPTRSHIFT; - for (bits -= epbs * (nlvls - 1); - bits >= 0; bits -= epbs) { - (void) refcount_add_many( - &txh->txh_fudge, - 1ULL << max_ibs, FTAG); + /* level-1 blocks */ + if (dn->dn_nlevels > 1) { + int shft = dn->dn_indblkshift - SPA_BLKPTRSHIFT; + for (uint64_t i = (start >> shft) + 1; + i < end >> shft; i++) { + err = dmu_tx_check_ioerr(zio, dn, 1, i); + if (err != 0) { + txh->txh_tx->tx_err = err; } - goto out; } - off += delta; - if (len >= delta) - len -= delta; - delta = dn->dn_datablksz; } - } - - /* - * 'end' is the last thing we will access, not one past. - * This way we won't overflow when accessing the last byte. - */ - start = P2ALIGN(off, 1ULL << max_bs); - end = P2ROUNDUP(off + len, 1ULL << max_bs) - 1; - (void) refcount_add_many(&txh->txh_space_towrite, - end - start + 1, FTAG); - - start >>= min_bs; - end >>= min_bs; - epbs = min_ibs - SPA_BLKPTRSHIFT; - - /* - * The object contains at most 2^(64 - min_bs) blocks, - * and each indirect level maps 2^epbs. - */ - for (bits = 64 - min_bs; bits >= 0; bits -= epbs) { - start >>= epbs; - end >>= epbs; - ASSERT3U(end, >=, start); - (void) refcount_add_many(&txh->txh_space_towrite, - (end - start + 1) << max_ibs, FTAG); - if (start != 0) { - /* - * We also need a new blkid=0 indirect block - * to reference any existing file data. - */ - (void) refcount_add_many(&txh->txh_space_towrite, - 1ULL << max_ibs, FTAG); + err = zio_wait(zio); + if (err != 0) { + txh->txh_tx->tx_err = err; } } - -out: - if (refcount_count(&txh->txh_space_towrite) + - refcount_count(&txh->txh_space_tooverwrite) > - 2 * DMU_MAX_ACCESS) - err = SET_ERROR(EFBIG); - - if (err) - txh->txh_tx->tx_err = err; } static void dmu_tx_count_dnode(dmu_tx_hold_t *txh) { - dnode_t *dn = txh->txh_dnode; - dnode_t *mdn = DMU_META_DNODE(txh->txh_tx->tx_objset); - uint64_t space = mdn->dn_datablksz + - ((mdn->dn_nlevels-1) << mdn->dn_indblkshift); - - if (dn && dn->dn_dbuf->db_blkptr && - dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, - dn->dn_dbuf->db_blkptr, dn->dn_dbuf->db_blkptr->blk_birth)) { - (void) refcount_add_many(&txh->txh_space_tooverwrite, - space, FTAG); - (void) refcount_add_many(&txh->txh_space_tounref, space, FTAG); - } else { - (void) refcount_add_many(&txh->txh_space_towrite, space, FTAG); - if (dn && dn->dn_dbuf->db_blkptr) { - (void) refcount_add_many(&txh->txh_space_tounref, - space, FTAG); - } - } + (void) refcount_add_many(&txh->txh_space_towrite, DNODE_SIZE, FTAG); } void @@ -434,8 +276,8 @@ dmu_tx_hold_write(dmu_tx_t *tx, uint64_t { dmu_tx_hold_t *txh; - ASSERT(tx->tx_txg == 0); - ASSERT(len < DMU_MAX_ACCESS); + ASSERT0(tx->tx_txg); + ASSERT3U(len, <=, DMU_MAX_ACCESS); ASSERT(len == 0 || UINT64_MAX - off >= len - 1); txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, @@ -447,179 +289,6 @@ dmu_tx_hold_write(dmu_tx_t *tx, uint64_t dmu_tx_count_dnode(txh); } -static void -dmu_tx_count_free(dmu_tx_hold_t *txh, uint64_t off, uint64_t len) -{ - uint64_t blkid, nblks, lastblk; - uint64_t space = 0, unref = 0, skipped = 0; - dnode_t *dn = txh->txh_dnode; - dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset; - spa_t *spa = txh->txh_tx->tx_pool->dp_spa; - int epbs; - uint64_t l0span = 0, nl1blks = 0; - - if (dn->dn_nlevels == 0) - return; - - /* - * The struct_rwlock protects us against dn_nlevels - * changing, in case (against all odds) we manage to dirty & - * sync out the changes after we check for being dirty. - * Also, dbuf_hold_impl() wants us to have the struct_rwlock. - */ - rw_enter(&dn->dn_struct_rwlock, RW_READER); - epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; - if (dn->dn_maxblkid == 0) { - if (off == 0 && len >= dn->dn_datablksz) { - blkid = 0; - nblks = 1; - } else { - rw_exit(&dn->dn_struct_rwlock); - return; - } - } else { - blkid = off >> dn->dn_datablkshift; - nblks = (len + dn->dn_datablksz - 1) >> dn->dn_datablkshift; - - if (blkid > dn->dn_maxblkid) { - rw_exit(&dn->dn_struct_rwlock); - return; - } - if (blkid + nblks > dn->dn_maxblkid) - nblks = dn->dn_maxblkid - blkid + 1; - - } - l0span = nblks; /* save for later use to calc level > 1 overhead */ - if (dn->dn_nlevels == 1) { - int i; - for (i = 0; i < nblks; i++) { - blkptr_t *bp = dn->dn_phys->dn_blkptr; - ASSERT3U(blkid + i, <, dn->dn_nblkptr); - bp += blkid + i; - if (dsl_dataset_block_freeable(ds, bp, bp->blk_birth)) { - dprintf_bp(bp, "can free old%s", ""); - space += bp_get_dsize(spa, bp); - } - unref += BP_GET_ASIZE(bp); - } - nl1blks = 1; - nblks = 0; - } - - lastblk = blkid + nblks - 1; - while (nblks) { - dmu_buf_impl_t *dbuf; - uint64_t ibyte, new_blkid; - int epb = 1 << epbs; - int err, i, blkoff, tochk; - blkptr_t *bp; - - ibyte = blkid << dn->dn_datablkshift; - err = dnode_next_offset(dn, - DNODE_FIND_HAVELOCK, &ibyte, 2, 1, 0); - new_blkid = ibyte >> dn->dn_datablkshift; - if (err == ESRCH) { - skipped += (lastblk >> epbs) - (blkid >> epbs) + 1; - break; - } - if (err) { - txh->txh_tx->tx_err = err; - break; - } - if (new_blkid > lastblk) { - skipped += (lastblk >> epbs) - (blkid >> epbs) + 1; - break; - } - - if (new_blkid > blkid) { - ASSERT((new_blkid >> epbs) > (blkid >> epbs)); - skipped += (new_blkid >> epbs) - (blkid >> epbs) - 1; - nblks -= new_blkid - blkid; - blkid = new_blkid; - } - blkoff = P2PHASE(blkid, epb); - tochk = MIN(epb - blkoff, nblks); - - err = dbuf_hold_impl(dn, 1, blkid >> epbs, - FALSE, FALSE, FTAG, &dbuf); - if (err) { - txh->txh_tx->tx_err = err; - break; - } - - (void) refcount_add_many(&txh->txh_memory_tohold, - dbuf->db.db_size, FTAG); - - /* - * We don't check memory_tohold against DMU_MAX_ACCESS because - * memory_tohold is an over-estimation (especially the >L1 - * indirect blocks), so it could fail. Callers should have - * already verified that they will not be holding too much - * memory. - */ - - err = dbuf_read(dbuf, NULL, DB_RF_HAVESTRUCT | DB_RF_CANFAIL); - if (err != 0) { - txh->txh_tx->tx_err = err; - dbuf_rele(dbuf, FTAG); - break; - } - - bp = dbuf->db.db_data; - bp += blkoff; - - for (i = 0; i < tochk; i++) { - if (dsl_dataset_block_freeable(ds, &bp[i], - bp[i].blk_birth)) { - dprintf_bp(&bp[i], "can free old%s", ""); - space += bp_get_dsize(spa, &bp[i]); - } - unref += BP_GET_ASIZE(bp); - } - dbuf_rele(dbuf, FTAG); - - ++nl1blks; - blkid += tochk; - nblks -= tochk; - } - rw_exit(&dn->dn_struct_rwlock); - - /* - * Add in memory requirements of higher-level indirects. - * This assumes a worst-possible scenario for dn_nlevels and a - * worst-possible distribution of l1-blocks over the region to free. - */ - { - uint64_t blkcnt = 1 + ((l0span >> epbs) >> epbs); - int level = 2; - /* - * Here we don't use DN_MAX_LEVEL, but calculate it with the - * given datablkshift and indblkshift. This makes the - * difference between 19 and 8 on large files. - */ - int maxlevel = 2 + (DN_MAX_OFFSET_SHIFT - dn->dn_datablkshift) / - (dn->dn_indblkshift - SPA_BLKPTRSHIFT); - - while (level++ < maxlevel) { - (void) refcount_add_many(&txh->txh_memory_tohold, - MAX(MIN(blkcnt, nl1blks), 1) << dn->dn_indblkshift, - FTAG); - blkcnt = 1 + (blkcnt >> epbs); - } - } - - /* account for new level 1 indirect blocks that might show up */ - if (skipped > 0) { - (void) refcount_add_many(&txh->txh_fudge, - skipped << dn->dn_indblkshift, FTAG); - skipped = MIN(skipped, DMU_MAX_DELETEBLKCNT >> epbs); - (void) refcount_add_many(&txh->txh_memory_tohold, - skipped << dn->dn_indblkshift, FTAG); - } - (void) refcount_add_many(&txh->txh_space_tofree, space, FTAG); - (void) refcount_add_many(&txh->txh_space_tounref, unref, FTAG); -} - /* * This function marks the transaction as being a "net free". The end * result is that refquotas will be disabled for this transaction, and @@ -631,45 +300,27 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui void dmu_tx_mark_netfree(dmu_tx_t *tx) { - dmu_tx_hold_t *txh; - - txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, - DMU_NEW_OBJECT, THT_FREE, 0, 0); - - /* - * Pretend that this operation will free 1GB of space. This - * should be large enough to cancel out the largest write. - * We don't want to use something like UINT64_MAX, because that would - * cause overflows when doing math with these values (e.g. in - * dmu_tx_try_assign()). - */ - (void) refcount_add_many(&txh->txh_space_tofree, - 1024 * 1024 * 1024, FTAG); - (void) refcount_add_many(&txh->txh_space_tounref, - 1024 * 1024 * 1024, FTAG); + tx->tx_netfree = B_TRUE; } void dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off, uint64_t len) { - dmu_tx_hold_t *txh; - dnode_t *dn; int err; - zio_t *zio; ASSERT(tx->tx_txg == 0); - txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, + dmu_tx_hold_t *txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, object, THT_FREE, off, len); if (txh == NULL) return; - dn = txh->txh_dnode; + dnode_t *dn = txh->txh_dnode; dmu_tx_count_dnode(txh); - if (off >= (dn->dn_maxblkid+1) * dn->dn_datablksz) + if (off >= (dn->dn_maxblkid + 1) * dn->dn_datablksz) return; if (len == DMU_OBJECT_END) - len = (dn->dn_maxblkid+1) * dn->dn_datablksz - off; + len = (dn->dn_maxblkid + 1) * dn->dn_datablksz - off; /* * For i/o error checking, we read the first and last level-0 @@ -689,7 +340,7 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t dmu_tx_count_write(txh, off, 1); /* last block will be modified if it is not aligned */ if (!IS_P2ALIGNED(off + len, 1 << dn->dn_datablkshift)) - dmu_tx_count_write(txh, off+len, 1); + dmu_tx_count_write(txh, off + len, 1); } /* @@ -711,7 +362,7 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t if (dn->dn_datablkshift == 0) start = end = 0; - zio = zio_root(tx->tx_pool->dp_spa, + zio_t *zio = zio_root(tx->tx_pool->dp_spa, NULL, NULL, ZIO_FLAG_CANFAIL); for (uint64_t i = start; i <= end; i++) { uint64_t ibyte = i << shift; @@ -719,127 +370,80 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t i = ibyte >> shift; if (err == ESRCH || i > end) break; - if (err) { + if (err != 0) { tx->tx_err = err; + (void) zio_wait(zio); return; } + (void) refcount_add_many(&txh->txh_memory_tohold, + 1 << dn->dn_indblkshift, FTAG); + err = dmu_tx_check_ioerr(zio, dn, 1, i); - if (err) { + if (err != 0) { tx->tx_err = err; + (void) zio_wait(zio); return; } } err = zio_wait(zio); - if (err) { + if (err != 0) { tx->tx_err = err; return; } } - - dmu_tx_count_free(txh, off, len); } void dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t object, int add, const char *name) { - dmu_tx_hold_t *txh; - dnode_t *dn; int err; ASSERT(tx->tx_txg == 0); - txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, + dmu_tx_hold_t *txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, object, THT_ZAP, add, (uintptr_t)name); if (txh == NULL) return; - dn = txh->txh_dnode; + dnode_t *dn = txh->txh_dnode; dmu_tx_count_dnode(txh); - if (dn == NULL) { - /* - * We will be able to fit a new object's entries into one leaf - * block. So there will be at most 2 blocks total, - * including the header block. - */ - dmu_tx_count_write(txh, 0, 2 << fzap_default_block_shift); + /* + * Modifying a almost-full microzap is around the worst case (128KB) + * + * If it is a fat zap, the worst case would be 7*16KB=112KB: + * - 3 blocks overwritten: target leaf, ptrtbl block, header block + * - 4 new blocks written if adding: + * - 2 blocks for possibly split leaves, + * - 2 grown ptrtbl blocks + */ + (void) refcount_add_many(&txh->txh_space_towrite, + MZAP_MAX_BLKSZ, FTAG); + + if (dn == NULL) return; - } ASSERT3P(DMU_OT_BYTESWAP(dn->dn_type), ==, DMU_BSWAP_ZAP); - if (dn->dn_maxblkid == 0 && !add) { - blkptr_t *bp; - + if (dn->dn_maxblkid == 0 || name == NULL) { /* - * If there is only one block (i.e. this is a micro-zap) - * and we are not adding anything, the accounting is simple. + * This is a microzap (only one block), or we don't know + * the name. Check the first block for i/o errors. */ err = dmu_tx_check_ioerr(NULL, dn, 0, 0); - if (err) { + if (err != 0) { tx->tx_err = err; - return; - } - - /* - * Use max block size here, since we don't know how much - * the size will change between now and the dbuf dirty call. - */ - bp = &dn->dn_phys->dn_blkptr[0]; - if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, - bp, bp->blk_birth)) { - (void) refcount_add_many(&txh->txh_space_tooverwrite, - MZAP_MAX_BLKSZ, FTAG); - } else { - (void) refcount_add_many(&txh->txh_space_towrite, - MZAP_MAX_BLKSZ, FTAG); } - if (!BP_IS_HOLE(bp)) { - (void) refcount_add_many(&txh->txh_space_tounref, - MZAP_MAX_BLKSZ, FTAG); - } - return; - } - - if (dn->dn_maxblkid > 0 && name) { + } else { /* - * access the name in this fat-zap so that we'll check - * for i/o errors to the leaf blocks, etc. + * Access the name so that we'll check for i/o errors to + * the leaf blocks, etc. We ignore ENOENT, as this name + * may not yet exist. */ err = zap_lookup_by_dnode(dn, name, 8, 0, NULL); - if (err == EIO) { + if (err == EIO || err == ECKSUM || err == ENXIO) { tx->tx_err = err; - return; - } - } - - err = zap_count_write_by_dnode(dn, name, add, - &txh->txh_space_towrite, &txh->txh_space_tooverwrite); - - /* - * If the modified blocks are scattered to the four winds, - * we'll have to modify an indirect twig for each. We can make - * modifications at up to 3 locations: - * - header block at the beginning of the object - * - target leaf block - * - end of the object, where we might need to write: - * - a new leaf block if the target block needs to be split - * - the new pointer table, if it is growing - * - the new cookie table, if it is growing - */ - int epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; - dsl_dataset_phys_t *ds_phys = - dsl_dataset_phys(dn->dn_objset->os_dsl_dataset); - for (int lvl = 1; lvl < dn->dn_nlevels; lvl++) { - uint64_t num_indirects = 1 + (dn->dn_maxblkid >> (epbs * lvl)); - uint64_t spc = MIN(3, num_indirects) << dn->dn_indblkshift; - if (ds_phys->ds_prev_snap_obj != 0) { - (void) refcount_add_many(&txh->txh_space_towrite, - spc, FTAG); - } else { - (void) refcount_add_many(&txh->txh_space_tooverwrite, - spc, FTAG); } } } @@ -869,42 +473,15 @@ dmu_tx_hold_space(dmu_tx_t *tx, uint64_t (void) refcount_add_many(&txh->txh_space_towrite, space, FTAG); } -int -dmu_tx_holds(dmu_tx_t *tx, uint64_t object) -{ - dmu_tx_hold_t *txh; - int holds = 0; - - /* - * By asserting that the tx is assigned, we're counting the - * number of dn_tx_holds, which is the same as the number of - * dn_holds. Otherwise, we'd be counting dn_holds, but - * dn_tx_holds could be 0. - */ - ASSERT(tx->tx_txg != 0); - - /* if (tx->tx_anyobj == TRUE) */ - /* return (0); */ - - for (txh = list_head(&tx->tx_holds); txh; - txh = list_next(&tx->tx_holds, txh)) { - if (txh->txh_dnode && txh->txh_dnode->dn_object == object) - holds++; - } - - return (holds); -} - #ifdef ZFS_DEBUG void dmu_tx_dirty_buf(dmu_tx_t *tx, dmu_buf_impl_t *db) { - dmu_tx_hold_t *txh; - int match_object = FALSE, match_offset = FALSE; - dnode_t *dn; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 14 18:24:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0B29D3E0A0; Fri, 14 Apr 2017 18:24:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EBA1BE4; Fri, 14 Apr 2017 18:24:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIOcUR070624; Fri, 14 Apr 2017 18:24:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIOc5T070622; Fri, 14 Apr 2017 18:24:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141824.v3EIOc5T070622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316913 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:24:39 -0000 Author: avg Date: Fri Apr 14 18:24:38 2017 New Revision: 316913 URL: https://svnweb.freebsd.org/changeset/base/316913 Log: 7869 panic in bpobj_space(): null pointer dereference illumos/illumos-gate@a3905a45920de250d181b66ac0b6b71bd200d9ef https://github.com/illumos/illumos-gate/commit/a3905a45920de250d181b66ac0b6b71bd200d9ef https://www.illumos.org/issues/7869 The issue fixed by this patch is a race condition in the deadlist code. A thread executing an administrative command that uses `dsl_deadlist_space_range()` holds the lock of the whole `deadlist_t` to protect the access of all its entries that the deadlist contains in an avl tree. Sync threads trying to insert a new entry in the deadlist (through `dsl_deadlist_insert()` -> `dle_enqueue()`) do not hold the deadlist lock at that moment. If the `dle_bpobj` is the empty bpobj (our sentinel value), we close and reopen it. Between these two operations, it is possible for the `dsl_deadlist_space_range()` thread to dereference that bpobj which is `NULL` during that window. Threads should hold the a deadlist's `dl_lock` when they manipulate its internal data so scenarios like the one above are avoided. In addition, threads should also hold the bpobj lock whenever they are allocating the subobj list of a bpobj, and not just when they actually insert the subobj to the list. This way we can avoid potential memory leaks. Reviewed by: Matt Ahrens Reviewed by: Dan Kimmel Reviewed by: Steve Gonczi Reviewed by: John Kennedy Reviewed by: George Melikov Reviewed by: Brian Behlendorf Approved by: Dan McDonald Author: Serapheim Dimitropoulos Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Fri Apr 14 18:24:03 2017 (r316912) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Fri Apr 14 18:24:38 2017 (r316913) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -393,6 +393,7 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6 return; } + mutex_enter(&bpo->bpo_lock); dmu_buf_will_dirty(bpo->bpo_dbuf, tx); if (bpo->bpo_phys->bpo_subobjs == 0) { bpo->bpo_phys->bpo_subobjs = dmu_object_alloc(bpo->bpo_os, @@ -404,7 +405,6 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6 ASSERT0(dmu_object_info(bpo->bpo_os, bpo->bpo_phys->bpo_subobjs, &doi)); ASSERT3U(doi.doi_type, ==, DMU_OT_BPOBJ_SUBOBJ); - mutex_enter(&bpo->bpo_lock); dmu_write(bpo->bpo_os, bpo->bpo_phys->bpo_subobjs, bpo->bpo_phys->bpo_num_subobjs * sizeof (subobj), sizeof (subobj), &subobj, tx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c Fri Apr 14 18:24:03 2017 (r316912) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c Fri Apr 14 18:24:38 2017 (r316913) @@ -72,6 +72,8 @@ dsl_deadlist_load_tree(dsl_deadlist_t *d zap_cursor_t zc; zap_attribute_t za; + ASSERT(MUTEX_HELD(&dl->dl_lock)); + ASSERT(!dl->dl_oldfmt); if (dl->dl_havetree) return; @@ -182,6 +184,7 @@ static void dle_enqueue(dsl_deadlist_t *dl, dsl_deadlist_entry_t *dle, const blkptr_t *bp, dmu_tx_t *tx) { + ASSERT(MUTEX_HELD(&dl->dl_lock)); if (dle->dle_bpobj.bpo_object == dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) { uint64_t obj = bpobj_alloc(dl->dl_os, SPA_OLD_MAXBLOCKSIZE, tx); @@ -198,6 +201,7 @@ static void dle_enqueue_subobj(dsl_deadlist_t *dl, dsl_deadlist_entry_t *dle, uint64_t obj, dmu_tx_t *tx) { + ASSERT(MUTEX_HELD(&dl->dl_lock)); if (dle->dle_bpobj.bpo_object != dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) { bpobj_enqueue_subobj(&dle->dle_bpobj, obj, tx); @@ -222,15 +226,14 @@ dsl_deadlist_insert(dsl_deadlist_t *dl, return; } + mutex_enter(&dl->dl_lock); dsl_deadlist_load_tree(dl); dmu_buf_will_dirty(dl->dl_dbuf, tx); - mutex_enter(&dl->dl_lock); dl->dl_phys->dl_used += bp_get_dsize_sync(dmu_objset_spa(dl->dl_os), bp); dl->dl_phys->dl_comp += BP_GET_PSIZE(bp); dl->dl_phys->dl_uncomp += BP_GET_UCSIZE(bp); - mutex_exit(&dl->dl_lock); dle_tofind.dle_mintxg = bp->blk_birth; dle = avl_find(&dl->dl_tree, &dle_tofind, &where); @@ -239,6 +242,7 @@ dsl_deadlist_insert(dsl_deadlist_t *dl, else dle = AVL_PREV(&dl->dl_tree, dle); dle_enqueue(dl, dle, bp, tx); + mutex_exit(&dl->dl_lock); } /* @@ -254,16 +258,19 @@ dsl_deadlist_add_key(dsl_deadlist_t *dl, if (dl->dl_oldfmt) return; - dsl_deadlist_load_tree(dl); - dle = kmem_alloc(sizeof (*dle), KM_SLEEP); dle->dle_mintxg = mintxg; + + mutex_enter(&dl->dl_lock); + dsl_deadlist_load_tree(dl); + obj = bpobj_alloc_empty(dl->dl_os, SPA_OLD_MAXBLOCKSIZE, tx); VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); avl_add(&dl->dl_tree, dle); VERIFY3U(0, ==, zap_add_int_key(dl->dl_os, dl->dl_object, mintxg, obj, tx)); + mutex_exit(&dl->dl_lock); } /* @@ -278,6 +285,7 @@ dsl_deadlist_remove_key(dsl_deadlist_t * if (dl->dl_oldfmt) return; + mutex_enter(&dl->dl_lock); dsl_deadlist_load_tree(dl); dle_tofind.dle_mintxg = mintxg; @@ -291,6 +299,7 @@ dsl_deadlist_remove_key(dsl_deadlist_t * kmem_free(dle, sizeof (*dle)); VERIFY3U(0, ==, zap_remove_int(dl->dl_os, dl->dl_object, mintxg, tx)); + mutex_exit(&dl->dl_lock); } /* @@ -334,6 +343,7 @@ dsl_deadlist_clone(dsl_deadlist_t *dl, u return (newobj); } + mutex_enter(&dl->dl_lock); dsl_deadlist_load_tree(dl); for (dle = avl_first(&dl->dl_tree); dle; @@ -347,6 +357,7 @@ dsl_deadlist_clone(dsl_deadlist_t *dl, u VERIFY3U(0, ==, zap_add_int_key(dl->dl_os, newobj, dle->dle_mintxg, obj, tx)); } + mutex_exit(&dl->dl_lock); return (newobj); } @@ -424,6 +435,8 @@ dsl_deadlist_insert_bpobj(dsl_deadlist_t uint64_t used, comp, uncomp; bpobj_t bpo; + ASSERT(MUTEX_HELD(&dl->dl_lock)); + VERIFY3U(0, ==, bpobj_open(&bpo, dl->dl_os, obj)); VERIFY3U(0, ==, bpobj_space(&bpo, &used, &comp, &uncomp)); bpobj_close(&bpo); @@ -431,11 +444,9 @@ dsl_deadlist_insert_bpobj(dsl_deadlist_t dsl_deadlist_load_tree(dl); dmu_buf_will_dirty(dl->dl_dbuf, tx); - mutex_enter(&dl->dl_lock); dl->dl_phys->dl_used += used; dl->dl_phys->dl_comp += comp; dl->dl_phys->dl_uncomp += uncomp; - mutex_exit(&dl->dl_lock); dle_tofind.dle_mintxg = birth; dle = avl_find(&dl->dl_tree, &dle_tofind, &where); @@ -475,6 +486,7 @@ dsl_deadlist_merge(dsl_deadlist_t *dl, u return; } + mutex_enter(&dl->dl_lock); for (zap_cursor_init(&zc, dl->dl_os, obj); zap_cursor_retrieve(&zc, &za) == 0; zap_cursor_advance(&zc)) { @@ -489,6 +501,7 @@ dsl_deadlist_merge(dsl_deadlist_t *dl, u dmu_buf_will_dirty(bonus, tx); bzero(dlp, sizeof (*dlp)); dmu_buf_rele(bonus, FTAG); + mutex_exit(&dl->dl_lock); } /* @@ -503,6 +516,8 @@ dsl_deadlist_move_bpobj(dsl_deadlist_t * avl_index_t where; ASSERT(!dl->dl_oldfmt); + + mutex_enter(&dl->dl_lock); dmu_buf_will_dirty(dl->dl_dbuf, tx); dsl_deadlist_load_tree(dl); @@ -518,14 +533,12 @@ dsl_deadlist_move_bpobj(dsl_deadlist_t * VERIFY3U(0, ==, bpobj_space(&dle->dle_bpobj, &used, &comp, &uncomp)); - mutex_enter(&dl->dl_lock); ASSERT3U(dl->dl_phys->dl_used, >=, used); ASSERT3U(dl->dl_phys->dl_comp, >=, comp); ASSERT3U(dl->dl_phys->dl_uncomp, >=, uncomp); dl->dl_phys->dl_used -= used; dl->dl_phys->dl_comp -= comp; dl->dl_phys->dl_uncomp -= uncomp; - mutex_exit(&dl->dl_lock); VERIFY3U(0, ==, zap_remove_int(dl->dl_os, dl->dl_object, dle->dle_mintxg, tx)); @@ -536,4 +549,5 @@ dsl_deadlist_move_bpobj(dsl_deadlist_t * kmem_free(dle, sizeof (*dle)); dle = dle_next; } + mutex_exit(&dl->dl_lock); } From owner-svn-src-all@freebsd.org Fri Apr 14 18:25:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8076BD3E110; Fri, 14 Apr 2017 18:25:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CC38D76; Fri, 14 Apr 2017 18:25:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIP3ra070705; Fri, 14 Apr 2017 18:25:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIP2s3070697; Fri, 14 Apr 2017 18:25:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141825.v3EIP2s3070697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316914 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:25:04 -0000 Author: avg Date: Fri Apr 14 18:25:02 2017 New Revision: 316914 URL: https://svnweb.freebsd.org/changeset/base/316914 Log: 7801 add more by-dnode routines illumos/illumos-gate@b0c42cd4706ba01ce158bd2bb1004f7e59eca5fe https://github.com/illumos/illumos-gate/commit/b0c42cd4706ba01ce158bd2bb1004f7e59eca5fe https://www.illumos.org/issues/7801 Add *_by_dnode() routines for accessing objects given their dnode_t *, this is more efficient than accessing the object by (objset_t *, uint64_t object). This change converts some but not all of the existing consumers. As performance-sensitive code paths are discovered they should be converted to use these routines. Ported from: https://github.com/zfsonlinux/zfs/commit/ 0eef1bde31d67091d3deed23fe2394f5a8bf2276 Reviewed by: Matthew Ahrens Reviewed by: Brian Behlendorf Reviewed by: Pavel Zakharov Approved by: Robert Mustacchi Author: bzzz77 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_tx.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Fri Apr 14 18:24:38 2017 (r316913) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Fri Apr 14 18:25:02 2017 (r316914) @@ -871,17 +871,12 @@ dmu_free_range(objset_t *os, uint64_t ob return (0); } -int -dmu_read(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, +static int +dmu_read_impl(dnode_t *dn, uint64_t offset, uint64_t size, void *buf, uint32_t flags) { - dnode_t *dn; dmu_buf_t **dbp; - int numbufs, err; - - err = dnode_hold(os, object, FTAG, &dn); - if (err) - return (err); + int numbufs, err = 0; /* * Deal with odd block sizes, where there can't be data past the first @@ -926,22 +921,37 @@ dmu_read(objset_t *os, uint64_t object, } dmu_buf_rele_array(dbp, numbufs, FTAG); } - dnode_rele(dn, FTAG); return (err); } -void -dmu_write(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, - const void *buf, dmu_tx_t *tx) +int +dmu_read(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, + void *buf, uint32_t flags) { - dmu_buf_t **dbp; - int numbufs, i; + dnode_t *dn; + int err; - if (size == 0) - return; + err = dnode_hold(os, object, FTAG, &dn); + if (err != 0) + return (err); - VERIFY(0 == dmu_buf_hold_array(os, object, offset, size, - FALSE, FTAG, &numbufs, &dbp)); + err = dmu_read_impl(dn, offset, size, buf, flags); + dnode_rele(dn, FTAG); + return (err); +} + +int +dmu_read_by_dnode(dnode_t *dn, uint64_t offset, uint64_t size, void *buf, + uint32_t flags) +{ + return (dmu_read_impl(dn, offset, size, buf, flags)); +} + +static void +dmu_write_impl(dmu_buf_t **dbp, int numbufs, uint64_t offset, uint64_t size, + const void *buf, dmu_tx_t *tx) +{ + int i; for (i = 0; i < numbufs; i++) { int tocpy; @@ -969,6 +979,37 @@ dmu_write(objset_t *os, uint64_t object, size -= tocpy; buf = (char *)buf + tocpy; } +} + +void +dmu_write(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, + const void *buf, dmu_tx_t *tx) +{ + dmu_buf_t **dbp; + int numbufs; + + if (size == 0) + return; + + VERIFY0(dmu_buf_hold_array(os, object, offset, size, + FALSE, FTAG, &numbufs, &dbp)); + dmu_write_impl(dbp, numbufs, offset, size, buf, tx); + dmu_buf_rele_array(dbp, numbufs, FTAG); +} + +void +dmu_write_by_dnode(dnode_t *dn, uint64_t offset, uint64_t size, + const void *buf, dmu_tx_t *tx) +{ + dmu_buf_t **dbp; + int numbufs; + + if (size == 0) + return; + + VERIFY0(dmu_buf_hold_array_by_dnode(dn, offset, size, + FALSE, FTAG, &numbufs, &dbp, DMU_READ_PREFETCH)); + dmu_write_impl(dbp, numbufs, offset, size, buf, tx); dmu_buf_rele_array(dbp, numbufs, FTAG); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c Fri Apr 14 18:24:38 2017 (r316913) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c Fri Apr 14 18:25:02 2017 (r316914) @@ -93,11 +93,11 @@ dmu_object_alloc(objset_t *os, dmu_objec } dnode_allocate(dn, ot, blocksize, 0, bonustype, bonuslen, tx); - dnode_rele(dn, FTAG); - mutex_exit(&os->os_obj_lock); - dmu_tx_add_new_object(tx, os, object); + dmu_tx_add_new_object(tx, dn); + dnode_rele(dn, FTAG); + return (object); } @@ -115,9 +115,10 @@ dmu_object_claim(objset_t *os, uint64_t if (err) return (err); dnode_allocate(dn, ot, blocksize, 0, bonustype, bonuslen, tx); + dmu_tx_add_new_object(tx, dn); + dnode_rele(dn, FTAG); - dmu_tx_add_new_object(tx, os, object); return (0); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Fri Apr 14 18:24:38 2017 (r316913) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Fri Apr 14 18:25:02 2017 (r316914) @@ -93,21 +93,14 @@ dmu_tx_private_ok(dmu_tx_t *tx) } static dmu_tx_hold_t * -dmu_tx_hold_object_impl(dmu_tx_t *tx, objset_t *os, uint64_t object, - enum dmu_tx_hold_type type, uint64_t arg1, uint64_t arg2) +dmu_tx_hold_dnode_impl(dmu_tx_t *tx, dnode_t *dn, enum dmu_tx_hold_type type, + uint64_t arg1, uint64_t arg2) { dmu_tx_hold_t *txh; - dnode_t *dn = NULL; - int err; - - if (object != DMU_NEW_OBJECT) { - err = dnode_hold(os, object, tx, &dn); - if (err) { - tx->tx_err = err; - return (NULL); - } - if (err == 0 && tx->tx_txg != 0) { + if (dn != NULL) { + (void) refcount_add(&dn->dn_holds, tx); + if (tx->tx_txg != 0) { mutex_enter(&dn->dn_mtx); /* * dn->dn_assigned_txg == tx->tx_txg doesn't pose a @@ -134,17 +127,36 @@ dmu_tx_hold_object_impl(dmu_tx_t *tx, ob return (txh); } +static dmu_tx_hold_t * +dmu_tx_hold_object_impl(dmu_tx_t *tx, objset_t *os, uint64_t object, + enum dmu_tx_hold_type type, uint64_t arg1, uint64_t arg2) +{ + dnode_t *dn = NULL; + dmu_tx_hold_t *txh; + int err; + + if (object != DMU_NEW_OBJECT) { + err = dnode_hold(os, object, FTAG, &dn); + if (err != 0) { + tx->tx_err = err; + return (NULL); + } + } + txh = dmu_tx_hold_dnode_impl(tx, dn, type, arg1, arg2); + if (dn != NULL) + dnode_rele(dn, FTAG); + return (txh); +} + void -dmu_tx_add_new_object(dmu_tx_t *tx, objset_t *os, uint64_t object) +dmu_tx_add_new_object(dmu_tx_t *tx, dnode_t *dn) { /* * If we're syncing, they can manipulate any object anyhow, and * the hold on the dnode_t can cause problems. */ - if (!dmu_tx_is_syncing(tx)) { - (void) dmu_tx_hold_object_impl(tx, os, - object, THT_NEWOBJECT, 0, 0); - } + if (!dmu_tx_is_syncing(tx)) + (void) dmu_tx_hold_dnode_impl(tx, dn, THT_NEWOBJECT, 0, 0); } /* @@ -282,11 +294,26 @@ dmu_tx_hold_write(dmu_tx_t *tx, uint64_t txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, object, THT_WRITE, off, len); - if (txh == NULL) - return; + if (txh != NULL) { + dmu_tx_count_write(txh, off, len); + dmu_tx_count_dnode(txh); + } +} - dmu_tx_count_write(txh, off, len); - dmu_tx_count_dnode(txh); +void +dmu_tx_hold_write_by_dnode(dmu_tx_t *tx, dnode_t *dn, uint64_t off, int len) +{ + dmu_tx_hold_t *txh; + + ASSERT0(tx->tx_txg); + ASSERT3U(len, <=, DMU_MAX_ACCESS); + ASSERT(len == 0 || UINT64_MAX - off >= len - 1); + + txh = dmu_tx_hold_dnode_impl(tx, dn, THT_WRITE, off, len); + if (txh != NULL) { + dmu_tx_count_write(txh, off, len); + dmu_tx_count_dnode(txh); + } } /* @@ -303,18 +330,18 @@ dmu_tx_mark_netfree(dmu_tx_t *tx) tx->tx_netfree = B_TRUE; } -void -dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off, uint64_t len) +static void +dmu_tx_hold_free_impl(dmu_tx_hold_t *txh, uint64_t off, uint64_t len) { + dmu_tx_t *tx; + dnode_t *dn; int err; + zio_t *zio; + tx = txh->txh_tx; ASSERT(tx->tx_txg == 0); - dmu_tx_hold_t *txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, - object, THT_FREE, off, len); - if (txh == NULL) - return; - dnode_t *dn = txh->txh_dnode; + dn = txh->txh_dnode; dmu_tx_count_dnode(txh); if (off >= (dn->dn_maxblkid + 1) * dn->dn_datablksz) @@ -395,17 +422,36 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t } void -dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t object, int add, const char *name) +dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off, uint64_t len) +{ + dmu_tx_hold_t *txh; + + txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, + object, THT_FREE, off, len); + if (txh != NULL) + (void) dmu_tx_hold_free_impl(txh, off, len); +} + +void +dmu_tx_hold_free_by_dnode(dmu_tx_t *tx, dnode_t *dn, uint64_t off, uint64_t len) +{ + dmu_tx_hold_t *txh; + + txh = dmu_tx_hold_dnode_impl(tx, dn, THT_FREE, off, len); + if (txh != NULL) + (void) dmu_tx_hold_free_impl(txh, off, len); +} + +static void +dmu_tx_hold_zap_impl(dmu_tx_hold_t *txh, int add, const char *name) { + dmu_tx_t *tx = txh->txh_tx; + dnode_t *dn; int err; ASSERT(tx->tx_txg == 0); - dmu_tx_hold_t *txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, - object, THT_ZAP, add, (uintptr_t)name); - if (txh == NULL) - return; - dnode_t *dn = txh->txh_dnode; + dn = txh->txh_dnode; dmu_tx_count_dnode(txh); @@ -449,6 +495,32 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o } void +dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t object, int add, const char *name) +{ + dmu_tx_hold_t *txh; + + ASSERT0(tx->tx_txg); + + txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, + object, THT_ZAP, add, (uintptr_t)name); + if (txh != NULL) + dmu_tx_hold_zap_impl(txh, add, name); +} + +void +dmu_tx_hold_zap_by_dnode(dmu_tx_t *tx, dnode_t *dn, int add, const char *name) +{ + dmu_tx_hold_t *txh; + + ASSERT0(tx->tx_txg); + ASSERT(dn != NULL); + + txh = dmu_tx_hold_dnode_impl(tx, dn, THT_ZAP, add, (uintptr_t)name); + if (txh != NULL) + dmu_tx_hold_zap_impl(txh, add, name); +} + +void dmu_tx_hold_bonus(dmu_tx_t *tx, uint64_t object) { dmu_tx_hold_t *txh; @@ -462,6 +534,18 @@ dmu_tx_hold_bonus(dmu_tx_t *tx, uint64_t } void +dmu_tx_hold_bonus_by_dnode(dmu_tx_t *tx, dnode_t *dn) +{ + dmu_tx_hold_t *txh; + + ASSERT0(tx->tx_txg); + + txh = dmu_tx_hold_dnode_impl(tx, dn, THT_BONUS, 0, 0); + if (txh) + dmu_tx_count_dnode(txh); +} + +void dmu_tx_hold_space(dmu_tx_t *tx, uint64_t space) { dmu_tx_hold_t *txh; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Fri Apr 14 18:24:38 2017 (r316913) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Fri Apr 14 18:25:02 2017 (r316914) @@ -667,10 +667,17 @@ void dmu_buf_will_dirty(dmu_buf_t *db, d dmu_tx_t *dmu_tx_create(objset_t *os); void dmu_tx_hold_write(dmu_tx_t *tx, uint64_t object, uint64_t off, int len); +void dmu_tx_hold_write_by_dnode(dmu_tx_t *tx, dnode_t *dn, uint64_t off, + int len); void dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off, uint64_t len); +void dmu_tx_hold_free_by_dnode(dmu_tx_t *tx, dnode_t *dn, uint64_t off, + uint64_t len); void dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t object, int add, const char *name); +void dmu_tx_hold_zap_by_dnode(dmu_tx_t *tx, dnode_t *dn, int add, + const char *name); void dmu_tx_hold_bonus(dmu_tx_t *tx, uint64_t object); +void dmu_tx_hold_bonus_by_dnode(dmu_tx_t *tx, dnode_t *dn); void dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t object); void dmu_tx_hold_sa(dmu_tx_t *tx, struct sa_handle *hdl, boolean_t may_grow); void dmu_tx_hold_sa_create(dmu_tx_t *tx, int total_size); @@ -720,8 +727,12 @@ int dmu_free_long_object(objset_t *os, u #define DMU_READ_NO_PREFETCH 1 /* don't prefetch */ int dmu_read(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, void *buf, uint32_t flags); +int dmu_read_by_dnode(dnode_t *dn, uint64_t offset, uint64_t size, void *buf, + uint32_t flags); void dmu_write(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, const void *buf, dmu_tx_t *tx); +void dmu_write_by_dnode(dnode_t *dn, uint64_t offset, uint64_t size, + const void *buf, dmu_tx_t *tx); void dmu_prealloc(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, dmu_tx_t *tx); int dmu_read_uio(objset_t *os, uint64_t object, struct uio *uio, uint64_t size); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_tx.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_tx.h Fri Apr 14 18:24:38 2017 (r316913) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_tx.h Fri Apr 14 18:25:02 2017 (r316914) @@ -136,7 +136,7 @@ extern dmu_tx_t *dmu_tx_create_assigned( dmu_tx_t *dmu_tx_create_dd(dsl_dir_t *dd); int dmu_tx_is_syncing(dmu_tx_t *tx); int dmu_tx_private_ok(dmu_tx_t *tx); -void dmu_tx_add_new_object(dmu_tx_t *tx, objset_t *os, uint64_t object); +void dmu_tx_add_new_object(dmu_tx_t *tx, dnode_t *dn); void dmu_tx_dirty_buf(dmu_tx_t *tx, struct dmu_buf_impl *db); void dmu_tx_hold_space(dmu_tx_t *tx, uint64_t space); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h Fri Apr 14 18:24:38 2017 (r316913) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h Fri Apr 14 18:25:02 2017 (r316914) @@ -220,6 +220,9 @@ int zap_count_write_by_dnode(dnode_t *dn int zap_add(objset_t *ds, uint64_t zapobj, const char *key, int integer_size, uint64_t num_integers, const void *val, dmu_tx_t *tx); +int zap_add_by_dnode(dnode_t *dn, const char *key, + int integer_size, uint64_t num_integers, + const void *val, dmu_tx_t *tx); int zap_add_uint64(objset_t *ds, uint64_t zapobj, const uint64_t *key, int key_numints, int integer_size, uint64_t num_integers, const void *val, dmu_tx_t *tx); @@ -259,6 +262,7 @@ int zap_length_uint64(objset_t *os, uint int zap_remove(objset_t *ds, uint64_t zapobj, const char *name, dmu_tx_t *tx); int zap_remove_norm(objset_t *ds, uint64_t zapobj, const char *name, matchtype_t mt, dmu_tx_t *tx); +int zap_remove_by_dnode(dnode_t *dn, const char *name, dmu_tx_t *tx); int zap_remove_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key, int key_numints, dmu_tx_t *tx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Fri Apr 14 18:24:38 2017 (r316913) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Fri Apr 14 18:25:02 2017 (r316914) @@ -1109,34 +1109,30 @@ again: ASSERT(!"out of entries!"); } -int -zap_add(objset_t *os, uint64_t zapobj, const char *key, +static int +zap_add_impl(zap_t *zap, const char *key, int integer_size, uint64_t num_integers, - const void *val, dmu_tx_t *tx) + const void *val, dmu_tx_t *tx, void *tag) { - zap_t *zap; - int err; + int err = 0; mzap_ent_t *mze; const uint64_t *intval = val; zap_name_t *zn; - err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); - if (err) - return (err); zn = zap_name_alloc(zap, key, 0); if (zn == NULL) { - zap_unlockdir(zap, FTAG); + zap_unlockdir(zap, tag); return (SET_ERROR(ENOTSUP)); } if (!zap->zap_ismicro) { - err = fzap_add(zn, integer_size, num_integers, val, FTAG, tx); + err = fzap_add(zn, integer_size, num_integers, val, tag, tx); zap = zn->zn_zap; /* fzap_add() may change zap */ } else if (integer_size != 8 || num_integers != 1 || strlen(key) >= MZAP_NAME_LEN) { - err = mzap_upgrade(&zn->zn_zap, FTAG, tx, 0); + err = mzap_upgrade(&zn->zn_zap, tag, tx, 0); if (err == 0) { err = fzap_add(zn, integer_size, num_integers, val, - FTAG, tx); + tag, tx); } zap = zn->zn_zap; /* fzap_add() may change zap */ } else { @@ -1150,7 +1146,39 @@ zap_add(objset_t *os, uint64_t zapobj, c ASSERT(zap == zn->zn_zap); zap_name_free(zn); if (zap != NULL) /* may be NULL if fzap_add() failed */ - zap_unlockdir(zap, FTAG); + zap_unlockdir(zap, tag); + return (err); +} + +int +zap_add(objset_t *os, uint64_t zapobj, const char *key, + int integer_size, uint64_t num_integers, + const void *val, dmu_tx_t *tx) +{ + zap_t *zap; + int err; + + err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); + if (err != 0) + return (err); + err = zap_add_impl(zap, key, integer_size, num_integers, val, tx, FTAG); + /* zap_add_impl() calls zap_unlockdir() */ + return (err); +} + +int +zap_add_by_dnode(dnode_t *dn, const char *key, + int integer_size, uint64_t num_integers, + const void *val, dmu_tx_t *tx) +{ + zap_t *zap; + int err; + + err = zap_lockdir_by_dnode(dn, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap); + if (err != 0) + return (err); + err = zap_add_impl(zap, key, integer_size, num_integers, val, tx, FTAG); + /* zap_add_impl() calls zap_unlockdir() */ return (err); } @@ -1268,23 +1296,17 @@ zap_remove(objset_t *os, uint64_t zapobj return (zap_remove_norm(os, zapobj, name, 0, tx)); } -int -zap_remove_norm(objset_t *os, uint64_t zapobj, const char *name, +static int +zap_remove_impl(zap_t *zap, const char *name, matchtype_t mt, dmu_tx_t *tx) { - zap_t *zap; - int err; mzap_ent_t *mze; zap_name_t *zn; + int err = 0; - err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, FALSE, FTAG, &zap); - if (err) - return (err); zn = zap_name_alloc(zap, name, mt); - if (zn == NULL) { - zap_unlockdir(zap, FTAG); + if (zn == NULL) return (SET_ERROR(ENOTSUP)); - } if (!zap->zap_ismicro) { err = fzap_remove(zn, tx); } else { @@ -1299,6 +1321,34 @@ zap_remove_norm(objset_t *os, uint64_t z } } zap_name_free(zn); + return (err); +} + +int +zap_remove_norm(objset_t *os, uint64_t zapobj, const char *name, + matchtype_t mt, dmu_tx_t *tx) +{ + zap_t *zap; + int err; + + err = zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, FALSE, FTAG, &zap); + if (err) + return (err); + err = zap_remove_impl(zap, name, mt, tx); + zap_unlockdir(zap, FTAG); + return (err); +} + +int +zap_remove_by_dnode(dnode_t *dn, const char *name, dmu_tx_t *tx) +{ + zap_t *zap; + int err; + + err = zap_lockdir_by_dnode(dn, tx, RW_WRITER, TRUE, FALSE, FTAG, &zap); + if (err) + return (err); + err = zap_remove_impl(zap, name, 0, tx); zap_unlockdir(zap, FTAG); return (err); } From owner-svn-src-all@freebsd.org Fri Apr 14 18:25:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4554D3E1B8; Fri, 14 Apr 2017 18:25:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86A1FEFB; Fri, 14 Apr 2017 18:25:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIPMhs070758; Fri, 14 Apr 2017 18:25:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIPME6070757; Fri, 14 Apr 2017 18:25:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141825.v3EIPME6070757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316915 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:25:24 -0000 Author: avg Date: Fri Apr 14 18:25:22 2017 New Revision: 316915 URL: https://svnweb.freebsd.org/changeset/base/316915 Log: 7801 add more by-dnode routines (lint) illumos/illumos-gate@411be58a6e030a3b606f1afcc7f2e2459ffda844 https://github.com/illumos/illumos-gate/commit/411be58a6e030a3b606f1afcc7f2e2459ffda844 https://www.illumos.org/issues/7801 Add *_by_dnode() routines for accessing objects given their dnode_t *, this is more efficient than accessing the object by (objset_t *, uint64_t object). This change converts some but not all of the existing consumers. As performance-sensitive code paths are discovered they should be converted to use these routines. Ported from: https://github.com/zfsonlinux/zfs/commit/ 0eef1bde31d67091d3deed23fe2394f5a8bf2276 Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Fri Apr 14 18:25:02 2017 (r316914) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Fri Apr 14 18:25:22 2017 (r316915) @@ -336,7 +336,6 @@ dmu_tx_hold_free_impl(dmu_tx_hold_t *txh dmu_tx_t *tx; dnode_t *dn; int err; - zio_t *zio; tx = txh->txh_tx; ASSERT(tx->tx_txg == 0); @@ -443,7 +442,7 @@ dmu_tx_hold_free_by_dnode(dmu_tx_t *tx, } static void -dmu_tx_hold_zap_impl(dmu_tx_hold_t *txh, int add, const char *name) +dmu_tx_hold_zap_impl(dmu_tx_hold_t *txh, const char *name) { dmu_tx_t *tx = txh->txh_tx; dnode_t *dn; @@ -504,7 +503,7 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, object, THT_ZAP, add, (uintptr_t)name); if (txh != NULL) - dmu_tx_hold_zap_impl(txh, add, name); + dmu_tx_hold_zap_impl(txh, name); } void @@ -517,7 +516,7 @@ dmu_tx_hold_zap_by_dnode(dmu_tx_t *tx, d txh = dmu_tx_hold_dnode_impl(tx, dn, THT_ZAP, add, (uintptr_t)name); if (txh != NULL) - dmu_tx_hold_zap_impl(txh, add, name); + dmu_tx_hold_zap_impl(txh, name); } void From owner-svn-src-all@freebsd.org Fri Apr 14 18:25:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BCD5D3E249; Fri, 14 Apr 2017 18:25:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63AB8C0; Fri, 14 Apr 2017 18:25:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIPoSD070825; Fri, 14 Apr 2017 18:25:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIPo2v070820; Fri, 14 Apr 2017 18:25:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141825.v3EIPo2v070820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316916 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:25:51 -0000 Author: avg Date: Fri Apr 14 18:25:49 2017 New Revision: 316916 URL: https://svnweb.freebsd.org/changeset/base/316916 Log: 7970 zfs_arc_num_sublists_per_state should be common to all multilists illumos/illumos-gate@10fbdecb05f411234920f8d3c92c148d39106d7e https://github.com/illumos/illumos-gate/commit/10fbdecb05f411234920f8d3c92c148d39106d7e https://www.illumos.org/issues/7970 The global tunable zfs_arc_num_sublists_per_state is used by the ARC and the dbuf cache, and other users are planned. We should change this tunable to be common to all multilists. Reviewed by: Pavel Zakharov Reviewed by: Brad Lewis Reviewed by: Saso Kiselkov Reviewed by: Brian Behlendorf Approved by: Dan McDonald Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/multilist.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/multilist.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Fri Apr 14 18:25:22 2017 (r316915) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Fri Apr 14 18:25:49 2017 (r316916) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2016 by Delphix. All rights reserved. + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ @@ -296,13 +296,6 @@ uint_t arc_reduce_dnlc_percent = 3; */ int zfs_arc_evict_batch_limit = 10; -/* - * The number of sublists used for each of the arc state lists. If this - * is not set to a suitable value by the user, it will be configured to - * the number of CPUs on the system in arc_init(). - */ -int zfs_arc_num_sublists_per_state = 0; - /* number of seconds before growing cache again */ static int arc_grow_retry = 60; @@ -5775,43 +5768,43 @@ arc_state_init(void) multilist_create(&arc_mru->arcs_list[ARC_BUFC_METADATA], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), - zfs_arc_num_sublists_per_state, arc_state_multilist_index_func); + arc_state_multilist_index_func); multilist_create(&arc_mru->arcs_list[ARC_BUFC_DATA], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), - zfs_arc_num_sublists_per_state, arc_state_multilist_index_func); + arc_state_multilist_index_func); multilist_create(&arc_mru_ghost->arcs_list[ARC_BUFC_METADATA], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), - zfs_arc_num_sublists_per_state, arc_state_multilist_index_func); + arc_state_multilist_index_func); multilist_create(&arc_mru_ghost->arcs_list[ARC_BUFC_DATA], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), - zfs_arc_num_sublists_per_state, arc_state_multilist_index_func); + arc_state_multilist_index_func); multilist_create(&arc_mfu->arcs_list[ARC_BUFC_METADATA], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), - zfs_arc_num_sublists_per_state, arc_state_multilist_index_func); + arc_state_multilist_index_func); multilist_create(&arc_mfu->arcs_list[ARC_BUFC_DATA], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), - zfs_arc_num_sublists_per_state, arc_state_multilist_index_func); + arc_state_multilist_index_func); multilist_create(&arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), - zfs_arc_num_sublists_per_state, arc_state_multilist_index_func); + arc_state_multilist_index_func); multilist_create(&arc_mfu_ghost->arcs_list[ARC_BUFC_DATA], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), - zfs_arc_num_sublists_per_state, arc_state_multilist_index_func); + arc_state_multilist_index_func); multilist_create(&arc_l2c_only->arcs_list[ARC_BUFC_METADATA], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), - zfs_arc_num_sublists_per_state, arc_state_multilist_index_func); + arc_state_multilist_index_func); multilist_create(&arc_l2c_only->arcs_list[ARC_BUFC_DATA], sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), - zfs_arc_num_sublists_per_state, arc_state_multilist_index_func); + arc_state_multilist_index_func); refcount_create(&arc_anon->arcs_esize[ARC_BUFC_METADATA]); refcount_create(&arc_anon->arcs_esize[ARC_BUFC_DATA]); @@ -5969,9 +5962,6 @@ arc_init(void) if (zfs_arc_p_min_shift > 0) arc_p_min_shift = zfs_arc_p_min_shift; - if (zfs_arc_num_sublists_per_state < 1) - zfs_arc_num_sublists_per_state = MAX(boot_ncpus, 1); - /* if kmem_flags are set, lets try to use less memory */ if (kmem_debugging()) arc_c = arc_c / 2; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:25:22 2017 (r316915) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:25:49 2017 (r316916) @@ -623,7 +623,6 @@ retry: multilist_create(&dbuf_cache, sizeof (dmu_buf_impl_t), offsetof(dmu_buf_impl_t, db_cache_link), - zfs_arc_num_sublists_per_state, dbuf_cache_multilist_index_func); refcount_create(&dbuf_cache_size); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/multilist.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/multilist.c Fri Apr 14 18:25:22 2017 (r316915) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/multilist.c Fri Apr 14 18:25:49 2017 (r316916) @@ -13,7 +13,7 @@ * CDDL HEADER END */ /* - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2017 by Delphix. All rights reserved. */ #include @@ -23,6 +23,12 @@ #include /* + * This overrides the number of sublists in each multilist_t, which defaults + * to the number of CPUs in the system (see multilist_create()). + */ +int zfs_multilist_num_sublists = 0; + +/* * Given the object contained on the list, return a pointer to the * object's multilist_node_t structure it contains. */ @@ -59,9 +65,9 @@ multilist_d2l(multilist_t *ml, void *obj * requirement, but a general rule of thumb in order to garner the * best multi-threaded performance out of the data structure. */ -void -multilist_create(multilist_t *ml, size_t size, size_t offset, unsigned int num, - multilist_sublist_index_func_t *index_func) +static void +multilist_create_impl(multilist_t *ml, size_t size, size_t offset, + unsigned int num, multilist_sublist_index_func_t *index_func) { ASSERT3P(ml, !=, NULL); ASSERT3U(size, >, 0); @@ -86,6 +92,26 @@ multilist_create(multilist_t *ml, size_t } /* + * Initialize a new sublist, using the default number of sublists + * (the number of CPUs, or at least 4, or the tunable + * zfs_multilist_num_sublists). + */ +void +multilist_create(multilist_t *ml, size_t size, size_t offset, + multilist_sublist_index_func_t *index_func) +{ + int num_sublists; + + if (zfs_multilist_num_sublists > 0) { + num_sublists = zfs_multilist_num_sublists; + } else { + num_sublists = MAX(boot_ncpus, 4); + } + + multilist_create_impl(ml, size, offset, num_sublists, index_func); +} + +/* * Destroy the given multilist object, and free up any memory it holds. */ void Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Fri Apr 14 18:25:22 2017 (r316915) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Fri Apr 14 18:25:49 2017 (r316916) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -64,8 +64,6 @@ typedef void arc_done_func_t(zio_t *zio, arc_done_func_t arc_bcopy_func; arc_done_func_t arc_getbuf_func; -extern int zfs_arc_num_sublists_per_state; - typedef enum arc_flags { /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/multilist.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/multilist.h Fri Apr 14 18:25:22 2017 (r316915) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/multilist.h Fri Apr 14 18:25:49 2017 (r316916) @@ -13,7 +13,7 @@ * CDDL HEADER END */ /* - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2017 by Delphix. All rights reserved. */ #ifndef _SYS_MULTILIST_H @@ -73,7 +73,7 @@ struct multilist { }; void multilist_destroy(multilist_t *); -void multilist_create(multilist_t *, size_t, size_t, unsigned int, +void multilist_create(multilist_t *, size_t, size_t, multilist_sublist_index_func_t *); void multilist_insert(multilist_t *, void *); From owner-svn-src-all@freebsd.org Fri Apr 14 18:26:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17978D3E2BE; Fri, 14 Apr 2017 18:26:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD3201FF; Fri, 14 Apr 2017 18:26:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIQPfS070909; Fri, 14 Apr 2017 18:26:25 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIQOT8070893; Fri, 14 Apr 2017 18:26:24 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141826.v3EIQOT8070893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316917 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:26:27 -0000 Author: avg Date: Fri Apr 14 18:26:24 2017 New Revision: 316917 URL: https://svnweb.freebsd.org/changeset/base/316917 Log: 7968 multi-threaded spa_sync() illumos/illumos-gate@94c2d0eb22e9624151ee84a7edbf7178e1bf4087 https://github.com/illumos/illumos-gate/commit/94c2d0eb22e9624151ee84a7edbf7178e1bf4087 https://www.illumos.org/issues/7968 spa_sync() iterates over all the dirty dnodes and processes each of them by calling dnode_sync(). If there are many dirty dnodes (e.g. because we created or removed a lot of files), the single thread of spa_sync() calling dnode_sync () can become a bottleneck. Additionally, if many dnodes are dirtied concurrently in open context (e.g. due to concurrent file creation), the os_lock will experience lock contention via dnode_setdirty(). The solution is to track dirty dnodes on a multilist_t, and for spa_sync() to use separate threads to process each of the sublists in the multilist. On the concurrent file creation microbenchmark, the performance improvement from dnode_setdirty() is up to 7%. Additionally, the wall clock time spent in spa_sync() is reduced to 15%-40% of the single-threaded case. In terms of cost/ reward, once the other bottlenecks are addressed, fixing this bug will provide a medium-large performance gain and require a medium amount of effort to implement. Reviewed by: Pavel Zakharov Reviewed by: Brad Lewis Reviewed by: Saso Kiselkov Reviewed by: Brian Behlendorf Approved by: Dan McDonald Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/multilist.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/multilist.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Fri Apr 14 18:26:24 2017 (r316917) @@ -393,7 +393,7 @@ typedef struct arc_state { /* * list of evictable buffers */ - multilist_t arcs_list[ARC_BUFC_NUMTYPES]; + multilist_t *arcs_list[ARC_BUFC_NUMTYPES]; /* * total amount of evictable data in this state */ @@ -2070,7 +2070,7 @@ add_reference(arc_buf_hdr_t *hdr, void * (state != arc_anon)) { /* We don't use the L2-only state list. */ if (state != arc_l2c_only) { - multilist_remove(&state->arcs_list[arc_buf_type(hdr)], + multilist_remove(state->arcs_list[arc_buf_type(hdr)], hdr); arc_evictable_space_decrement(hdr, state); } @@ -2100,7 +2100,7 @@ remove_reference(arc_buf_hdr_t *hdr, kmu */ if (((cnt = refcount_remove(&hdr->b_l1hdr.b_refcnt, tag)) == 0) && (state != arc_anon)) { - multilist_insert(&state->arcs_list[arc_buf_type(hdr)], hdr); + multilist_insert(state->arcs_list[arc_buf_type(hdr)], hdr); ASSERT3U(hdr->b_l1hdr.b_bufcnt, >, 0); arc_evictable_space_increment(hdr, state); } @@ -2153,7 +2153,7 @@ arc_change_state(arc_state_t *new_state, if (refcnt == 0) { if (old_state != arc_anon && old_state != arc_l2c_only) { ASSERT(HDR_HAS_L1HDR(hdr)); - multilist_remove(&old_state->arcs_list[buftype], hdr); + multilist_remove(old_state->arcs_list[buftype], hdr); if (GHOST_STATE(old_state)) { ASSERT0(bufcnt); @@ -2171,7 +2171,7 @@ arc_change_state(arc_state_t *new_state, * beforehand. */ ASSERT(HDR_HAS_L1HDR(hdr)); - multilist_insert(&new_state->arcs_list[buftype], hdr); + multilist_insert(new_state->arcs_list[buftype], hdr); if (GHOST_STATE(new_state)) { ASSERT0(bufcnt); @@ -2297,8 +2297,8 @@ arc_change_state(arc_state_t *new_state, * L2 headers should never be on the L2 state list since they don't * have L1 headers allocated. */ - ASSERT(multilist_is_empty(&arc_l2c_only->arcs_list[ARC_BUFC_DATA]) && - multilist_is_empty(&arc_l2c_only->arcs_list[ARC_BUFC_METADATA])); + ASSERT(multilist_is_empty(arc_l2c_only->arcs_list[ARC_BUFC_DATA]) && + multilist_is_empty(arc_l2c_only->arcs_list[ARC_BUFC_METADATA])); } void @@ -3378,7 +3378,7 @@ arc_evict_state(arc_state_t *state, uint arc_buf_contents_t type) { uint64_t total_evicted = 0; - multilist_t *ml = &state->arcs_list[type]; + multilist_t *ml = state->arcs_list[type]; int num_sublists; arc_buf_hdr_t **markers; @@ -3582,8 +3582,8 @@ arc_adjust_meta(void) static arc_buf_contents_t arc_adjust_type(arc_state_t *state) { - multilist_t *data_ml = &state->arcs_list[ARC_BUFC_DATA]; - multilist_t *meta_ml = &state->arcs_list[ARC_BUFC_METADATA]; + multilist_t *data_ml = state->arcs_list[ARC_BUFC_DATA]; + multilist_t *meta_ml = state->arcs_list[ARC_BUFC_METADATA]; int data_idx = multilist_get_random_index(data_ml); int meta_idx = multilist_get_random_index(meta_ml); multilist_sublist_t *data_mls; @@ -5765,44 +5765,44 @@ arc_state_init(void) arc_mfu_ghost = &ARC_mfu_ghost; arc_l2c_only = &ARC_l2c_only; - multilist_create(&arc_mru->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), + arc_mru->arcs_list[ARC_BUFC_METADATA] = + multilist_create(sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), arc_state_multilist_index_func); - multilist_create(&arc_mru->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), + arc_mru->arcs_list[ARC_BUFC_DATA] = + multilist_create(sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), arc_state_multilist_index_func); - multilist_create(&arc_mru_ghost->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), + arc_mru_ghost->arcs_list[ARC_BUFC_METADATA] = + multilist_create(sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), arc_state_multilist_index_func); - multilist_create(&arc_mru_ghost->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), + arc_mru_ghost->arcs_list[ARC_BUFC_DATA] = + multilist_create(sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), arc_state_multilist_index_func); - multilist_create(&arc_mfu->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), + arc_mfu->arcs_list[ARC_BUFC_METADATA] = + multilist_create(sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), arc_state_multilist_index_func); - multilist_create(&arc_mfu->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), + arc_mfu->arcs_list[ARC_BUFC_DATA] = + multilist_create(sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), arc_state_multilist_index_func); - multilist_create(&arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), + arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA] = + multilist_create(sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), arc_state_multilist_index_func); - multilist_create(&arc_mfu_ghost->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), + arc_mfu_ghost->arcs_list[ARC_BUFC_DATA] = + multilist_create(sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), arc_state_multilist_index_func); - multilist_create(&arc_l2c_only->arcs_list[ARC_BUFC_METADATA], - sizeof (arc_buf_hdr_t), + arc_l2c_only->arcs_list[ARC_BUFC_METADATA] = + multilist_create(sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), arc_state_multilist_index_func); - multilist_create(&arc_l2c_only->arcs_list[ARC_BUFC_DATA], - sizeof (arc_buf_hdr_t), + arc_l2c_only->arcs_list[ARC_BUFC_DATA] = + multilist_create(sizeof (arc_buf_hdr_t), offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node), arc_state_multilist_index_func); @@ -5850,14 +5850,14 @@ arc_state_fini(void) refcount_destroy(&arc_mfu_ghost->arcs_size); refcount_destroy(&arc_l2c_only->arcs_size); - multilist_destroy(&arc_mru->arcs_list[ARC_BUFC_METADATA]); - multilist_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_METADATA]); - multilist_destroy(&arc_mfu->arcs_list[ARC_BUFC_METADATA]); - multilist_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA]); - multilist_destroy(&arc_mru->arcs_list[ARC_BUFC_DATA]); - multilist_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_DATA]); - multilist_destroy(&arc_mfu->arcs_list[ARC_BUFC_DATA]); - multilist_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_DATA]); + multilist_destroy(arc_mru->arcs_list[ARC_BUFC_METADATA]); + multilist_destroy(arc_mru_ghost->arcs_list[ARC_BUFC_METADATA]); + multilist_destroy(arc_mfu->arcs_list[ARC_BUFC_METADATA]); + multilist_destroy(arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA]); + multilist_destroy(arc_mru->arcs_list[ARC_BUFC_DATA]); + multilist_destroy(arc_mru_ghost->arcs_list[ARC_BUFC_DATA]); + multilist_destroy(arc_mfu->arcs_list[ARC_BUFC_DATA]); + multilist_destroy(arc_mfu_ghost->arcs_list[ARC_BUFC_DATA]); } uint64_t @@ -6546,16 +6546,16 @@ l2arc_sublist_lock(int list_num) switch (list_num) { case 0: - ml = &arc_mfu->arcs_list[ARC_BUFC_METADATA]; + ml = arc_mfu->arcs_list[ARC_BUFC_METADATA]; break; case 1: - ml = &arc_mru->arcs_list[ARC_BUFC_METADATA]; + ml = arc_mru->arcs_list[ARC_BUFC_METADATA]; break; case 2: - ml = &arc_mfu->arcs_list[ARC_BUFC_DATA]; + ml = arc_mfu->arcs_list[ARC_BUFC_DATA]; break; case 3: - ml = &arc_mru->arcs_list[ARC_BUFC_DATA]; + ml = arc_mru->arcs_list[ARC_BUFC_DATA]; break; } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:26:24 2017 (r316917) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -80,7 +80,7 @@ static boolean_t dbuf_evict_thread_exit; * Dbufs that are aged out of the cache will be immediately destroyed and * become eligible for arc eviction. */ -static multilist_t dbuf_cache; +static multilist_t *dbuf_cache; static refcount_t dbuf_cache_size; uint64_t dbuf_cache_max_bytes = 100 * 1024 * 1024; @@ -454,8 +454,8 @@ dbuf_cache_above_lowater(void) static void dbuf_evict_one(void) { - int idx = multilist_get_random_index(&dbuf_cache); - multilist_sublist_t *mls = multilist_sublist_lock(&dbuf_cache, idx); + int idx = multilist_get_random_index(dbuf_cache); + multilist_sublist_t *mls = multilist_sublist_lock(dbuf_cache, idx); ASSERT(!MUTEX_HELD(&dbuf_evict_lock)); @@ -621,7 +621,7 @@ retry: */ dbu_evict_taskq = taskq_create("dbu_evict", 1, minclsyspri, 0, 0, 0); - multilist_create(&dbuf_cache, sizeof (dmu_buf_impl_t), + dbuf_cache = multilist_create(sizeof (dmu_buf_impl_t), offsetof(dmu_buf_impl_t, db_cache_link), dbuf_cache_multilist_index_func); refcount_create(&dbuf_cache_size); @@ -659,7 +659,7 @@ dbuf_fini(void) cv_destroy(&dbuf_evict_cv); refcount_destroy(&dbuf_cache_size); - multilist_destroy(&dbuf_cache); + multilist_destroy(dbuf_cache); } /* @@ -2029,7 +2029,7 @@ dbuf_destroy(dmu_buf_impl_t *db) dbuf_clear_data(db); if (multilist_link_active(&db->db_cache_link)) { - multilist_remove(&dbuf_cache, db); + multilist_remove(dbuf_cache, db); (void) refcount_remove_many(&dbuf_cache_size, db->db.db_size, db); } @@ -2577,7 +2577,7 @@ top: if (multilist_link_active(&db->db_cache_link)) { ASSERT(refcount_is_zero(&db->db_holds)); - multilist_remove(&dbuf_cache, db); + multilist_remove(dbuf_cache, db); (void) refcount_remove_many(&dbuf_cache_size, db->db.db_size, db); } @@ -2796,7 +2796,7 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, db->db_pending_evict) { dbuf_destroy(db); } else if (!multilist_link_active(&db->db_cache_link)) { - multilist_insert(&dbuf_cache, db); + multilist_insert(dbuf_cache, db); (void) refcount_add_many(&dbuf_cache_size, db->db.db_size, db); mutex_exit(&db->db_mtx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Fri Apr 14 18:26:24 2017 (r316917) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -303,6 +303,42 @@ dmu_objset_byteswap(void *buf, size_t si } } +/* + * The hash is a CRC-based hash of the objset_t pointer and the object number. + */ +static uint64_t +dnode_hash(const objset_t *os, uint64_t obj) +{ + uintptr_t osv = (uintptr_t)os; + uint64_t crc = -1ULL; + + ASSERT(zfs_crc64_table[128] == ZFS_CRC64_POLY); + /* + * The low 6 bits of the pointer don't have much entropy, because + * the objset_t is larger than 2^6 bytes long. + */ + crc = (crc >> 8) ^ zfs_crc64_table[(crc ^ (osv >> 6)) & 0xFF]; + crc = (crc >> 8) ^ zfs_crc64_table[(crc ^ (obj >> 0)) & 0xFF]; + crc = (crc >> 8) ^ zfs_crc64_table[(crc ^ (obj >> 8)) & 0xFF]; + crc = (crc >> 8) ^ zfs_crc64_table[(crc ^ (obj >> 16)) & 0xFF]; + + crc ^= (osv>>14) ^ (obj>>24); + + return (crc); +} + +unsigned int +dnode_multilist_index_func(multilist_t *ml, void *obj) +{ + dnode_t *dn = obj; + return (dnode_hash(dn->dn_objset, dn->dn_object) % + multilist_get_num_sublists(ml)); +} + +/* + * Instantiates the objset_t in-memory structure corresponding to the + * objset_phys_t that's pointed to by the specified blkptr_t. + */ int dmu_objset_open_impl(spa_t *spa, dsl_dataset_t *ds, blkptr_t *bp, objset_t **osp) @@ -454,10 +490,9 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat os->os_zil = zil_alloc(os, &os->os_zil_header); for (i = 0; i < TXG_SIZE; i++) { - list_create(&os->os_dirty_dnodes[i], sizeof (dnode_t), - offsetof(dnode_t, dn_dirty_link[i])); - list_create(&os->os_free_dnodes[i], sizeof (dnode_t), - offsetof(dnode_t, dn_dirty_link[i])); + os->os_dirty_dnodes[i] = multilist_create(sizeof (dnode_t), + offsetof(dnode_t, dn_dirty_link[i]), + dnode_multilist_index_func); } list_create(&os->os_dnodes, sizeof (dnode_t), offsetof(dnode_t, dn_link)); @@ -465,6 +500,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat offsetof(dmu_buf_impl_t, db_link)); mutex_init(&os->os_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&os->os_userused_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&os->os_obj_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&os->os_user_ptr_lock, NULL, MUTEX_DEFAULT, NULL); @@ -748,8 +784,12 @@ dmu_objset_evict_done(objset_t *os) rw_exit(&os_lock); mutex_destroy(&os->os_lock); + mutex_destroy(&os->os_userused_lock); mutex_destroy(&os->os_obj_lock); mutex_destroy(&os->os_user_ptr_lock); + for (int i = 0; i < TXG_SIZE; i++) { + multilist_destroy(os->os_dirty_dnodes[i]); + } spa_evicting_os_deregister(os->os_spa, os); kmem_free(os, sizeof (objset_t)); } @@ -1027,11 +1067,11 @@ dmu_objset_snapshot_one(const char *fsna } static void -dmu_objset_sync_dnodes(list_t *list, list_t *newlist, dmu_tx_t *tx) +dmu_objset_sync_dnodes(multilist_sublist_t *list, dmu_tx_t *tx) { dnode_t *dn; - while (dn = list_head(list)) { + while ((dn = multilist_sublist_head(list)) != NULL) { ASSERT(dn->dn_object != DMU_META_DNODE_OBJECT); ASSERT(dn->dn_dbuf->db_data_pending); /* @@ -1042,11 +1082,12 @@ dmu_objset_sync_dnodes(list_t *list, lis ASSERT(dn->dn_zio); ASSERT3U(dn->dn_nlevels, <=, DN_MAX_LEVELS); - list_remove(list, dn); + multilist_sublist_remove(list, dn); - if (newlist) { + multilist_t *newlist = dn->dn_objset->os_synced_dnodes; + if (newlist != NULL) { (void) dnode_add_ref(dn, newlist); - list_insert_tail(newlist, dn); + multilist_insert(newlist, dn); } dnode_sync(dn, tx); @@ -1101,6 +1142,29 @@ dmu_objset_write_done(zio_t *zio, arc_bu kmem_free(bp, sizeof (*bp)); } +typedef struct sync_dnodes_arg { + multilist_t *sda_list; + int sda_sublist_idx; + multilist_t *sda_newlist; + dmu_tx_t *sda_tx; +} sync_dnodes_arg_t; + +static void +sync_dnodes_task(void *arg) +{ + sync_dnodes_arg_t *sda = arg; + + multilist_sublist_t *ms = + multilist_sublist_lock(sda->sda_list, sda->sda_sublist_idx); + + dmu_objset_sync_dnodes(ms, sda->sda_tx); + + multilist_sublist_unlock(ms); + + kmem_free(sda, sizeof (*sda)); +} + + /* called from dsl */ void dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx) @@ -1110,7 +1174,6 @@ dmu_objset_sync(objset_t *os, zio_t *pio zio_prop_t zp; zio_t *zio; list_t *list; - list_t *newlist = NULL; dbuf_dirty_record_t *dr; blkptr_t *blkptr_copy = kmem_alloc(sizeof (*os->os_rootbp), KM_SLEEP); *blkptr_copy = *os->os_rootbp; @@ -1164,20 +1227,36 @@ dmu_objset_sync(objset_t *os, zio_t *pio txgoff = tx->tx_txg & TXG_MASK; if (dmu_objset_userused_enabled(os)) { - newlist = &os->os_synced_dnodes; /* * We must create the list here because it uses the - * dn_dirty_link[] of this txg. + * dn_dirty_link[] of this txg. But it may already + * exist because we call dsl_dataset_sync() twice per txg. */ - list_create(newlist, sizeof (dnode_t), - offsetof(dnode_t, dn_dirty_link[txgoff])); + if (os->os_synced_dnodes == NULL) { + os->os_synced_dnodes = + multilist_create(sizeof (dnode_t), + offsetof(dnode_t, dn_dirty_link[txgoff]), + dnode_multilist_index_func); + } else { + ASSERT3U(os->os_synced_dnodes->ml_offset, ==, + offsetof(dnode_t, dn_dirty_link[txgoff])); + } } - dmu_objset_sync_dnodes(&os->os_free_dnodes[txgoff], newlist, tx); - dmu_objset_sync_dnodes(&os->os_dirty_dnodes[txgoff], newlist, tx); + for (int i = 0; + i < multilist_get_num_sublists(os->os_dirty_dnodes[txgoff]); i++) { + sync_dnodes_arg_t *sda = kmem_alloc(sizeof (*sda), KM_SLEEP); + sda->sda_list = os->os_dirty_dnodes[txgoff]; + sda->sda_sublist_idx = i; + sda->sda_tx = tx; + (void) taskq_dispatch(dmu_objset_pool(os)->dp_sync_taskq, + sync_dnodes_task, sda, 0); + /* callback frees sda */ + } + taskq_wait(dmu_objset_pool(os)->dp_sync_taskq); list = &DMU_META_DNODE(os)->dn_dirty_records[txgoff]; - while (dr = list_head(list)) { + while ((dr = list_head(list)) != NULL) { ASSERT0(dr->dr_dbuf->db_level); list_remove(list, dr); if (dr->dr_zio) @@ -1201,8 +1280,7 @@ dmu_objset_sync(objset_t *os, zio_t *pio boolean_t dmu_objset_is_dirty(objset_t *os, uint64_t txg) { - return (!list_is_empty(&os->os_dirty_dnodes[txg & TXG_MASK]) || - !list_is_empty(&os->os_free_dnodes[txg & TXG_MASK])); + return (!multilist_is_empty(os->os_dirty_dnodes[txg & TXG_MASK])); } static objset_used_cb_t *used_cbs[DMU_OST_NUMTYPES]; @@ -1256,8 +1334,15 @@ do_userquota_cacheflush(objset_t *os, us cookie = NULL; while ((uqn = avl_destroy_nodes(&cache->uqc_user_deltas, &cookie)) != NULL) { + /* + * os_userused_lock protects against concurrent calls to + * zap_increment_int(). It's needed because zap_increment_int() + * is not thread-safe (i.e. not atomic). + */ + mutex_enter(&os->os_userused_lock); VERIFY0(zap_increment_int(os, DMU_USERUSED_OBJECT, uqn->uqn_id, uqn->uqn_delta, tx)); + mutex_exit(&os->os_userused_lock); kmem_free(uqn, sizeof (*uqn)); } avl_destroy(&cache->uqc_user_deltas); @@ -1265,8 +1350,10 @@ do_userquota_cacheflush(objset_t *os, us cookie = NULL; while ((uqn = avl_destroy_nodes(&cache->uqc_group_deltas, &cookie)) != NULL) { + mutex_enter(&os->os_userused_lock); VERIFY0(zap_increment_int(os, DMU_GROUPUSED_OBJECT, uqn->uqn_id, uqn->uqn_delta, tx)); + mutex_exit(&os->os_userused_lock); kmem_free(uqn, sizeof (*uqn)); } avl_destroy(&cache->uqc_group_deltas); @@ -1301,37 +1388,38 @@ do_userquota_update(userquota_cache_t *c } } -void -dmu_objset_do_userquota_updates(objset_t *os, dmu_tx_t *tx) +typedef struct userquota_updates_arg { + objset_t *uua_os; + int uua_sublist_idx; + dmu_tx_t *uua_tx; +} userquota_updates_arg_t; + +static void +userquota_updates_task(void *arg) { + userquota_updates_arg_t *uua = arg; + objset_t *os = uua->uua_os; + dmu_tx_t *tx = uua->uua_tx; dnode_t *dn; - list_t *list = &os->os_synced_dnodes; userquota_cache_t cache = { 0 }; - ASSERT(list_head(list) == NULL || dmu_objset_userused_enabled(os)); + multilist_sublist_t *list = + multilist_sublist_lock(os->os_synced_dnodes, uua->uua_sublist_idx); + ASSERT(multilist_sublist_head(list) == NULL || + dmu_objset_userused_enabled(os)); avl_create(&cache.uqc_user_deltas, userquota_compare, sizeof (userquota_node_t), offsetof(userquota_node_t, uqn_node)); avl_create(&cache.uqc_group_deltas, userquota_compare, sizeof (userquota_node_t), offsetof(userquota_node_t, uqn_node)); - while (dn = list_head(list)) { + while ((dn = multilist_sublist_head(list)) != NULL) { int flags; ASSERT(!DMU_OBJECT_IS_SPECIAL(dn->dn_object)); ASSERT(dn->dn_phys->dn_type == DMU_OT_NONE || dn->dn_phys->dn_flags & DNODE_FLAG_USERUSED_ACCOUNTED); - /* Allocate the user/groupused objects if necessary. */ - if (DMU_USERUSED_DNODE(os)->dn_type == DMU_OT_NONE) { - VERIFY0(zap_create_claim(os, - DMU_USERUSED_OBJECT, - DMU_OT_USERGROUP_USED, DMU_OT_NONE, 0, tx)); - VERIFY0(zap_create_claim(os, - DMU_GROUPUSED_OBJECT, - DMU_OT_USERGROUP_USED, DMU_OT_NONE, 0, tx)); - } - flags = dn->dn_id_flags; ASSERT(flags); if (flags & DN_ID_OLD_EXIST) { @@ -1361,10 +1449,42 @@ dmu_objset_do_userquota_updates(objset_t dn->dn_id_flags &= ~(DN_ID_NEW_EXIST); mutex_exit(&dn->dn_mtx); - list_remove(list, dn); - dnode_rele(dn, list); + multilist_sublist_remove(list, dn); + dnode_rele(dn, os->os_synced_dnodes); } do_userquota_cacheflush(os, &cache, tx); + multilist_sublist_unlock(list); + kmem_free(uua, sizeof (*uua)); +} + +void +dmu_objset_do_userquota_updates(objset_t *os, dmu_tx_t *tx) +{ + if (!dmu_objset_userused_enabled(os)) + return; + + /* Allocate the user/groupused objects if necessary. */ + if (DMU_USERUSED_DNODE(os)->dn_type == DMU_OT_NONE) { + VERIFY0(zap_create_claim(os, + DMU_USERUSED_OBJECT, + DMU_OT_USERGROUP_USED, DMU_OT_NONE, 0, tx)); + VERIFY0(zap_create_claim(os, + DMU_GROUPUSED_OBJECT, + DMU_OT_USERGROUP_USED, DMU_OT_NONE, 0, tx)); + } + + for (int i = 0; + i < multilist_get_num_sublists(os->os_synced_dnodes); i++) { + userquota_updates_arg_t *uua = + kmem_alloc(sizeof (*uua), KM_SLEEP); + uua->uua_os = os; + uua->uua_sublist_idx = i; + uua->uua_tx = tx; + /* note: caller does taskq_wait() */ + (void) taskq_dispatch(dmu_objset_pool(os)->dp_sync_taskq, + userquota_updates_task, uua, 0); + /* callback frees uua */ + } } /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Fri Apr 14 18:26:24 2017 (r316917) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -1282,13 +1282,14 @@ dnode_setdirty(dnode_t *dn, dmu_tx_t *tx */ dmu_objset_userquota_get_ids(dn, B_TRUE, tx); - mutex_enter(&os->os_lock); + multilist_t *dirtylist = os->os_dirty_dnodes[txg & TXG_MASK]; + multilist_sublist_t *mls = multilist_sublist_lock_obj(dirtylist, dn); /* * If we are already marked dirty, we're done. */ if (list_link_active(&dn->dn_dirty_link[txg & TXG_MASK])) { - mutex_exit(&os->os_lock); + multilist_sublist_unlock(mls); return; } @@ -1302,13 +1303,9 @@ dnode_setdirty(dnode_t *dn, dmu_tx_t *tx dprintf_ds(os->os_dsl_dataset, "obj=%llu txg=%llu\n", dn->dn_object, txg); - if (dn->dn_free_txg > 0 && dn->dn_free_txg <= txg) { - list_insert_tail(&os->os_free_dnodes[txg&TXG_MASK], dn); - } else { - list_insert_tail(&os->os_dirty_dnodes[txg&TXG_MASK], dn); - } + multilist_sublist_insert_head(mls, dn); - mutex_exit(&os->os_lock); + multilist_sublist_unlock(mls); /* * The dnode maintains a hold on its containing dbuf as @@ -1329,13 +1326,6 @@ dnode_setdirty(dnode_t *dn, dmu_tx_t *tx void dnode_free(dnode_t *dn, dmu_tx_t *tx) { - int txgoff = tx->tx_txg & TXG_MASK; - - dprintf("dn=%p txg=%llu\n", dn, tx->tx_txg); - - /* we should be the only holder... hopefully */ - /* ASSERT3U(refcount_count(&dn->dn_holds), ==, 1); */ - mutex_enter(&dn->dn_mtx); if (dn->dn_type == DMU_OT_NONE || dn->dn_free_txg) { mutex_exit(&dn->dn_mtx); @@ -1344,19 +1334,7 @@ dnode_free(dnode_t *dn, dmu_tx_t *tx) dn->dn_free_txg = tx->tx_txg; mutex_exit(&dn->dn_mtx); - /* - * If the dnode is already dirty, it needs to be moved from - * the dirty list to the free list. - */ - mutex_enter(&dn->dn_objset->os_lock); - if (list_link_active(&dn->dn_dirty_link[txgoff])) { - list_remove(&dn->dn_objset->os_dirty_dnodes[txgoff], dn); - list_insert_tail(&dn->dn_objset->os_free_dnodes[txgoff], dn); - mutex_exit(&dn->dn_objset->os_lock); - } else { - mutex_exit(&dn->dn_objset->os_lock); - dnode_setdirty(dn, tx); - } + dnode_setdirty(dn, tx); } /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Fri Apr 14 18:26:24 2017 (r316917) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Fri Apr 14 18:26:24 2017 (r316917) @@ -1674,6 +1674,11 @@ dsl_dataset_sync_done(dsl_dataset_t *ds, bplist_iterate(&ds->ds_pending_deadlist, deadlist_enqueue_cb, &ds->ds_deadlist, tx); + if (os->os_synced_dnodes != NULL) { + multilist_destroy(os->os_synced_dnodes); + os->os_synced_dnodes = NULL; + } + ASSERT(!dmu_objset_is_dirty(os, dmu_tx_get_txg(tx))); dmu_buf_rele(ds->ds_dbuf, ds); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Fri Apr 14 18:26:24 2017 (r316917) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2016 by Delphix. All rights reserved. + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -127,6 +127,10 @@ int zfs_delay_min_dirty_percent = 60; */ uint64_t zfs_delay_scale = 1000 * 1000 * 1000 / 2000; +/* + * This determines the number of threads used by the dp_sync_taskq. + */ +int zfs_sync_taskq_batch_pct = 75; hrtime_t zfs_throttle_delay = MSEC2NSEC(10); hrtime_t zfs_throttle_resolution = MSEC2NSEC(10); @@ -167,6 +171,10 @@ dsl_pool_open_impl(spa_t *spa, uint64_t txg_list_create(&dp->dp_sync_tasks, offsetof(dsl_sync_task_t, dst_node)); + dp->dp_sync_taskq = taskq_create("dp_sync_taskq", + zfs_sync_taskq_batch_pct, minclsyspri, 1, INT_MAX, + TASKQ_THREADS_CPU_PCT); + mutex_init(&dp->dp_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&dp->dp_spaceavail_cv, NULL, CV_DEFAULT, NULL); @@ -317,6 +325,8 @@ dsl_pool_close(dsl_pool_t *dp) txg_list_destroy(&dp->dp_sync_tasks); txg_list_destroy(&dp->dp_dirty_dirs); + taskq_destroy(dp->dp_sync_taskq); + /* * We can't set retry to TRUE since we're explicitly specifying * a spa to flush. This is good enough; any missed buffers for @@ -505,12 +515,15 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t /* * After the data blocks have been written (ensured by the zio_wait() - * above), update the user/group space accounting. + * above), update the user/group space accounting. This happens + * in tasks dispatched to dp_sync_taskq, so wait for them before + * continuing. */ for (ds = list_head(&synced_datasets); ds != NULL; ds = list_next(&synced_datasets, ds)) { dmu_objset_do_userquota_updates(ds->ds_objset, tx); } + taskq_wait(dp->dp_sync_taskq); /* * Sync the datasets again to push out the changes due to @@ -557,8 +570,7 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t dp->dp_mos_uncompressed_delta = 0; } - if (list_head(&mos->os_dirty_dnodes[txg & TXG_MASK]) != NULL || - list_head(&mos->os_free_dnodes[txg & TXG_MASK]) != NULL) { + if (!multilist_is_empty(mos->os_dirty_dnodes[txg & TXG_MASK])) { dsl_pool_sync_mos(dp, tx); } @@ -616,7 +628,8 @@ int dsl_pool_sync_context(dsl_pool_t *dp) { return (curthread == dp->dp_tx.tx_sync_thread || - spa_is_initializing(dp->dp_spa)); + spa_is_initializing(dp->dp_spa) || + taskq_member(dp->dp_sync_taskq, curthread)); } uint64_t Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/multilist.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/multilist.c Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/multilist.c Fri Apr 14 18:26:24 2017 (r316917) @@ -65,16 +65,16 @@ multilist_d2l(multilist_t *ml, void *obj * requirement, but a general rule of thumb in order to garner the * best multi-threaded performance out of the data structure. */ -static void -multilist_create_impl(multilist_t *ml, size_t size, size_t offset, +static multilist_t * +multilist_create_impl(size_t size, size_t offset, unsigned int num, multilist_sublist_index_func_t *index_func) { - ASSERT3P(ml, !=, NULL); ASSERT3U(size, >, 0); ASSERT3U(size, >=, offset + sizeof (multilist_node_t)); ASSERT3U(num, >, 0); ASSERT3P(index_func, !=, NULL); + multilist_t *ml = kmem_alloc(sizeof (*ml), KM_SLEEP); ml->ml_offset = offset; ml->ml_num_sublists = num; ml->ml_index_func = index_func; @@ -89,15 +89,16 @@ multilist_create_impl(multilist_t *ml, s mutex_init(&mls->mls_lock, NULL, MUTEX_DEFAULT, NULL); list_create(&mls->mls_list, size, offset); } + return (ml); } /* - * Initialize a new sublist, using the default number of sublists + * Allocate a new multilist, using the default number of sublists * (the number of CPUs, or at least 4, or the tunable * zfs_multilist_num_sublists). */ -void -multilist_create(multilist_t *ml, size_t size, size_t offset, +multilist_t * +multilist_create(size_t size, size_t offset, multilist_sublist_index_func_t *index_func) { int num_sublists; @@ -108,7 +109,7 @@ multilist_create(multilist_t *ml, size_t num_sublists = MAX(boot_ncpus, 4); } - multilist_create_impl(ml, size, offset, num_sublists, index_func); + return (multilist_create_impl(size, offset, num_sublists, index_func)); } /* @@ -134,6 +135,7 @@ multilist_destroy(multilist_t *ml) ml->ml_num_sublists = 0; ml->ml_offset = 0; + kmem_free(ml, sizeof (multilist_t)); } /* @@ -285,6 +287,13 @@ multilist_sublist_lock(multilist_t *ml, return (mls); } +/* Lock and return the sublist that would be used to store the specified obj */ +multilist_sublist_t * +multilist_sublist_lock_obj(multilist_t *ml, void *obj) +{ + return (multilist_sublist_lock(ml, ml->ml_index_func(ml, obj))); +} + void multilist_sublist_unlock(multilist_sublist_t *mls) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Fri Apr 14 18:26:24 2017 (r316917) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. @@ -620,7 +620,7 @@ spa_add(const char *name, nvlist_t *conf spa_active_count++; } - avl_create(&spa->spa_alloc_tree, zio_timestamp_compare, + avl_create(&spa->spa_alloc_tree, zio_bookmark_compare, sizeof (zio_t), offsetof(zio_t, io_alloc_node)); /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Fri Apr 14 18:26:24 2017 (r316917) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -110,7 +110,7 @@ struct objset { /* no lock needed: */ struct dmu_tx *os_synctx; /* XXX sketchy */ zil_header_t os_zil_header; - list_t os_synced_dnodes; + multilist_t *os_synced_dnodes; uint64_t os_flags; uint64_t os_freed_dnodes; boolean_t os_rescan_dnodes; @@ -121,11 +121,13 @@ struct objset { /* Protected by os_lock */ kmutex_t os_lock; - list_t os_dirty_dnodes[TXG_SIZE]; - list_t os_free_dnodes[TXG_SIZE]; + multilist_t *os_dirty_dnodes[TXG_SIZE]; list_t os_dnodes; list_t os_downgraded_dbufs; + /* Protects changes to DMU_{USER,GROUP}USED_OBJECT */ + kmutex_t os_userused_lock; + /* stuff we store for the user */ kmutex_t os_user_ptr_lock; void *os_user_ptr; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Fri Apr 14 18:26:24 2017 (r316917) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -203,7 +204,7 @@ struct dnode { uint32_t dn_dbufs_count; /* count of dn_dbufs */ /* protected by os_lock: */ - list_node_t dn_dirty_link[TXG_SIZE]; /* next on dataset's dirty */ + multilist_node_t dn_dirty_link[TXG_SIZE]; /* next on dataset's dirty */ /* protected by dn_mtx: */ kmutex_t dn_mtx; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Fri Apr 14 18:26:24 2017 (r316917) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2017 by Delphix. All rights reserved. * Copyright 2016 Nexenta Systems, Inc. All rights reserved. */ @@ -121,6 +121,7 @@ typedef struct dsl_pool { txg_list_t dp_dirty_zilogs; txg_list_t dp_dirty_dirs; txg_list_t dp_sync_tasks; + taskq_t *dp_sync_taskq; /* * Protects administrative changes (properties, namespace) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/multilist.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/multilist.h Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/multilist.h Fri Apr 14 18:26:24 2017 (r316917) @@ -73,8 +73,7 @@ struct multilist { }; void multilist_destroy(multilist_t *); -void multilist_create(multilist_t *, size_t, size_t, - multilist_sublist_index_func_t *); +multilist_t *multilist_create(size_t, size_t, multilist_sublist_index_func_t *); void multilist_insert(multilist_t *, void *); void multilist_remove(multilist_t *, void *); @@ -84,6 +83,7 @@ unsigned int multilist_get_num_sublists( unsigned int multilist_get_random_index(multilist_t *); multilist_sublist_t *multilist_sublist_lock(multilist_t *, unsigned int); +multilist_sublist_t *multilist_sublist_lock_obj(multilist_t *, void *); void multilist_sublist_unlock(multilist_sublist_t *); void multilist_sublist_insert_head(multilist_sublist_t *, void *); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Fri Apr 14 18:25:49 2017 (r316916) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Fri Apr 14 18:26:24 2017 (r316917) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright 2016 Toomas Soome @@ -455,7 +455,7 @@ struct zio { taskq_ent_t io_tqent; }; -extern int zio_timestamp_compare(const void *, const void *); +extern int zio_bookmark_compare(const void *, const void *); extern zio_t *zio_null(zio_t *pio, spa_t *spa, vdev_t *vd, zio_done_func_t *done, void *private, enum zio_flag flags); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Apr 14 18:25:49 2017 (r316916) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 14 18:27:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9266FD3E333; Fri, 14 Apr 2017 18:27:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61CD9382; Fri, 14 Apr 2017 18:27:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIRC3V070989; Fri, 14 Apr 2017 18:27:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIRCbD070988; Fri, 14 Apr 2017 18:27:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141827.v3EIRCbD070988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316918 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:27:13 -0000 Author: avg Date: Fri Apr 14 18:27:12 2017 New Revision: 316918 URL: https://svnweb.freebsd.org/changeset/base/316918 Log: 7990 libzfs: snapspec_cb() does not need to call zfs_strdup() illumos/illumos-gate@d8584ba6fb7a5e46da1725845b99ae5fab5a4baf https://github.com/illumos/illumos-gate/commit/d8584ba6fb7a5e46da1725845b99ae5fab5a4baf https://www.illumos.org/issues/7990 The snapspec_cb() callback function in libzfs does not need to call zfs_strdup(). Reviewed by: Yuri Pankov Reviewed by: Toomas Soome Approved by: Matthew Ahrens Author: Marcel Telka Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c Fri Apr 14 18:26:24 2017 (r316917) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c Fri Apr 14 18:27:12 2017 (r316918) @@ -317,16 +317,17 @@ static int snapspec_cb(zfs_handle_t *zhp, void *arg) { snapspec_arg_t *ssa = arg; - char *shortsnapname; + const char *shortsnapname; int err = 0; if (ssa->ssa_seenlast) return (0); - shortsnapname = zfs_strdup(zhp->zfs_hdl, - strchr(zfs_get_name(zhp), '@') + 1); + shortsnapname = strchr(zfs_get_name(zhp), '@') + 1; if (!ssa->ssa_seenfirst && strcmp(shortsnapname, ssa->ssa_first) == 0) ssa->ssa_seenfirst = B_TRUE; + if (strcmp(shortsnapname, ssa->ssa_last) == 0) + ssa->ssa_seenlast = B_TRUE; if (ssa->ssa_seenfirst) { err = ssa->ssa_func(zhp, ssa->ssa_arg); @@ -334,10 +335,6 @@ snapspec_cb(zfs_handle_t *zhp, void *arg zfs_close(zhp); } - if (strcmp(shortsnapname, ssa->ssa_last) == 0) - ssa->ssa_seenlast = B_TRUE; - free(shortsnapname); - return (err); } From owner-svn-src-all@freebsd.org Fri Apr 14 18:28:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4A86D3E3A5; Fri, 14 Apr 2017 18:28:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 664C26DB; Fri, 14 Apr 2017 18:28:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EISedQ071088; Fri, 14 Apr 2017 18:28:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EISePq071087; Fri, 14 Apr 2017 18:28:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141828.v3EISePq071087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316919 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:28:41 -0000 Author: avg Date: Fri Apr 14 18:28:40 2017 New Revision: 316919 URL: https://svnweb.freebsd.org/changeset/base/316919 Log: 7885 zpool list can report 16.0e for expandsz illumos/illumos-gate@c040c10cdd1e4eab0fc88203758367dd81e057b7 https://github.com/illumos/illumos-gate/commit/c040c10cdd1e4eab0fc88203758367dd81e057b7 https://www.illumos.org/issues/7885 When a member of a RAIDZ has been replaced with a device smaller than the original, then the top level vdev can report its expand size as 16.0E. The reduced child asize causes the RAIDZ to have a vdev_asize lower than its vdev_max_asize which then results in an underflow during the calculation of the parents expand size. Also for RAIDZ vdevs the sum of their child vdev_min_asize could be smaller than the parents vdev_min_size. Fixed by: https://github.com/openzfs/openzfs/pull/296 Reviewed by: Matthew Ahrens Reviewed by: George Wilson Approved by: Gordon Ross Author: Steven Hartland Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Fri Apr 14 18:27:12 2017 (r316918) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Fri Apr 14 18:28:40 2017 (r316919) @@ -135,7 +135,8 @@ vdev_get_min_asize(vdev_t *vd) * so each child must provide at least 1/Nth of its asize. */ if (pvd->vdev_ops == &vdev_raidz_ops) - return (pvd->vdev_min_asize / pvd->vdev_children); + return ((pvd->vdev_min_asize + pvd->vdev_children - 1) / + pvd->vdev_children); return (pvd->vdev_min_asize); } @@ -1273,7 +1274,7 @@ vdev_open(vdev_t *vd) vd->vdev_psize = psize; /* - * Make sure the allocatable size hasn't shrunk. + * Make sure the allocatable size hasn't shrunk too much. */ if (asize < vd->vdev_min_asize) { vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, @@ -1306,12 +1307,21 @@ vdev_open(vdev_t *vd) } /* - * If all children are healthy and the asize has increased, - * then we've experienced dynamic LUN growth. If automatic - * expansion is enabled then use the additional space. - */ - if (vd->vdev_state == VDEV_STATE_HEALTHY && asize > vd->vdev_asize && - (vd->vdev_expanding || spa->spa_autoexpand)) + * If all children are healthy we update asize if either: + * The asize has increased, due to a device expansion caused by dynamic + * LUN growth or vdev replacement, and automatic expansion is enabled; + * making the additional space available. + * + * The asize has decreased, due to a device shrink usually caused by a + * vdev replace with a smaller device. This ensures that calculations + * based of max_asize and asize e.g. esize are always valid. It's safe + * to do this as we've already validated that asize is greater than + * vdev_min_asize. + */ + if (vd->vdev_state == VDEV_STATE_HEALTHY && + ((asize > vd->vdev_asize && + (vd->vdev_expanding || spa->spa_autoexpand)) || + (asize < vd->vdev_asize))) vd->vdev_asize = asize; vdev_set_min_asize(vd); From owner-svn-src-all@freebsd.org Fri Apr 14 18:29:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3881BD3E3F9; Fri, 14 Apr 2017 18:29:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFAF7871; Fri, 14 Apr 2017 18:29:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EITE3d071163; Fri, 14 Apr 2017 18:29:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EITDmC071157; Fri, 14 Apr 2017 18:29:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141829.v3EITDmC071157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316920 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:29:15 -0000 Author: avg Date: Fri Apr 14 18:29:13 2017 New Revision: 316920 URL: https://svnweb.freebsd.org/changeset/base/316920 Log: 8023 Panic destroying a metaslab deferred range tree illumos/illumos-gate@3991b535a8e990c0369be677746a87c259b13e9f https://github.com/illumos/illumos-gate/commit/3991b535a8e990c0369be677746a87c259b13e9f https://www.illumos.org/issues/8023 $C ffffff0011bc0970 vpanic() ffffff0011bc0a00 strlog() ffffff0011bc0a30 range_tree_destroy+0x72(ffffff043769ad00) ffffff0011bc0a70 metaslab_fini+0xd5(ffffff0449acf380) ffffff0011bc0ab0 vdev_metaslab_fini+0x56(ffffff0462bae800) ffffff0011bc0af0 spa_unload+0x9b(ffffff03e3dac000) ffffff0011bc0b70 spa_export_common+0x115(ffffff047f4b4000, 2, 0, 0, 0) ffffff0011bc0b90 spa_destroy+0x1d(ffffff047f4b4000) ffffff0011bc0bd0 zfs_ioc_pool_destroy+0x20(ffffff047f4b4000) ffffff0011bc0c80 zfsdev_ioctl+0x4d7(11400000000, 5a01, 8040190, 100003, ffffff03e1956b10, ffffff0011bc0e68) ffffff0011bc0cc0 cdev_ioctl+0x39(11400000000, 5a01, 8040190, 100003, ffffff03e1956b10, ffffff0011bc0e68) ffffff0011bc0d10 spec_ioctl+0x60(ffffff03d9153b00, 5a01, 8040190, 100003, ffffff03e1956b10, ffffff0011bc0e68, 0) ffffff0011bc0da0 fop_ioctl+0x55(ffffff03d9153b00, 5a01, 8040190, 100003, ffffff03e1956b10, ffffff0011bc0e68, 0) ffffff0011bc0ec0 ioctl+0x9b(3, 5a01, 8040190) ffffff0011bc0f10 _sys_sysenter_post_swapgs+0x149() Reviewed by: Brad Lewis Reviewed by: Matt Ahrens Reviewed by: Dan Kimmel Reviewed by: Saso Kiselkov Approved by: Dan McDonald Author: George Wilson Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:28:40 2017 (r316919) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Apr 14 18:29:13 2017 (r316920) @@ -1552,6 +1552,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t * this assertion only if we're not already dirty. */ os = dn->dn_objset; + VERIFY3U(tx->tx_txg, <=, spa_final_dirty_txg(os->os_spa)); #ifdef DEBUG if (dn->dn_objset->os_dsl_dataset != NULL) rrw_enter(&os->os_dsl_dataset->ds_bp_rwlock, RW_READER, FTAG); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Fri Apr 14 18:28:40 2017 (r316919) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Fri Apr 14 18:29:13 2017 (r316920) @@ -1563,11 +1563,19 @@ metaslab_set_fragmentation(metaslab_t *m uint64_t txg = spa_syncing_txg(spa); vdev_t *vd = msp->ms_group->mg_vd; - if (spa_writeable(spa)) { + /* + * If we've reached the final dirty txg, then we must + * be shutting down the pool. We don't want to dirty + * any data past this point so skip setting the condense + * flag. We can retry this action the next time the pool + * is imported. + */ + if (spa_writeable(spa) && txg < spa_final_dirty_txg(spa)) { msp->ms_condense_wanted = B_TRUE; vdev_dirty(vd, VDD_METASLAB, msp, txg + 1); spa_dbgmsg(spa, "txg %llu, requesting force condense: " - "msp %p, vd %p", txg, msp, vd); + "ms_id %llu, vdev_id %llu", txg, msp->ms_id, + vd->vdev_id); } msp->ms_fragmentation = ZFS_FRAG_INVALID; return; @@ -2189,13 +2197,17 @@ metaslab_sync(metaslab_t *msp, uint64_t /* * Normally, we don't want to process a metaslab if there * are no allocations or frees to perform. However, if the metaslab - * is being forced to condense we need to let it through. + * is being forced to condense and it's loaded, we need to let it + * through. */ if (range_tree_space(alloctree) == 0 && range_tree_space(msp->ms_freeingtree) == 0 && - !msp->ms_condense_wanted) + !(msp->ms_loaded && msp->ms_condense_wanted)) return; + + VERIFY(txg <= spa_final_dirty_txg(spa)); + /* * The only state that can actually be changing concurrently with * metaslab_sync() is the metaslab's ms_tree. No other thread can Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Fri Apr 14 18:28:40 2017 (r316919) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Fri Apr 14 18:29:13 2017 (r316920) @@ -1621,6 +1621,16 @@ spa_syncing_txg(spa_t *spa) return (spa->spa_syncing_txg); } +/* + * Return the last txg where data can be dirtied. The final txgs + * will be used to just clear out any deferred frees that remain. + */ +uint64_t +spa_final_dirty_txg(spa_t *spa) +{ + return (spa->spa_final_txg - TXG_DEFER_SIZE); +} + pool_state_t spa_state(spa_t *spa) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c Fri Apr 14 18:28:40 2017 (r316919) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c Fri Apr 14 18:29:13 2017 (r316920) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. */ #include @@ -403,6 +403,7 @@ space_map_truncate(space_map_t *sm, dmu_ ASSERT(dsl_pool_sync_context(dmu_objset_pool(os))); ASSERT(dmu_tx_is_syncing(tx)); + VERIFY3U(dmu_tx_get_txg(tx), <=, spa_final_dirty_txg(spa)); dmu_object_info_from_db(sm->sm_dbuf, &doi); @@ -417,9 +418,10 @@ space_map_truncate(space_map_t *sm, dmu_ if ((spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM) && doi.doi_bonus_size != sizeof (space_map_phys_t)) || doi.doi_data_block_size != space_map_blksz) { - zfs_dbgmsg("txg %llu, spa %s, reallocating: " - "old bonus %u, old blocksz %u", dmu_tx_get_txg(tx), - spa_name(spa), doi.doi_bonus_size, doi.doi_data_block_size); + zfs_dbgmsg("txg %llu, spa %s, sm %p, reallocating " + "object[%llu]: old bonus %u, old blocksz %u", + dmu_tx_get_txg(tx), spa_name(spa), sm, sm->sm_object, + doi.doi_bonus_size, doi.doi_data_block_size); space_map_free(sm, tx); dmu_buf_rele(sm->sm_dbuf, sm); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Fri Apr 14 18:28:40 2017 (r316919) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Fri Apr 14 18:29:13 2017 (r316920) @@ -771,6 +771,7 @@ extern uint64_t spa_load_guid(spa_t *spa extern uint64_t spa_last_synced_txg(spa_t *spa); extern uint64_t spa_first_txg(spa_t *spa); extern uint64_t spa_syncing_txg(spa_t *spa); +extern uint64_t spa_final_dirty_txg(spa_t *spa); extern uint64_t spa_version(spa_t *spa); extern pool_state_t spa_state(spa_t *spa); extern spa_load_state_t spa_load_state(spa_t *spa); From owner-svn-src-all@freebsd.org Fri Apr 14 18:29:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C9B9D3E445; Fri, 14 Apr 2017 18:29:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB939BA; Fri, 14 Apr 2017 18:29:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EITags071219; Fri, 14 Apr 2017 18:29:36 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EITaZC071218; Fri, 14 Apr 2017 18:29:36 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141829.v3EITaZC071218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316921 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:29:37 -0000 Author: avg Date: Fri Apr 14 18:29:35 2017 New Revision: 316921 URL: https://svnweb.freebsd.org/changeset/base/316921 Log: 8027 tighten up dsl_pool_dirty_delta illumos/illumos-gate@313ae1e182df6e6a04b56c4b73ded33e11b75666 https://github.com/illumos/illumos-gate/commit/313ae1e182df6e6a04b56c4b73ded33e11b75666 https://www.illumos.org/issues/8027 dsl_pool_dirty_delta() should not wake up waiters when dp->dp_dirty_total == zfs_dirty_data_max, because they wait for dp_dirty_total to fall strictly below the threshold. It's probably very rare for that condition to occur, but it's better to have more accurate code. Reviewed by: Matt Ahrens Reviewed by: Serapheim Dimitropoulos Reviewed by: Paul Dagnelie Approved by: Dan McDonald Author: Andriy Gapon Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Fri Apr 14 18:29:13 2017 (r316920) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Fri Apr 14 18:29:35 2017 (r316921) @@ -459,7 +459,7 @@ dsl_pool_dirty_delta(dsl_pool_t *dp, int * Note: we signal even when increasing dp_dirty_total. * This ensures forward progress -- each thread wakes the next waiter. */ - if (dp->dp_dirty_total <= zfs_dirty_data_max) + if (dp->dp_dirty_total < zfs_dirty_data_max) cv_signal(&dp->dp_spaceavail_cv); } From owner-svn-src-all@freebsd.org Fri Apr 14 18:30:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79712D3E4B8; Fri, 14 Apr 2017 18:30:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FDB0AF5; Fri, 14 Apr 2017 18:30:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIUMWT071313; Fri, 14 Apr 2017 18:30:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIUMxT071312; Fri, 14 Apr 2017 18:30:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141830.v3EIUMxT071312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316922 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:30:23 -0000 Author: avg Date: Fri Apr 14 18:30:22 2017 New Revision: 316922 URL: https://svnweb.freebsd.org/changeset/base/316922 Log: 5380 receive of a send -p stream doesn't need to try renaming snapshots illumos/illumos-gate@471a88e499c660844f4590487ce7c4d5a7090294 https://github.com/illumos/illumos-gate/commit/471a88e499c660844f4590487ce7c4d5a7090294 https://www.illumos.org/issues/5380 A stream created with zfs send -p -I contains properties of all snapshots of a given dataset as opposed to only properties of snapshots in a given range. Not only this is suboptimal but the receive code also does not filter properties by the range. So, properties of earlier snapshots would be updated even though the snapshots themselves are not in the stream (just their properties). Given that modifying the snapshot properties requires a TXG sync and that the snapshots are updated one by one the described behavior may lead to a sever performance penalty. Reviewed by: Paul Dagnelie Reviewed by: Matt Ahrens Approved by: Dan McDonald Author: Andriy Gapon Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Fri Apr 14 18:29:35 2017 (r316921) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Fri Apr 14 18:30:22 2017 (r316922) @@ -2770,7 +2770,7 @@ zfs_receive_package(libzfs_handle_t *hdl goto out; } - if (fromsnap != NULL) { + if (fromsnap != NULL && recursive) { nvlist_t *renamed = NULL; nvpair_t *pair = NULL; @@ -2797,7 +2797,7 @@ zfs_receive_package(libzfs_handle_t *hdl *strchr(tofs, '@') = '\0'; } - if (recursive && !flags->dryrun && !flags->nomount) { + if (!flags->dryrun && !flags->nomount) { VERIFY(0 == nvlist_alloc(&renamed, NV_UNIQUE_NAME, 0)); } @@ -2866,7 +2866,7 @@ zfs_receive_package(libzfs_handle_t *hdl anyerr |= error; } while (error == 0); - if (drr->drr_payloadlen != 0 && fromsnap != NULL) { + if (drr->drr_payloadlen != 0 && recursive && fromsnap != NULL) { /* * Now that we have the fs's they sent us, try the * renames again. From owner-svn-src-all@freebsd.org Fri Apr 14 18:32:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83361D3E668; Fri, 14 Apr 2017 18:32:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52FFAF3A; Fri, 14 Apr 2017 18:32:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIWCNf073510; Fri, 14 Apr 2017 18:32:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIWCAV073509; Fri, 14 Apr 2017 18:32:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141832.v3EIWCAV073509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316923 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:32:13 -0000 Author: avg Date: Fri Apr 14 18:32:12 2017 New Revision: 316923 URL: https://svnweb.freebsd.org/changeset/base/316923 Log: 8026 retire zfs_throttle_delay and zfs_throttle_resolution illumos/illumos-gate@6b036259815954b7ad86d651af18efba672cb7a9 https://github.com/illumos/illumos-gate/commit/6b036259815954b7ad86d651af18efba672cb7a9 https://www.illumos.org/issues/8026 zfs_throttle_delay and zfs_throttle_resolution became disused since the new write throttling mechanism was introduced. Reviewed by: Matthew Ahrens Reviewed by: Serapheim Dimitropoulos Approved by: Richard Lowe Author: Andriy Gapon Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Fri Apr 14 18:30:22 2017 (r316922) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Fri Apr 14 18:32:12 2017 (r316923) @@ -132,9 +132,6 @@ uint64_t zfs_delay_scale = 1000 * 1000 * */ int zfs_sync_taskq_batch_pct = 75; -hrtime_t zfs_throttle_delay = MSEC2NSEC(10); -hrtime_t zfs_throttle_resolution = MSEC2NSEC(10); - int dsl_pool_open_special_dir(dsl_pool_t *dp, const char *name, dsl_dir_t **ddp) { From owner-svn-src-all@freebsd.org Fri Apr 14 18:32:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E83D1D3E709; Fri, 14 Apr 2017 18:32:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DCD9160; Fri, 14 Apr 2017 18:32:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIWcqC075267; Fri, 14 Apr 2017 18:32:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIWcAi075266; Fri, 14 Apr 2017 18:32:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141832.v3EIWcAi075266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316924 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:32:40 -0000 Author: avg Date: Fri Apr 14 18:32:38 2017 New Revision: 316924 URL: https://svnweb.freebsd.org/changeset/base/316924 Log: 8061 sa_find_idx_tab can be declared more type-safely illumos/illumos-gate@7f0bdb4257bb4f1f76390b72665961e411da24c6 https://github.com/illumos/illumos-gate/commit/7f0bdb4257bb4f1f76390b72665961e411da24c6 https://www.illumos.org/issues/8061 sa_find_idx_tab() is declared as taking and returning "void *" parameters. These can be declared to be the specific types. Reviewed by: George Wilson Reviewed by: Chris Williamson Approved by: Dan McDonald Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c Fri Apr 14 18:32:12 2017 (r316923) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c Fri Apr 14 18:32:38 2017 (r316924) @@ -22,7 +22,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright 2011 iXsystems, Inc - * Copyright (c) 2013, 2016 by Delphix. All rights reserved. + * Copyright (c) 2013, 2017 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -131,8 +131,8 @@ typedef void (sa_iterfunc_t)(void *hdr, static int sa_build_index(sa_handle_t *hdl, sa_buf_type_t buftype); static void sa_idx_tab_hold(objset_t *os, sa_idx_tab_t *idx_tab); -static void *sa_find_idx_tab(objset_t *os, dmu_object_type_t bonustype, - void *data); +static sa_idx_tab_t *sa_find_idx_tab(objset_t *os, dmu_object_type_t bonustype, + sa_hdr_phys_t *hdr); static void sa_idx_tab_rele(objset_t *os, void *arg); static void sa_copy_data(sa_data_locator_t *func, void *start, void *target, int buflen); @@ -1483,11 +1483,10 @@ sa_lookup_uio(sa_handle_t *hdl, sa_attr_ } #endif -void * -sa_find_idx_tab(objset_t *os, dmu_object_type_t bonustype, void *data) +static sa_idx_tab_t * +sa_find_idx_tab(objset_t *os, dmu_object_type_t bonustype, sa_hdr_phys_t *hdr) { sa_idx_tab_t *idx_tab; - sa_hdr_phys_t *hdr = (sa_hdr_phys_t *)data; sa_os_t *sa = os->os_sa; sa_lot_t *tb, search; avl_index_t loc; From owner-svn-src-all@freebsd.org Fri Apr 14 18:33:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DF83D3E7B6; Fri, 14 Apr 2017 18:33:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 204942E3; Fri, 14 Apr 2017 18:33:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIXLF1075365; Fri, 14 Apr 2017 18:33:21 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIXLBi075363; Fri, 14 Apr 2017 18:33:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141833.v3EIXLBi075363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316925 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:33:22 -0000 Author: avg Date: Fri Apr 14 18:33:20 2017 New Revision: 316925 URL: https://svnweb.freebsd.org/changeset/base/316925 Log: 6101 attempt to lzc_create() a filesystem under a volume results in a panic illumos/illumos-gate@b127fe3c059af7adf772735498680b4f2e1405ef https://github.com/illumos/illumos-gate/commit/b127fe3c059af7adf772735498680b4f2e1405ef https://www.illumos.org/issues/6101 lzc_create(), or more correctly, zfs_ioc_create() does not reject an attempt to create a filesystem as a child of a volume, instead it proceeds to a crash. A crash stack obtained on FreeBSD: page fault while in kernel mode zap_leaf_lookup() fzap_lookup() zap_lookup_norm() zap_lookup() zfs_get_zplprop() zfs_fill_zplprops_impl() zfs_ioc_create() zfsdev_ioctl() devfs_ioctl_f() kern_ioctl() sys_ioctl() This crash happened with a kernel without debugging assertions. The immediate cause of crash appears to an attempt to interpret a zvol object as a zap object. For filesystems: #define MASTER_NODE_OBJ 1 For zvols: #define ZVOL_OBJ 1ULL #define ZVOL_ZAP_OBJ 2ULL So, I see two problems here: 1. an attempt to create a filesystem under a zvol should be rejected as early as possible, maybe in zfs_fill_zplprops() 2. maybe zap_lookup / zap_lockdir should reject objects that are not of one of the zap object types Reviewed by: Matthew Ahrens Approved by: Dan McDonald Author: Andriy Gapon Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 14 18:32:38 2017 (r316924) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 14 18:33:20 2017 (r316925) @@ -3035,6 +3035,9 @@ zfs_fill_zplprops_impl(objset_t *os, uin ASSERT(zplprops != NULL); + if (os != NULL && os->os_phys->os_type != DMU_OST_ZFS) + return (SET_ERROR(EINVAL)); + /* * Pull out creator prop choices, if any. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Fri Apr 14 18:32:38 2017 (r316924) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Fri Apr 14 18:33:20 2017 (r316925) @@ -2243,8 +2243,10 @@ zfs_get_zplprop(objset_t *os, zfs_prop_t else pname = zfs_prop_to_name(prop); - if (os != NULL) + if (os != NULL) { + ASSERT3U(os->os_phys->os_type, ==, DMU_OST_ZFS); error = zap_lookup(os, MASTER_NODE_OBJ, pname, 8, 1, value); + } if (error == ENOENT) { /* No value set, use the default value */ From owner-svn-src-all@freebsd.org Fri Apr 14 18:34:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F9F2D3E810; Fri, 14 Apr 2017 18:34:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 014F263E; Fri, 14 Apr 2017 18:34:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIY4ck075447; Fri, 14 Apr 2017 18:34:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIY3Ya075442; Fri, 14 Apr 2017 18:34:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141834.v3EIY3Ya075442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316926 - in vendor/illumos/dist: cmd/zfs lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:34:05 -0000 Author: avg Date: Fri Apr 14 18:34:03 2017 New Revision: 316926 URL: https://svnweb.freebsd.org/changeset/base/316926 Log: 7955 libshare needs to initialize only those datasets being modified by the consumer illumos/illumos-gate@8a981c3356b194b3b5c0ae9276a9cc31cd2f93a3 https://github.com/illumos/illumos-gate/commit/8a981c3356b194b3b5c0ae9276a9cc31cd2f93a3 https://www.illumos.org/issues/7955 Libshare currently initializes all available filesystems when doing any libshare operation. This requires iterating through all the filesystem multiple times, which is a huge performance problem for sharing and unsharing operations. Reviewed by: Steve Gonczi Reviewed by: Sebastien Roy Reviewed by: Matthew Ahrens Reviewed by: George Wilson Reviewed by: Pavel Zakharov Reviewed by: Yuri Pankov Approved by: Gordon Ross Author: Daniel Hoffman Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_changelist.c vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_main.c Fri Apr 14 18:33:20 2017 (r316925) +++ vendor/illumos/dist/cmd/zfs/zfs_main.c Fri Apr 14 18:34:03 2017 (r316926) @@ -68,6 +68,7 @@ #include #include #include +#include #include "zfs_iter.h" #include "zfs_util.h" @@ -6111,6 +6112,15 @@ share_mount(int op, int argc, char **arg return (0); qsort(dslist, count, sizeof (void *), libzfs_dataset_cmp); + sa_init_selective_arg_t sharearg; + sharearg.zhandle_arr = dslist; + sharearg.zhandle_len = count; + if ((ret = zfs_init_libshare_arg(zfs_get_handle(dslist[0]), + SA_INIT_SHARE_API_SELECTIVE, &sharearg)) != SA_OK) { + (void) fprintf(stderr, + gettext("Could not initialize libshare, %d"), ret); + return (ret); + } for (i = 0; i < count; i++) { if (verbose) Modified: vendor/illumos/dist/lib/libzfs/common/libzfs.h ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs.h Fri Apr 14 18:33:20 2017 (r316925) +++ vendor/illumos/dist/lib/libzfs/common/libzfs.h Fri Apr 14 18:34:03 2017 (r316926) @@ -783,6 +783,17 @@ extern int zpool_fru_set(zpool_handle_t extern int zfs_get_hole_count(const char *, uint64_t *, uint64_t *); +/* Allow consumers to initialize libshare externally for optimal performance */ +extern int zfs_init_libshare_arg(libzfs_handle_t *, int, void *); +/* + * For most consumers, zfs_init_libshare_arg is sufficient on its own, and + * zfs_uninit_libshare is unnecessary. zfs_uninit_libshare should only be called + * if the caller has already initialized libshare for one set of zfs handles, + * and wishes to share or unshare filesystems outside of that set. In that case, + * the caller should uninitialize libshare, and then re-initialize it with the + * new handles being shared or unshared. + */ +extern void zfs_uninit_libshare(libzfs_handle_t *); #ifdef __cplusplus } #endif Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_changelist.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_changelist.c Fri Apr 14 18:33:20 2017 (r316925) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_changelist.c Fri Apr 14 18:34:03 2017 (r316926) @@ -24,7 +24,7 @@ * Use is subject to license terms. * * Portions Copyright 2007 Ramprakash Jelari - * Copyright (c) 2014, 2015 by Delphix. All rights reserved. + * Copyright (c) 2014, 2016 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov */ @@ -162,6 +162,9 @@ changelist_postfix(prop_changelist_t *cl char shareopts[ZFS_MAXPROPLEN]; int errors = 0; libzfs_handle_t *hdl; + size_t num_datasets = 0, i; + zfs_handle_t **zhandle_arr; + sa_init_selective_arg_t sharearg; /* * If we're changing the mountpoint, attempt to destroy the underlying @@ -186,8 +189,31 @@ changelist_postfix(prop_changelist_t *cl hdl = cn->cn_handle->zfs_hdl; assert(hdl != NULL); zfs_uninit_libshare(hdl); - } + /* + * For efficiencies sake, we initialize libshare for only a few + * shares (the ones affected here). Future initializations in + * this process should just use the cached initialization. + */ + for (cn = uu_list_last(clp->cl_list); cn != NULL; + cn = uu_list_prev(clp->cl_list, cn)) { + num_datasets++; + } + + zhandle_arr = zfs_alloc(hdl, + num_datasets * sizeof (zfs_handle_t *)); + for (i = 0, cn = uu_list_last(clp->cl_list); cn != NULL; + cn = uu_list_prev(clp->cl_list, cn)) { + zhandle_arr[i++] = cn->cn_handle; + zfs_refresh_properties(cn->cn_handle); + } + assert(i == num_datasets); + sharearg.zhandle_arr = zhandle_arr; + sharearg.zhandle_len = num_datasets; + errors = zfs_init_libshare_arg(hdl, SA_INIT_SHARE_API_SELECTIVE, + &sharearg); + free(zhandle_arr); + } /* * We walk the datasets in reverse, because we want to mount any parent * datasets before mounting the children. We walk all datasets even if @@ -212,8 +238,6 @@ changelist_postfix(prop_changelist_t *cl continue; cn->cn_needpost = B_FALSE; - zfs_refresh_properties(cn->cn_handle); - if (ZFS_IS_VOLUME(cn->cn_handle)) continue; Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h Fri Apr 14 18:33:20 2017 (r316925) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h Fri Apr 14 18:34:03 2017 (r316926) @@ -203,7 +203,6 @@ void namespace_clear(libzfs_handle_t *); */ extern int zfs_init_libshare(libzfs_handle_t *, int); -extern void zfs_uninit_libshare(libzfs_handle_t *); extern int zfs_parse_options(char *, zfs_share_proto_t); extern int zfs_unshare_proto(zfs_handle_t *, Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Fri Apr 14 18:33:20 2017 (r316925) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Fri Apr 14 18:34:03 2017 (r316926) @@ -566,6 +566,7 @@ zfs_is_shared_smb(zfs_handle_t *zhp, cha */ static sa_handle_t (*_sa_init)(int); +static sa_handle_t (*_sa_init_arg)(int, void *); static void (*_sa_fini)(sa_handle_t); static sa_share_t (*_sa_find_share)(sa_handle_t, char *); static int (*_sa_enable_share)(sa_share_t, char *); @@ -605,6 +606,8 @@ _zfs_init_libshare(void) if ((libshare = dlopen(path, RTLD_LAZY | RTLD_GLOBAL)) != NULL) { _sa_init = (sa_handle_t (*)(int))dlsym(libshare, "sa_init"); + _sa_init_arg = (sa_handle_t (*)(int, void *))dlsym(libshare, + "sa_init_arg"); _sa_fini = (void (*)(sa_handle_t))dlsym(libshare, "sa_fini"); _sa_find_share = (sa_share_t (*)(sa_handle_t, char *)) dlsym(libshare, "sa_find_share"); @@ -624,14 +627,15 @@ _zfs_init_libshare(void) char *, char *))dlsym(libshare, "sa_zfs_process_share"); _sa_update_sharetab_ts = (void (*)(sa_handle_t)) dlsym(libshare, "sa_update_sharetab_ts"); - if (_sa_init == NULL || _sa_fini == NULL || - _sa_find_share == NULL || _sa_enable_share == NULL || - _sa_disable_share == NULL || _sa_errorstr == NULL || - _sa_parse_legacy_options == NULL || + if (_sa_init == NULL || _sa_init_arg == NULL || + _sa_fini == NULL || _sa_find_share == NULL || + _sa_enable_share == NULL || _sa_disable_share == NULL || + _sa_errorstr == NULL || _sa_parse_legacy_options == NULL || _sa_needs_refresh == NULL || _sa_get_zfs_handle == NULL || _sa_zfs_process_share == NULL || _sa_update_sharetab_ts == NULL) { _sa_init = NULL; + _sa_init_arg = NULL; _sa_fini = NULL; _sa_disable_share = NULL; _sa_enable_share = NULL; @@ -654,8 +658,8 @@ _zfs_init_libshare(void) * service value is which part(s) of the API to initialize and is a * direct map to the libshare sa_init(service) interface. */ -int -zfs_init_libshare(libzfs_handle_t *zhandle, int service) +static int +zfs_init_libshare_impl(libzfs_handle_t *zhandle, int service, void *arg) { if (_sa_init == NULL) return (SA_CONFIG_ERR); @@ -671,17 +675,29 @@ zfs_init_libshare(libzfs_handle_t *zhand if (_sa_needs_refresh != NULL && _sa_needs_refresh(zhandle->libzfs_sharehdl)) { zfs_uninit_libshare(zhandle); - zhandle->libzfs_sharehdl = _sa_init(service); + zhandle->libzfs_sharehdl = _sa_init_arg(service, arg); } if (zhandle && zhandle->libzfs_sharehdl == NULL) - zhandle->libzfs_sharehdl = _sa_init(service); + zhandle->libzfs_sharehdl = _sa_init_arg(service, arg); if (zhandle->libzfs_sharehdl == NULL) return (SA_NO_MEMORY); return (SA_OK); } +int +zfs_init_libshare(libzfs_handle_t *zhandle, int service) +{ + return (zfs_init_libshare_impl(zhandle, service, NULL)); +} + +int +zfs_init_libshare_arg(libzfs_handle_t *zhandle, int service, void *arg) +{ + return (zfs_init_libshare_impl(zhandle, service, arg)); +} + /* * zfs_uninit_libshare(zhandle) @@ -786,8 +802,8 @@ zfs_share_proto(zfs_handle_t *zhp, zfs_s ZFS_MAXPROPLEN, B_FALSE) != 0 || strcmp(shareopts, "off") == 0) continue; - - ret = zfs_init_libshare(hdl, SA_INIT_SHARE_API); + ret = zfs_init_libshare_arg(hdl, SA_INIT_ONE_SHARE_FROM_HANDLE, + zhp); if (ret != SA_OK) { (void) zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, dgettext(TEXT_DOMAIN, "cannot share '%s': %s"), @@ -881,6 +897,7 @@ unshare_one(libzfs_handle_t *hdl, const sa_share_t share; int err; char *mntpt; + /* * Mountpoint could get trashed if libshare calls getmntany * which it does during API initialization, so strdup the @@ -888,8 +905,14 @@ unshare_one(libzfs_handle_t *hdl, const */ mntpt = zfs_strdup(hdl, mountpoint); - /* make sure libshare initialized */ - if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) { + /* + * make sure libshare initialized, initialize everything because we + * don't know what other unsharing may happen later. Functions up the + * stack are allowed to initialize instead a subset of shares at the + * time the set is known. + */ + if ((err = zfs_init_libshare_arg(hdl, SA_INIT_ONE_SHARE_FROM_NAME, + (void *)name)) != SA_OK) { free(mntpt); /* don't need the copy anymore */ return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), @@ -1221,6 +1244,7 @@ zpool_disable_datasets(zpool_handle_t *z int i; int ret = -1; int flags = (force ? MS_FORCE : 0); + sa_init_selective_arg_t sharearg; namelen = strlen(zhp->zpool_name); @@ -1295,6 +1319,12 @@ zpool_disable_datasets(zpool_handle_t *z * At this point, we have the entire list of filesystems, so sort it by * mountpoint. */ + sharearg.zhandle_arr = datasets; + sharearg.zhandle_len = used; + ret = zfs_init_libshare_arg(hdl, SA_INIT_SHARE_API_SELECTIVE, + &sharearg); + if (ret != 0) + goto out; qsort(mountpoints, used, sizeof (char *), mountpoint_compare); /* From owner-svn-src-all@freebsd.org Fri Apr 14 18:38:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A38D3E9E2; Fri, 14 Apr 2017 18:38:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED2BCAC7; Fri, 14 Apr 2017 18:38:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIcMYm075945; Fri, 14 Apr 2017 18:38:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIcM4G075944; Fri, 14 Apr 2017 18:38:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141838.v3EIcM4G075944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316927 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:38:23 -0000 Author: avg Date: Fri Apr 14 18:38:21 2017 New Revision: 316927 URL: https://svnweb.freebsd.org/changeset/base/316927 Log: 5379 modifying a mmap()-ed file does not update its timestamps illumos/illumos-gate@80e10fd0d22bbf0d18bfdae035e06f44c68ae8e6 https://github.com/illumos/illumos-gate/commit/80e10fd0d22bbf0d18bfdae035e06f44c68ae8e6 https://www.illumos.org/issues/5379 The following is based on a review of the illumos code and on a similar problem reported for FreeBSD where the relevant code is different. Looking at this block of code http://src.illumos.org/source/xref/illumos-gate/ usr/src/uts/common/fs/zfs/zfs_vnops.c#4187 I see code to set up an sa_bulk_attr_t object, I see code to set up mtime and ctime values, but I do not see code to actually apply the attributes... I would expect there to be a call to sa_bulk_update(), there is such a call in zfs_write() for instance. mmap_write.c [Magnifier] - demo (1.42 KB) Andriy Gapon, 2015-11-11 01:53 PM Reviewed by: Matthew Ahrens Reviewed by: Prashanth Sreenivasa Reviewed by: Dan McDonald Approved by: Gordon Ross Author: Andriy Gapon Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 18:34:03 2017 (r316926) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 18:38:21 2017 (r316927) @@ -4266,6 +4266,8 @@ zfs_putapage(vnode_t *vp, page_t *pp, u_ &zp->z_pflags, 8); zfs_tstamp_update_setup(zp, CONTENT_MODIFIED, mtime, ctime, B_TRUE); + err = sa_bulk_update(zp->z_sa_hdl, bulk, count, tx); + ASSERT0(err); zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, off, len, 0); } dmu_tx_commit(tx); From owner-svn-src-all@freebsd.org Fri Apr 14 18:38:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46EBAD3EA3C; Fri, 14 Apr 2017 18:38:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1397CC0F; Fri, 14 Apr 2017 18:38:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIcsFh076008; Fri, 14 Apr 2017 18:38:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIcs5V076007; Fri, 14 Apr 2017 18:38:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141838.v3EIcs5V076007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316928 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:38:55 -0000 Author: avg Date: Fri Apr 14 18:38:53 2017 New Revision: 316928 URL: https://svnweb.freebsd.org/changeset/base/316928 Log: 7256 low probability race in zfs_get_data illumos/illumos-gate@0c94e1af6784c69a1dea25e0e35dd13b2b91e2e5 https://github.com/illumos/illumos-gate/commit/0c94e1af6784c69a1dea25e0e35dd13b2b91e2e5 https://www.illumos.org/issues/7256 error = dmu_sync(zio, lr->lr_common.lrc_txg, zfs_get_done, zgd); ASSERT(error || lr->lr_length <= zp->z_blksz); It's possible, although extremely rare, that the zfs_get_done() callback is executed before dmu_sync() returns. In that case the znode's range lock is dropped and the znode is unreferenced. Thus, the assertion can access some invalid or wrong data via the zp pointer. size variable caches the correct value of z_blksz and can be safely used here. Reviewed by: Matt Ahrens Reviewed by: Pavel Zakharov Approved by: Dan McDonald Author: Andriy Gapon Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 18:38:21 2017 (r316927) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Fri Apr 14 18:38:53 2017 (r316928) @@ -1142,7 +1142,7 @@ zfs_get_data(void *arg, lr_write_t *lr, error = dmu_sync(zio, lr->lr_common.lrc_txg, zfs_get_done, zgd); - ASSERT(error || lr->lr_length <= zp->z_blksz); + ASSERT(error || lr->lr_length <= size); /* * On success, we need to wait for the write I/O From owner-svn-src-all@freebsd.org Fri Apr 14 18:41:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CBF0D3EB06; Fri, 14 Apr 2017 18:41:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 282EEEF5; Fri, 14 Apr 2017 18:41:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIfbGa078399; Fri, 14 Apr 2017 18:41:37 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIfb7g078398; Fri, 14 Apr 2017 18:41:37 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141841.v3EIfb7g078398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316929 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:41:38 -0000 Author: avg Date: Fri Apr 14 18:41:37 2017 New Revision: 316929 URL: https://svnweb.freebsd.org/changeset/base/316929 Log: 6914 kernel virtual memory fragmentation leads to hang illumos/illumos-gate@af868f46a5b794687741d5424de9e3a2d684a84a https://github.com/illumos/illumos-gate/commit/af868f46a5b794687741d5424de9e3a2d684a84a https://www.illumos.org/issues/6914 This change allows the kernel to use more virtual address space. This will allow us to devote 1.5x physmem for the zio arena, and an additional 1.5x physmem for the kernel heap. We saw a hang when unable to find any 128K contiguous memory segments. Looking at the core file we see many threads in stacks similar to this: > ffffff68c9c87c00::findstack -v stack pointer for thread ffffff68c9c87c00: ffffff02cd63d8b0 [ ffffff02cd63d8b0 _resume_from_idle+0xf4() ] ffffff02cd63d8e0 swtch+0x141() ffffff02cd63d920 cv_wait+0x70(ffffff6009b1b01e, ffffff6009b1b020) ffffff02cd63da50 vmem_xalloc+0x640(ffffff6009b1b000, 20000, 1000, 0, 0, 0, 0, ffffff0200000004) ffffff02cd63dac0 vmem_alloc+0x135(ffffff6009b1b000, 20000, 4) ffffff02cd63db60 segkmem_xalloc+0x171(ffffff6009b1b000, 0, 20000, 4, 0, fffffffffb885fe0, fffffffffbcefa10) ffffff02cd63dbc0 segkmem_alloc_vn+0x4a(ffffff6009b1b000, 20000, 4, fffffffffbcefa10) ffffff02cd63dbf0 segkmem_zio_alloc+0x20(ffffff6009b1b000, 20000, 4) ffffff02cd63dd20 vmem_xalloc+0x5b1(ffffff6009b1c000, 20000, 1000, 0, 0, 0, 0, 4) ffffff02cd63dd90 vmem_alloc+0x135(ffffff6009b1c000, 20000, 4) ffffff02cd63de20 kmem_slab_create+0x8d(ffffff605fd37008, 4) ffffff02cd63de80 kmem_slab_alloc+0x11e(ffffff605fd37008, 4) ffffff02cd63dee0 kmem_cache_alloc+0x233(ffffff605fd37008, 4) ffffff02cd63df10 zio_data_buf_alloc+0x5b(20000) ffffff02cd63df70 arc_get_data_buf+0x92(ffffff6265a70588, 20000, ffffff901fd796f8) ffffff02cd63dfb0 arc_buf_alloc_impl+0x9c(ffffff6265a70588, ffffff6d233ab0b8) Reviewed by: George Wilson Reviewed by: Adam Leventhal Reviewed by: John Kennedy Reviewed by: Igor Kozhukhov Reviewed by: Josef 'Jeff' Sipek Approved by: Garrett D'Amore Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Fri Apr 14 18:38:53 2017 (r316928) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Fri Apr 14 18:41:37 2017 (r316929) @@ -5885,18 +5885,6 @@ arc_init(void) /* Convert seconds to clock ticks */ arc_min_prefetch_lifespan = 1 * hz; - /* Start out with 1/8 of all memory */ - arc_c = allmem / 8; - -#ifdef _KERNEL - /* - * On architectures where the physical memory can be larger - * than the addressable space (intel in 32-bit mode), we may - * need to limit the cache to 1/8 of VM size. - */ - arc_c = MIN(arc_c, vmem_size(heap_arena, VMEM_ALLOC | VMEM_FREE) / 8); -#endif - /* set min cache to 1/32 of all memory, or 64MB, whichever is more */ arc_c_min = MAX(allmem / 32, 64 << 20); /* set max to 3/4 of all memory, or all but 1GB, whichever is more */ @@ -5934,6 +5922,15 @@ arc_init(void) /* limit meta-data to 1/4 of the arc capacity */ arc_meta_limit = arc_c_max / 4; +#ifdef _KERNEL + /* + * Metadata is stored in the kernel's heap. Don't let us + * use more than half the heap for the ARC. + */ + arc_meta_limit = MIN(arc_meta_limit, + vmem_size(heap_arena, VMEM_ALLOC | VMEM_FREE) / 2); +#endif + /* Allow the tunable to override if it is reasonable */ if (zfs_arc_meta_limit > 0 && zfs_arc_meta_limit <= arc_c_max) arc_meta_limit = zfs_arc_meta_limit; From owner-svn-src-all@freebsd.org Fri Apr 14 18:43:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CC36D3ECB9; Fri, 14 Apr 2017 18:43:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D73D0372; Fri, 14 Apr 2017 18:43:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIhACJ079998; Fri, 14 Apr 2017 18:43:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIhAA2079997; Fri, 14 Apr 2017 18:43:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141843.v3EIhAA2079997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316930 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:43:12 -0000 Author: avg Date: Fri Apr 14 18:43:10 2017 New Revision: 316930 URL: https://svnweb.freebsd.org/changeset/base/316930 Log: 5814 bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. illumos/illumos-gate@b67dde11a73a9455d641403cbbb65ec2add41b41 https://github.com/illumos/illumos-gate/commit/b67dde11a73a9455d641403cbbb65ec2add41b41 https://www.illumos.org/issues/5814 Lets pull in this patch from freebsd: http://svnweb.freebsd.org/base?view=revision&revision=271781 bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. If bpobj_space() returned non-zero here, the sublist would have been left open, along with the bonus buffer hold it requires. This call does not invoke any calls to bpobj_close() itself. This bug doesn't have any known vector, but was found on inspection. MFC after: 1 week Sponsored by: Spectra Logic Affects: All ZFS versions starting 21 May 2010 (illumos cde58dbc) MFSpectraBSD: r1050998 on 2014/03/26 Fix bpobj_iterate_impl() to properly call bpobj_close() if bpobj_space() returns an error. Reviewed by: Prakash Surya Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Simon Klinkert Approved by: Gordon Ross Author: Will Andrews Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Fri Apr 14 18:41:37 2017 (r316929) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Fri Apr 14 18:43:10 2017 (r316930) @@ -301,8 +301,10 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_i if (free) { err = bpobj_space(&sublist, &used_before, &comp_before, &uncomp_before); - if (err) + if (err != 0) { + bpobj_close(&sublist); break; + } } err = bpobj_iterate_impl(&sublist, func, arg, tx, free); if (free) { From owner-svn-src-all@freebsd.org Fri Apr 14 18:49:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFD1DD3ED98; Fri, 14 Apr 2017 18:49:31 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB517946; Fri, 14 Apr 2017 18:49:31 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 925FA2B8; Fri, 14 Apr 2017 11:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1492195770; bh=Z6xPhUHRlm0fby4MJ07uURjrHumflpZpZe9s5a5CBU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Eq/a4hbvCtInowN0e9QMSQXxYRxwdAmm5bQTkH+vX8Q3ZfZ2bZlgVntM+JshJfvAq MMgWqhhN5H9PbB7B9mXwIlOMKasIdiiRYKpiwA+deW2TJ6g8CjmCAR30ZO3u59X10B gVeduMKRiHDe8h24FDOzV5y8XZ30wc8K+gb1RWmI= From: Peter Wemm To: svn-src-all@freebsd.org Cc: Maxim Sobolev , src-committers@freebsd.org, svn-src-head@freebsd.org, Hiren Panchasara Subject: Re: svn commit: r316874 - head/sys/kern Date: Fri, 14 Apr 2017 11:49:26 -0700 Message-ID: <1599271.FxKGEkh3s8@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: <201704141723.v3EHNS3B043902@repo.freebsd.org> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2770083.al7Ir3C4kI"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:49:32 -0000 --nextPart2770083.al7Ir3C4kI Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday, April 14, 2017 05:23:28 PM Maxim Sobolev wrote: > Author: sobomax > Date: Fri Apr 14 17:23:28 2017 > New Revision: 316874 > URL: https://svnweb.freebsd.org/changeset/base/316874 >=20 > Log: > Restore ability to shutdown DGRAM sockets, still forcing ENOTCONN t= o be > returned by the shutdown(2) system call. This ability has been lost a= s part > of the svn revision 285910. >=20 > Reviewed by:=09ed, rwatson, glebius, hiren > MFC after:=092 weeks > Differential Revision:=09https://reviews.freebsd.org/D10351 This appears to have broken syslogd and had a major change in behavior = with=20 regards to select(2). If you run syslogd with the -s flag (which is default), it now spins at= 100%=20 cpu as all the shutdown sockets now return readable from select. Old releases / jails also manifest this behavor. If it wasn't for losi= ng the=20 ability to run old branch binaries I'd suggest changing syslogd instead= , but=20 we depend on this in the cluster and I expect others do too. I'm not 100% certain that this change is the culprit but a heads-up can= 't=20 hurt. I'll try reverting it on the freebsd cluster next, after fixing t= he=20 broken auditing changes. =2DPeter =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart2770083.al7Ir3C4kI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAljxGbYACgkQNdaXCeyA ngQBCggApmBnRNEPOo6bYCm9FDdP12t08FtP6ZOC5mZjgxzOQ5dIUYoZ9HvLQ0Qq uM9Z/nVdk5hwb/SsIDPy3VsU6ASmwApVzOxv84/y4O0acDVVoiVu0HQ5Bz3dqz1s HJoS6wlv0afr14hba+4tnLK5krwze6/CHJ2k1MgBZHqNjqwhsgzTK8gjgNuJhClI dXFbHB8vBXcMz4r1MEAWlTUV/fCzTFGGxAvYSUNcJNAjaRd3fvpEdkMv+cvGw3OE ge447UmbAVH7aBv+8ExeelIYR5fexcQ3XkfdXWamm/p9xOfY/e3mnfk7ei3cHwOI YQSShQKA4RQj1czUeCotMq9mboC34A== =hHRC -----END PGP SIGNATURE----- --nextPart2770083.al7Ir3C4kI-- From owner-svn-src-all@freebsd.org Fri Apr 14 18:49:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6214D3EE02; Fri, 14 Apr 2017 18:49:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74793A34; Fri, 14 Apr 2017 18:49:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EInigF080545; Fri, 14 Apr 2017 18:49:44 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIniuO080544; Fri, 14 Apr 2017 18:49:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141849.v3EIniuO080544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316931 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:49:45 -0000 Author: avg Date: Fri Apr 14 18:49:44 2017 New Revision: 316931 URL: https://svnweb.freebsd.org/changeset/base/316931 Log: 6268 zfs diff confused by moving a file to another directory illumos/illumos-gate@aab04418a72c0a29040a5da7eec08efe19dbef04 https://github.com/illumos/illumos-gate/commit/aab04418a72c0a29040a5da7eec08efe19dbef04 https://www.illumos.org/issues/6268 The zfs diff command presents a description of the changes that have occurred to files within a filesystem between two snapshots. If a file is renamed, the tool is capable of reporting this, e.g.: cd /some/zfs/dataset/subdir mv file0 file1 Will result in a diff record like: R /some/zfs/dataset/subdir/file0 -> /some/zfs/dataset/subdir/file1 Unfortunately, it seems that rename detection only uses the base filename to determine if a file has been renamed or simply modified. This leads to misreporting only the original filename, omitting the more relevant destination filename entirely. For example: cd /some/zfs/dataset/subdir mv file0 ../otherdir/file0 Will result in a diff entry: M /some/zfs/dataset/subdir/file0 But it should really emit: R /some/zfs/dataset/subdir/file0 -> /some/zfs/dataset/otherdir/file0 Reviewed by: Matthew Ahrens Reviewed by: Justin Gibbs Approved by: Dan McDonald Author: Joshua M. Clulow Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c Fri Apr 14 18:43:10 2017 (r316930) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_diff.c Fri Apr 14 18:49:44 2017 (r316931) @@ -57,15 +57,6 @@ #define ZDIFF_REMOVED '-' #define ZDIFF_RENAMED 'R' -static boolean_t -do_name_cmp(const char *fpath, const char *tpath) -{ - char *fname, *tname; - fname = strrchr(fpath, '/') + 1; - tname = strrchr(tpath, '/') + 1; - return (strcmp(fname, tname) == 0); -} - typedef struct differ_info { zfs_handle_t *zhp; char *fromsnap; @@ -260,7 +251,6 @@ static int write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj) { struct zfs_stat fsb, tsb; - boolean_t same_name; mode_t fmode, tmode; char fobjname[MAXPATHLEN], tobjname[MAXPATHLEN]; int fobjerr, tobjerr; @@ -321,7 +311,6 @@ write_inuse_diffs_one(FILE *fp, differ_i if (fmode != tmode && fsb.zs_gen == tsb.zs_gen) tsb.zs_gen++; /* Force a generational difference */ - same_name = do_name_cmp(fobjname, tobjname); /* Simple modification or no change */ if (fsb.zs_gen == tsb.zs_gen) { @@ -332,7 +321,7 @@ write_inuse_diffs_one(FILE *fp, differ_i if (change) { print_link_change(fp, di, change, change > 0 ? fobjname : tobjname, &tsb); - } else if (same_name) { + } else if (strcmp(fobjname, tobjname) == 0) { print_file(fp, di, ZDIFF_MODIFIED, fobjname, &tsb); } else { print_rename(fp, di, fobjname, tobjname, &tsb); From owner-svn-src-all@freebsd.org Fri Apr 14 18:51:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CEF9D3EF05; Fri, 14 Apr 2017 18:51:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13303DE1; Fri, 14 Apr 2017 18:51:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIpH74083600; Fri, 14 Apr 2017 18:51:17 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIpHEA083599; Fri, 14 Apr 2017 18:51:17 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141851.v3EIpHEA083599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316932 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:51:18 -0000 Author: avg Date: Fri Apr 14 18:51:16 2017 New Revision: 316932 URL: https://svnweb.freebsd.org/changeset/base/316932 Log: 6280 libzfs: unshare_one() could fail with EZFS_SHARENFSFAILED illumos/illumos-gate@d1672efb6feac57c42788e27f739dfa3c4f3baf7 https://github.com/illumos/illumos-gate/commit/d1672efb6feac57c42788e27f739dfa3c4f3baf7 https://www.illumos.org/issues/6280 The unshare_one() in libzfs could fail with EZFS_SHARENFSFAILED at line 834 here: 831 /* make sure libshare initialized */ 832 if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) { 833 free(mntpt); /* don't need the copy anymore */ 834 return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, 835 dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), 836 name, _sa_errorstr(err))); 837 } The correct error should be EZFS_UNSHARENFSFAILED instead. Reviewed by: Toomas Soome Reviewed by: Dan McDonald Reviewed by: Matthew Ahrens Approved by: Gordon Ross Author: Marcel Telka Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Fri Apr 14 18:49:44 2017 (r316931) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c Fri Apr 14 18:51:16 2017 (r316932) @@ -20,6 +20,7 @@ */ /* + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2016 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov @@ -914,7 +915,7 @@ unshare_one(libzfs_handle_t *hdl, const if ((err = zfs_init_libshare_arg(hdl, SA_INIT_ONE_SHARE_FROM_NAME, (void *)name)) != SA_OK) { free(mntpt); /* don't need the copy anymore */ - return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, + return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), name, _sa_errorstr(err))); } From owner-svn-src-all@freebsd.org Fri Apr 14 18:52:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 439FBD3E120; Fri, 14 Apr 2017 18:52:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12FC1369; Fri, 14 Apr 2017 18:52:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIqnNN084647; Fri, 14 Apr 2017 18:52:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIqn87084646; Fri, 14 Apr 2017 18:52:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141852.v3EIqn87084646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316933 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:52:50 -0000 Author: avg Date: Fri Apr 14 18:52:48 2017 New Revision: 316933 URL: https://svnweb.freebsd.org/changeset/base/316933 Log: 5142 libzfs support raidz root pool (loader project) illumos/illumos-gate@d5f26ad8122c3762fb16413a17bfb497db86a782 https://github.com/illumos/illumos-gate/commit/d5f26ad8122c3762fb16413a17bfb497db86a782 https://www.illumos.org/issues/5142 the current libzfs only allows simple disk and mirror setup for boot pool, as loader does support booting from raidz, this feature will remove raidz restriction from boot pool setup. Reviewed by: George Wilson Reviewed by: Yuri Pankov Reviewed by: Andrew Stormont Reviewed by: Albert Lee Approved by: Robert Mustacchi Author: Toomas Soome Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Fri Apr 14 18:51:16 2017 (r316932) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Fri Apr 14 18:52:48 2017 (r316933) @@ -2267,6 +2267,7 @@ vdev_get_physpaths(nvlist_t *nv, char *p return (ret); } } else if (strcmp(type, VDEV_TYPE_MIRROR) == 0 || + strcmp(type, VDEV_TYPE_RAIDZ) == 0 || strcmp(type, VDEV_TYPE_REPLACING) == 0 || (is_spare = (strcmp(type, VDEV_TYPE_SPARE) == 0))) { nvlist_t **child; From owner-svn-src-all@freebsd.org Fri Apr 14 18:54:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E908D3E184; Fri, 14 Apr 2017 18:54:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC2736C6; Fri, 14 Apr 2017 18:54:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIsChq084742; Fri, 14 Apr 2017 18:54:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIsCWD084741; Fri, 14 Apr 2017 18:54:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141854.v3EIsCWD084741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316934 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:54:13 -0000 Author: avg Date: Fri Apr 14 18:54:11 2017 New Revision: 316934 URL: https://svnweb.freebsd.org/changeset/base/316934 Log: 7340 receive manual origin should override automatic origin illumos/illumos-gate@ed4e7a6a5cbc5e8986dc649ad54435210487b102 https://github.com/illumos/illumos-gate/commit/ed4e7a6a5cbc5e8986dc649ad54435210487b102 https://www.illumos.org/issues/7340 When -o origin= is specified as part of a ZFS receive, that origin should override the automatic detection in libzfs. Reviewed by: George Wilson Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Paul Dagnelie Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Fri Apr 14 18:52:48 2017 (r316933) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Fri Apr 14 18:54:11 2017 (r316934) @@ -3173,7 +3173,12 @@ zfs_receive_one(libzfs_handle_t *hdl, in /* * Determine the name of the origin snapshot, store in zc_string. */ - if (drrb->drr_flags & DRR_FLAG_CLONE) { + if (originsnap) { + (void) strncpy(zc.zc_string, originsnap, sizeof (zc.zc_string)); + if (flags->verbose) + (void) printf("using provided clone origin %s\n", + zc.zc_string); + } else if (drrb->drr_flags & DRR_FLAG_CLONE) { if (guid_to_name(hdl, zc.zc_value, drrb->drr_fromguid, B_FALSE, zc.zc_string) != 0) { zcmd_free_nvlists(&zc); @@ -3184,11 +3189,6 @@ zfs_receive_one(libzfs_handle_t *hdl, in } if (flags->verbose) (void) printf("found clone origin %s\n", zc.zc_string); - } else if (originsnap) { - (void) strncpy(zc.zc_string, originsnap, sizeof (zc.zc_string)); - if (flags->verbose) - (void) printf("using provided clone origin %s\n", - zc.zc_string); } boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) & From owner-svn-src-all@freebsd.org Fri Apr 14 18:56:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7E75D3E21C; Fri, 14 Apr 2017 18:56:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B462A94F; Fri, 14 Apr 2017 18:56:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EIu0pb085001; Fri, 14 Apr 2017 18:56:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EIu0Du085000; Fri, 14 Apr 2017 18:56:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201704141856.v3EIu0Du085000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 14 Apr 2017 18:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316935 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 18:56:02 -0000 Author: avg Date: Fri Apr 14 18:56:00 2017 New Revision: 316935 URL: https://svnweb.freebsd.org/changeset/base/316935 Log: 5704 libzfs can only handle 255 file descriptors illumos/illumos-gate@bde3d612a7c090234c60e6e4578821237a5db135 https://github.com/illumos/illumos-gate/commit/bde3d612a7c090234c60e6e4578821237a5db135 https://www.illumos.org/issues/5704 libzfs uses fopen(), at least in libzfs_init(). If there are more than 255 filedescriptors open, fopen() will fail unless you give 'F' as the last mode character. The fix would be to give 'rF' instead of 'r' as mode to fopen(). Reviewed by: Josef 'Jeff' Sipek Reviewed by: John Kennedy Approved by: Richard Lowe Author: Simon Klinkert Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_util.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_util.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_util.c Fri Apr 14 18:54:11 2017 (r316934) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_util.c Fri Apr 14 18:56:00 2017 (r316935) @@ -626,13 +626,13 @@ libzfs_init(void) return (NULL); } - if ((hdl->libzfs_mnttab = fopen(MNTTAB, "r")) == NULL) { + if ((hdl->libzfs_mnttab = fopen(MNTTAB, "rF")) == NULL) { (void) close(hdl->libzfs_fd); free(hdl); return (NULL); } - hdl->libzfs_sharetab = fopen("/etc/dfs/sharetab", "r"); + hdl->libzfs_sharetab = fopen("/etc/dfs/sharetab", "rF"); if (libzfs_core_init() != 0) { (void) close(hdl->libzfs_fd); From owner-svn-src-all@freebsd.org Fri Apr 14 19:15:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A78AD3EB95; Fri, 14 Apr 2017 19:15:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C910BCF; Fri, 14 Apr 2017 19:15:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EJFVQM093442; Fri, 14 Apr 2017 19:15:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EJFVMX093441; Fri, 14 Apr 2017 19:15:31 GMT (envelope-from np@FreeBSD.org) Message-Id: <201704141915.v3EJFVMX093441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 14 Apr 2017 19:15:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316936 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 19:15:32 -0000 Author: np Date: Fri Apr 14 19:15:31 2017 New Revision: 316936 URL: https://svnweb.freebsd.org/changeset/base/316936 Log: cxgbe/iw_cxgbe: hw supports 64K (not 32K) Protection Domains. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/t4.h Modified: head/sys/dev/cxgbe/iw_cxgbe/t4.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 18:56:00 2017 (r316935) +++ head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 19:15:31 2017 (r316936) @@ -61,7 +61,7 @@ #define T4_MAX_NUM_QP (1<<16) #define T4_MAX_NUM_CQ (1<<15) -#define T4_MAX_NUM_PD (1<<15) +#define T4_MAX_NUM_PD 65536 #define T4_EQ_STATUS_ENTRIES (L1_CACHE_BYTES > 64 ? 2 : 1) #define T4_MAX_EQ_SIZE (65520 - T4_EQ_STATUS_ENTRIES) #define T4_MAX_IQ_SIZE (65520 - 1) From owner-svn-src-all@freebsd.org Fri Apr 14 19:18:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E46CDD3EC60; Fri, 14 Apr 2017 19:18:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B108CD5B; Fri, 14 Apr 2017 19:18:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EJIowj093600; Fri, 14 Apr 2017 19:18:50 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EJIotl093598; Fri, 14 Apr 2017 19:18:50 GMT (envelope-from np@FreeBSD.org) Message-Id: <201704141918.v3EJIotl093598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 14 Apr 2017 19:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316937 - in head: contrib/ofed/libcxgb4/src sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 19:18:52 -0000 Author: np Date: Fri Apr 14 19:18:50 2017 New Revision: 316937 URL: https://svnweb.freebsd.org/changeset/base/316937 Log: cxgbe/iw_cxgbe: Report accurate page_size_cap in ib_query_device. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/contrib/ofed/libcxgb4/src/t4.h head/sys/dev/cxgbe/iw_cxgbe/t4.h Modified: head/contrib/ofed/libcxgb4/src/t4.h ============================================================================== --- head/contrib/ofed/libcxgb4/src/t4.h Fri Apr 14 19:15:31 2017 (r316936) +++ head/contrib/ofed/libcxgb4/src/t4.h Fri Apr 14 19:18:50 2017 (r316937) @@ -102,7 +102,7 @@ #define T4_MAX_CQ_DEPTH (T4_MAX_IQ_SIZE - 1) #define T4_MAX_NUM_STAG (1<<15) #define T4_MAX_MR_SIZE (~0ULL - 1) -#define T4_PAGESIZE_MASK 0xffff000 /* 4KB-128MB */ +#define T4_PAGESIZE_MASK 0xffffffff000 /* 4KB-8TB */ #define T4_STAG_UNSET 0xffffffff #define T4_FW_MAJ 0 Modified: head/sys/dev/cxgbe/iw_cxgbe/t4.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 19:15:31 2017 (r316936) +++ head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 19:18:50 2017 (r316937) @@ -70,7 +70,7 @@ #define T4_MAX_QP_DEPTH (T4_MAX_RQ_SIZE - 1) #define T4_MAX_CQ_DEPTH (T4_MAX_IQ_SIZE - 1) #define T4_MAX_MR_SIZE (~0ULL - 1) -#define T4_PAGESIZE_MASK 0xffff000 /* 4KB-128MB */ +#define T4_PAGESIZE_MASK 0xffffffff000 /* 4KB-8TB */ #define T4_STAG_UNSET 0xffffffff #define T4_FW_MAJ 0 #define T4_EQ_STATUS_ENTRIES (L1_CACHE_BYTES > 64 ? 2 : 1) From owner-svn-src-all@freebsd.org Fri Apr 14 19:32:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB96D3E0A8; Fri, 14 Apr 2017 19:32:19 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AECE8C5; Fri, 14 Apr 2017 19:32:19 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id C0D532FA; Fri, 14 Apr 2017 12:32:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1492198338; bh=kHIaA7a0IjEX2MvS6UZarJy9E0ji9RDq6eE4gfsVa7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=P0EVA9E6K0m1Q6EeOeIRvV2Er5Nbxqiy5O2jumSQyyVeVGWfgfZng7KZW+GpqXveA 6MvbOfDkj6WbobFu9gsVXwwpTgUPCEDVG1mLTAQVWk+W7nhj14PCcL5EZ3tQkxwvGK Z55/SnTP+7IHrzOWnaY9NRMxdH0y+NMw1aBKhfo0= From: Peter Wemm To: svn-src-all@freebsd.org Cc: svn-src-head@freebsd.org, Maxim Sobolev , src-committers@freebsd.org, Hiren Panchasara Subject: Re: svn commit: r316874 - head/sys/kern Date: Fri, 14 Apr 2017 12:32:14 -0700 Message-ID: <12133324.zHp9vo75vZ@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: <1599271.FxKGEkh3s8@overcee.wemm.org> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <1599271.FxKGEkh3s8@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart16221178.3qmYparrNt"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 19:32:19 -0000 --nextPart16221178.3qmYparrNt Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday, April 14, 2017 11:49:26 AM Peter Wemm wrote: > On Friday, April 14, 2017 05:23:28 PM Maxim Sobolev wrote: > > Author: sobomax > > Date: Fri Apr 14 17:23:28 2017 > > New Revision: 316874 > > URL: https://svnweb.freebsd.org/changeset/base/316874 > >=20 > > Log: > > Restore ability to shutdown DGRAM sockets, still forcing ENOTCONN= to be > >=20 > > returned by the shutdown(2) system call. This ability has been lost= as > > part > > of the svn revision 285910. > >=20 > > Reviewed by:=09ed, rwatson, glebius, hiren > > MFC after:=092 weeks > > Differential Revision:=09https://reviews.freebsd.org/D10351 >=20 > This appears to have broken syslogd and had a major change in behavio= r with > regards to select(2). >=20 > If you run syslogd with the -s flag (which is default), it now spins = at 100% > cpu as all the shutdown sockets now return readable from select. >=20 > Old releases / jails also manifest this behavor. If it wasn't for lo= sing > the ability to run old branch binaries I'd suggest changing syslogd > instead, but we depend on this in the cluster and I expect others do = too. >=20 > I'm not 100% certain that this change is the culprit but a heads-up c= an't > hurt. I'll try reverting it on the freebsd cluster next, after fixing= the > broken auditing changes. >=20 > -Peter I can confirm that reverting r316874 fixes syslogd and backwards compat= ability=20 with old branches. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart16221178.3qmYparrNt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAljxI74ACgkQNdaXCeyA ngQkywf+Mmm+D59fuaA2/VIm1MZFYTUmfKFjQt1CkoRhul4dUF82c+2LUoFsTXLD hl/gq6+J5jcO1HaVgUe29BMFK+R7egZknGQzil1kLEtRAe6W3lomdJH+4aZHM1g1 SmhN8eNONP5qCRfrGiYufYOJQqCXbgGrVbZNraVI8s2CkTlmATF/eBbuPwn/9T6z oKFiR84IZXblwbWpFyq6k72F2Q3Y/17Jf3IpwscefvM9VSlk+Ak7QfqJK8lKOfI9 tcp+7tlR4Kp2oqwI88J2WzEwcxiOwaFrJljYyBvX7wRnHAE13WGQzX9e0+ZUqiS8 L3mDZ7fHDXDl/iaVgYrhAl3xSmS5JQ== =lG7i -----END PGP SIGNATURE----- --nextPart16221178.3qmYparrNt-- From owner-svn-src-all@freebsd.org Fri Apr 14 19:41:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81239D3E2C2; Fri, 14 Apr 2017 19:41:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41DCECBB; Fri, 14 Apr 2017 19:41:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EJfmNN003372; Fri, 14 Apr 2017 19:41:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EJfmCW003347; Fri, 14 Apr 2017 19:41:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704141941.v3EJfmCW003347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 14 Apr 2017 19:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316938 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 19:41:49 -0000 Author: ngie Date: Fri Apr 14 19:41:48 2017 New Revision: 316938 URL: https://svnweb.freebsd.org/changeset/base/316938 Log: savecore: fix space calculation with respect to `minfree` in check_space(..) - Use strtoll(3) instead of atoi(3), because atoi(3) limits the representable data to INT_MAX. Check the values received from strtoll(3), trimming trailing whitespace off the end to maintain POLA. - Use `KiB` instead of `kB` when describing free space, total space, etc. I am now fully aware of `KiB` being the IEC standard for 1024 bytes and `kB` being the IEC standard for 1000 bytes. - Store available number of KiB in `available` so it can be more easily queried and compared to ensure that there are enough KiB to store the dump image on disk. - Print out the reserved space on disk, per `minfree`, so end-users can troubleshoot why check_space(..) is reporting that there isn't enough free space. MFC after: 7 weeks Reviewed by: Anton Rang (earlier diff), cem (earlier diff) Tested with: positive/negative cases (see review); make tinderbox Sponsored by: Dell EMC Isilon Differential Revision: D10379 Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Apr 14 19:18:50 2017 (r316937) +++ head/sbin/savecore/savecore.c Fri Apr 14 19:41:48 2017 (r316938) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -278,7 +279,7 @@ static int check_space(const char *savedir, off_t dumpsize, int bounds) { FILE *fp; - off_t minfree, spacefree, totfree, needed; + off_t available, minfree, spacefree, totfree, needed; struct statfs fsbuf; char buf[100]; @@ -294,19 +295,37 @@ check_space(const char *savedir, off_t d else { if (fgets(buf, sizeof(buf), fp) == NULL) minfree = 0; - else - minfree = atoi(buf); + else { + char *endp; + + errno = 0; + minfree = strtoll(buf, &endp, 10); + if (minfree == 0 && errno != 0) + minfree = -1; + else { + while (*endp != '\0' && isspace(*endp)) + endp++; + if (*endp != '\0' || minfree < 0) + minfree = -1; + } + if (minfree < 0) + syslog(LOG_WARNING, + "`minfree` didn't contain a valid size " + "(`%s`). Defaulting to 0", buf); + } (void)fclose(fp); } + available = minfree > 0 ? spacefree - minfree : totfree; needed = dumpsize / 1024 + 2; /* 2 for info file */ needed -= saved_dump_size(bounds); - if ((minfree > 0 ? spacefree : totfree) - needed < minfree) { + if (available < needed) { syslog(LOG_WARNING, - "no dump: not enough free space on device (%lldkB " - "available; need at least %lldkB)", - (long long)(minfree > 0 ? spacefree : totfree), - (long long)needed); + "no dump: not enough free space on device (need at least " + "%jdKiB for dump; %jdKiB available; %jdKiB reserved)", + (intmax_t)needed, + (intmax_t)available + minfree, + (intmax_t)minfree); return (0); } if (spacefree - needed < 0) From owner-svn-src-all@freebsd.org Fri Apr 14 19:41:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E041D3E2E4 for ; Fri, 14 Apr 2017 19:41:54 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4501ECF8 for ; Fri, 14 Apr 2017 19:41:54 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io0-x236.google.com with SMTP id r16so116121763ioi.2 for ; Fri, 14 Apr 2017 12:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=U+04fCFBtpnXmIt97UNzs1eFNXVni3GjYsE6IpsJvLQ=; b=DWQHG/FljMXszjBRHAjlEhLTm9ZJcGlh6ezuWnCg4yxc/W0Ljo9b2G5IX9lv/8KEwG HKivCwyWg/Hi7f6MPhvQ8cfEDgeC6UU1LlZjzB/D3nBhCGWV+Gn6AhtzJKs2EJsdLkY3 eaeqPZszsvh3wCH75kYjlrQsm1A5l0YwN9knRW+lVN9Qd0N/5Jig5ICQHGA7buLrvcoa J+BOIxr1qpQPgBe71fjvPuZuz5QyqOezbchveqAPWR+nRC9V5WlvDjC3Z14iqmUjmajD N+rkBi6imOaiylQ0ULdpGSmZLG2UhXtcjSbo+JdsUZJJOSyf7/kbOWilBpQ5Zx5BRYL/ IvLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=U+04fCFBtpnXmIt97UNzs1eFNXVni3GjYsE6IpsJvLQ=; b=Lco85zT45y1YMKWWCgcSFVMV3rBvoQEZgxkkmCK5dp8DsiOUwrxSob2MRVHEioaJUo hT85Pbaf1Q97UdJv6U66QfryJoMfchCAImEfCi0L3aUC22J944GMBKeop5Z4H16kK2AB TIGEjjbGWqJ3ts/gSydmLrFQ1RfbH32ovCAYbib6yxM5EnBfTudpasad6HLMACexXNAw CFF3ITYk4dIRQX+efZUv/aselERE6211yDjGE/dwKfqezX1G8yjyrH14KiQpqJ/4pqmV pU9QbA6y8T9N421NL9yA4YPlIAbZxf9oCsI2S/jFZvBi0YS6t7NV6upoWRUL1+Jyg46p cmNw== X-Gm-Message-State: AN3rC/4mN87SLIiRJHuD+NAKdEQfNT/HcLai/BASYG06qV+ayYNRH3ge jjstWP24L/yxVJ8/GPb3dH71gCDDlHYo X-Received: by 10.107.170.163 with SMTP id g35mr12721853ioj.101.1492198913628; Fri, 14 Apr 2017 12:41:53 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.104.135 with HTTP; Fri, 14 Apr 2017 12:41:52 -0700 (PDT) Received: by 10.36.104.135 with HTTP; Fri, 14 Apr 2017 12:41:52 -0700 (PDT) In-Reply-To: <12133324.zHp9vo75vZ@overcee.wemm.org> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <1599271.FxKGEkh3s8@overcee.wemm.org> <12133324.zHp9vo75vZ@overcee.wemm.org> From: Maxim Sobolev Date: Fri, 14 Apr 2017 12:41:52 -0700 X-Google-Sender-Auth: huJXHFzfgMcZtTnq7WY_iiD_uT8 Message-ID: Subject: Re: svn commit: r316874 - head/sys/kern To: Peter Wemm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hiren Panchasara Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 19:41:54 -0000 Thanks, Peter. I will try to look into this asap. -Max On Apr 14, 2017 12:32 PM, "Peter Wemm" wrote: > On Friday, April 14, 2017 11:49:26 AM Peter Wemm wrote: > > On Friday, April 14, 2017 05:23:28 PM Maxim Sobolev wrote: > > > Author: sobomax > > > Date: Fri Apr 14 17:23:28 2017 > > > New Revision: 316874 > > > URL: https://svnweb.freebsd.org/changeset/base/316874 > > > > > > Log: > > > Restore ability to shutdown DGRAM sockets, still forcing ENOTCONN to > be > > > > > > returned by the shutdown(2) system call. This ability has been lost as > > > part > > > of the svn revision 285910. > > > > > > Reviewed by: ed, rwatson, glebius, hiren > > > MFC after: 2 weeks > > > Differential Revision: https://reviews.freebsd.org/D10351 > > > > This appears to have broken syslogd and had a major change in behavior > with > > regards to select(2). > > > > If you run syslogd with the -s flag (which is default), it now spins at > 100% > > cpu as all the shutdown sockets now return readable from select. > > > > Old releases / jails also manifest this behavor. If it wasn't for losing > > the ability to run old branch binaries I'd suggest changing syslogd > > instead, but we depend on this in the cluster and I expect others do too. > > > > I'm not 100% certain that this change is the culprit but a heads-up can't > > hurt. I'll try reverting it on the freebsd cluster next, after fixing the > > broken auditing changes. > > > > -Peter > > I can confirm that reverting r316874 fixes syslogd and backwards > compatability > with old branches. > > -- > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; > KI6FJV > UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 From owner-svn-src-all@freebsd.org Fri Apr 14 19:46:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B0CD3E45F; Fri, 14 Apr 2017 19:46:45 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 677CC167; Fri, 14 Apr 2017 19:46:45 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 87F6330B; Fri, 14 Apr 2017 12:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1492199204; bh=m6agFC2SgIbVxFOItBosMjIOBCmP/5eC2Z7fDXiUXkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jMht7rxDaLoK1Xa56IfEXntQ8+VNpL4hpq+fmgi/Mh5ngmXXtK+S8yydwsW5Ynlcd kdpfUQiNlsc+lOI6SGxuo9LfjERu+TsJQPi8yw3OpMCD9OVD3BB1LqvexW7wYSc3Vq WLZf+lW3+Efn3FQ5F+cxQnQKciOSqxe36ThGQ3Bc= From: Peter Wemm To: Maxim Sobolev Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hiren Panchasara Subject: Re: svn commit: r316874 - head/sys/kern Date: Fri, 14 Apr 2017 12:46:39 -0700 Message-ID: <6942092.OsECkgAp13@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <12133324.zHp9vo75vZ@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1639610.4lUEG6eNod"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 19:46:45 -0000 --nextPart1639610.4lUEG6eNod Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday, April 14, 2017 12:41:52 PM Maxim Sobolev wrote: > Thanks, Peter. I will try to look into this asap. I don't understand what is going on yet. Presumably there must be other= =20 changes in play that affect udp/select sometime between the original 20= 15=20 change and this. The syslogd -s code is Old(TM). I'm also wondering wh= ether=20 the -s code even works at all since the 2015 / r285910 change... > -Max >=20 > On Apr 14, 2017 12:32 PM, "Peter Wemm" wrote: > > On Friday, April 14, 2017 11:49:26 AM Peter Wemm wrote: > > > On Friday, April 14, 2017 05:23:28 PM Maxim Sobolev wrote: > > > > Author: sobomax > > > > Date: Fri Apr 14 17:23:28 2017 > > > > New Revision: 316874 > > > > URL: https://svnweb.freebsd.org/changeset/base/316874 > > > >=20 > > > > Log: > > > > Restore ability to shutdown DGRAM sockets, still forcing ENOT= CONN to > >=20 > > be > >=20 > > > > returned by the shutdown(2) system call. This ability has been = lost as > > > > part > > > > of the svn revision 285910. > > > >=20 > > > > Reviewed by: ed, rwatson, glebius, hiren > > > > MFC after: 2 weeks > > > > Differential Revision: https://reviews.freebsd.org/D10351 > > >=20 > > > This appears to have broken syslogd and had a major change in beh= avior > >=20 > > with > >=20 > > > regards to select(2). > > >=20 > > > If you run syslogd with the -s flag (which is default), it now sp= ins at > >=20 > > 100% > >=20 > > > cpu as all the shutdown sockets now return readable from select. > > >=20 > > > Old releases / jails also manifest this behavor. If it wasn't fo= r > > > losing > > > the ability to run old branch binaries I'd suggest changing syslo= gd > > > instead, but we depend on this in the cluster and I expect others= do > > > too. > > >=20 > > > I'm not 100% certain that this change is the culprit but a heads-= up > > > can't > > > hurt. I'll try reverting it on the freebsd cluster next, after fi= xing > > > the > > > broken auditing changes. > > >=20 > > > -Peter > >=20 > > I can confirm that reverting r316874 fixes syslogd and backwards > > compatability > > with old branches. > >=20 > > -- > > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com= ; > > KI6FJV > > UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart1639610.4lUEG6eNod Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAljxJyAACgkQNdaXCeyA ngRplwf/Z34dHsDsqm0Tpqsh9RMxDQNv4ezIMqoId2egNpmIrcXPm4JTBq8/pbTA J+Mi/zotWeDtfmcqtALCr0gQcNBL1ff3kxjWcMngcv7OtSK4JHyvdFUZhuTJIZrg iWklMg7HYinB8RdxLgctMmOMi0/ekn7QbhHoOqbtEGeLmJCTlvF0kmBbq7kqx+Sz 8cluLIS7KQTsr2ffsnfGpLI4Dcy0ycFeFfJ+t2uYdZWMCY1ocLHGKHTd1yXLAErW /p7KjZSXppK4a7ujh5tfvdrT7YPsY0A4wuRT4McPh/ZAIOLwMWXnlsUUUBKB2hZL YqFbimvrSpd4dXoeGNFZ6YtQAJIzog== =oxwE -----END PGP SIGNATURE----- --nextPart1639610.4lUEG6eNod-- From owner-svn-src-all@freebsd.org Fri Apr 14 19:48:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB23ED3E512; Fri, 14 Apr 2017 19:48:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76EAB2FC; Fri, 14 Apr 2017 19:48:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id g23so1724326pfj.1; Fri, 14 Apr 2017 12:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=ScnLmnTl10AuSyzoRwdRXpeEA5pDH6cGQw09fgGaPKw=; b=UxxlaZPjj3jW+xN0bBosYcNfZJPIXbRjqULddHzg+KYmJUBgXapUkAK5obJGYh5c0Q 7I5o7K/e2gJj6fzEM8iaf/Z0hUvoYfVMUsvJAUR2VwT6Ku2k4iLU/4s6jeJ6EQmsxu9v r9lnf/c/VeSWiSty2yDNRnoyuyzFo1EOmR7HYcXHS8g3qMnDkloJ3ilI073L+VNx/wD+ SmOkdudelckDT2nL+V48sM4vzW2IW6vn8ktXm7gb5NqWWUZJJ66kT53hbkieccnnIbQh zAtJzFYgizDj5XhIx00zCrqWGgkZyvEzsDi2+XmpAk+pQnmB+t/QscCXcvCmWgEhi3Pw etOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=ScnLmnTl10AuSyzoRwdRXpeEA5pDH6cGQw09fgGaPKw=; b=QTDT5/Q7Bmpjt9K+9W8CZYMsihbqmFfaauG2tpSlICd/sx9fe6eRAYvGWvRzJWlwjx w6zrB1G6RxTmAPdbG7U3Pfxuiel41iGk3XeJMplpXUuDhl4hLfOCzBi65H4nqfeD60nb FkvyXR3KmPXcdeFkA8Bx7dOJcw5WY5OVVUE+Z1myt7O9u9ZsJpwI7A6Xc8NKrTsLqgZj NKxoLdhC7puctSvhzdX9nrJG/wR6EfhHa0C09EctuXb8J5c3yFV+zdlljjT4g1aLSRMD VcfCP1XUP27Xc1o0Cf04X0ayGiPpK6hgDuE2vFMAhIlTt3qsFc8T4z51cKxDCyqm/Rjg Gkkg== X-Gm-Message-State: AN3rC/6lBVaanm5cffmiNa2m4acfFajiGKs6zsLDx2i+SFTbgAXB0tkN 1EHVdffq/PBMWCY7hkg= X-Received: by 10.98.23.23 with SMTP id 23mr8459884pfx.30.1492199302010; Fri, 14 Apr 2017 12:48:22 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id k190sm4697723pge.5.2017.04.14.12.48.20 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 12:48:21 -0700 (PDT) Subject: Re: svn commit: r316874 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_295A5878-6B12-4554-8BA1-06DBD9BD5B5C"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <6942092.OsECkgAp13@overcee.wemm.org> Date: Fri, 14 Apr 2017 12:48:19 -0700 Cc: Maxim Sobolev , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Hiren Panchasara Message-Id: <513B1846-02E3-49E0-BAA2-CA923EDC5DFF@gmail.com> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <12133324.zHp9vo75vZ@overcee.wemm.org> <6942092.OsECkgAp13@overcee.wemm.org> To: Peter Wemm X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 19:48:22 -0000 --Apple-Mail=_295A5878-6B12-4554-8BA1-06DBD9BD5B5C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 12:46, Peter Wemm wrote: >=20 > On Friday, April 14, 2017 12:41:52 PM Maxim Sobolev wrote: >> Thanks, Peter. I will try to look into this asap. >=20 > I don't understand what is going on yet. Presumably there must be = other > changes in play that affect udp/select sometime between the original = 2015 > change and this. The syslogd -s code is Old(TM). I'm also wondering = whether > the -s code even works at all since the 2015 / r285910 change... syslogd has been refactored a lot on ^/head. I don=E2=80=99t think = it=E2=80=99s safe to say that the ^/head and ^/stable/11 and earlier = copies will function the same. Thanks, -Ngie --Apple-Mail=_295A5878-6B12-4554-8BA1-06DBD9BD5B5C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8SeEAAoJEPWDqSZpMIYVkjEQAKWTNBjVhGrwWDyObgZfh4NO EPms3XEhTZZC8nqS/fx4j4mgj00wXuScKSALyBnWwIV/Q4xbI7ftkdsPl80Nefq6 q2tyGRxuhlpB7FXzViEW/TTnT1Ip0DZzQAb4gq5Uur0Nfr3qDSiU3ME0U0kob4yP 9/pTDsj+x8l1TrwYvQOwR7jEx+2bwgtR+NX7pA50RfBs/AgCUIxxBxf1y1Djm2/r /jBA/47P130xUNzCj/Cpfdm73TFuUdj2n5m1B0ARVepwk12snbQJwptg5+2TS9tN KefLlA1BV6lTYfLqhjxJQTt5tpROU71jG4TnFCkCeAK0soxzCU1yVk4gvmnvm+ib XI2/KdpYpx4lrLvnUU0zrT2qbF64Q7DYD5B3S0QQaeeOF5pkSQgQhrJxKfiyHSz3 WCL26Ueyyq9Ok3quDJeM75zyVoBVlwUm80VS9YB3TbO3IwZlNqKG9laa4VKez2/8 mScLMHFQC6t9oyHwYW7Hca9clm7PKaenvit7jbSHr/oiHH6XxH1287bRrpe6053C rluVOZYOHKjxTAjG6uz9b36L1m8hUGSenMdtwm6giS1qRckX1n6YEgK9Id/zFg8m zAbcq+5pHBpyxO32TKMv5qlNH6lT6SwQYV+xQmdd5DhMxMxwEThZafnXTZeXDL44 dbmfE2mrR/RoW1iu3aj1 =uqRp -----END PGP SIGNATURE----- --Apple-Mail=_295A5878-6B12-4554-8BA1-06DBD9BD5B5C-- From owner-svn-src-all@freebsd.org Fri Apr 14 19:49:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C360D3E5A1; Fri, 14 Apr 2017 19:49:53 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yw0-x233.google.com (mail-yw0-x233.google.com [IPv6:2607:f8b0:4002:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF1C2698; Fri, 14 Apr 2017 19:49:52 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yw0-x233.google.com with SMTP id l189so38612669ywb.0; Fri, 14 Apr 2017 12:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=C1FabYwjIqfc5ycgQxc1t6ytsKcmb59yVIMvFQN2zYg=; b=iHbvJixczuQSOLiho1pGnfFqsSsNCbAXSB3Pj8bj+xce7Uwbz3BftlvOZERJDNtoXr jMYb/VOIrF6pEonF5o2XxZM/oMwEUq3HCvFWi3bVH0+1W0n6GyKcLd/2xkQXvKdPw1cg GVOeH8B9L+qk/ar/LrS+juB0wVNNeEoh8ZkRxk7rrl7JHx1K2YhHafEIB52WZBYXdIHs CZR7qsSXJ7/zgnaQI5kIMX84SzwiHvhZazUW/U1SeDlPO9+UNd/E/PXgyr4KuPczu2kN LHWSqCDiX6ttmhEdsXjomswdUViDtAvX+UuvtTXwhKqB2dulESTy546T61v23n0JcQ2F I6BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=C1FabYwjIqfc5ycgQxc1t6ytsKcmb59yVIMvFQN2zYg=; b=XLGe9qTfe2oD5aF87hZF3VzbFH7Ugv2aRSOalt7ElFMhLKFlS59O2VjpiQHh0h6AHW KE4tylu0De6wbzMsDOMIE8gpvpXTIzS/ki+FpHP72KgVFbPTaYLy2b1bxNLvs7bWqZph 1tbgqOrfAhfapmQacxUj0sMuZ34j5UPO9Nz4Foj+RfB3MOIEb6W8mz22R/bGPUI2DP5H zPymraJ5QES/Ik68+26cRb873BhLYl//vZ46P5oGzPLgsfEMODq/5VRGBdWvLZbI9Cjd /+PwxdGQ9Npz7ZldIJKsHxBGf8+QLFvs/GWf5Fh/iF75KsIcsl94SllbrJOKBMz92Oqw ExGQ== X-Gm-Message-State: AN3rC/6dphNIufntR+PG+XzEZPM6y4+NCSwjyKgt1RTYaoiW8RdOXK/P Ih9llk7Cl1oteKxtRsT4HAQQ3biMFuk4 X-Received: by 10.129.154.203 with SMTP id r194mr7164595ywg.252.1492199391588; Fri, 14 Apr 2017 12:49:51 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.20.214 with HTTP; Fri, 14 Apr 2017 12:49:51 -0700 (PDT) In-Reply-To: <201704141941.v3EJfmCW003347@repo.freebsd.org> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> From: Alan Somers Date: Fri, 14 Apr 2017 13:49:51 -0600 X-Google-Sender-Auth: nDfBDp64etuuyVaVZW4vpZRre8M Message-ID: Subject: Re: svn commit: r316938 - head/sbin/savecore To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 19:49:53 -0000 On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: > Author: ngie > Date: Fri Apr 14 19:41:48 2017 > New Revision: 316938 > URL: https://svnweb.freebsd.org/changeset/base/316938 > > Log: > savecore: fix space calculation with respect to `minfree` in check_space(..) > > - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > representable data to INT_MAX. Check the values received from > strtoll(3), trimming trailing whitespace off the end to maintain > POLA. > - Use `KiB` instead of `kB` when describing free space, total space, > etc. I am now fully aware of `KiB` being the IEC standard for 1024 > bytes and `kB` being the IEC standard for 1000 bytes. > - Store available number of KiB in `available` so it can be more > easily queried and compared to ensure that there are enough KiB to > store the dump image on disk. > - Print out the reserved space on disk, per `minfree`, so end-users > can troubleshoot why check_space(..) is reporting that there isn't > enough free space. > > MFC after: 7 weeks > Reviewed by: Anton Rang (earlier diff), cem (earlier diff) > Tested with: positive/negative cases (see review); make tinderbox > Sponsored by: Dell EMC Isilon > Differential Revision: D10379 The free space calculation is still uselessly conservative, because it doesn't account for the fact that core dumps will always be either spare or compressed. The result is that savecore will frequently refuse to save corefiles even when there's plenty of space. I proposed removing the space check altogether in https://reviews.freebsd.org/D2587. However, I agreed to wait until after the compressed core dump feature was merged, because then mostly accurate space checks will be possible. AFAIK the compressed core dump feature still hasn't been finished. -Alan From owner-svn-src-all@freebsd.org Fri Apr 14 19:59:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 237F2D3E857; Fri, 14 Apr 2017 19:59:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7FDBC28; Fri, 14 Apr 2017 19:59:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id i5so16380000pfc.3; Fri, 14 Apr 2017 12:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=2dUsuqeUfLqT86ns1MJ7HYUh3LQxnufSMaWUgtXhgGk=; b=dCiPZKvHSpEJNNnovdIeEUJ8n8ThPr/EUp7pHiZz3/6EdEY00F8kB8j6QJwXKM+cGb LSpscht182mVhEi5eRXuvjM+VOfxPm9ti1wXTlmGwpS5GWhJZElHy6TZ+ZMX49T54E9J 5n0G9AfKamGuI8WSaAmxahbgSEXdgnb+7dMTlh34yR/R3nJ/fphSOIusY4aNglncKDMM lxxHhZmD+T/a1TU+xqZO5zvcFCjGWQhGd1HxKLFXB38xYN5YFk6UGSakA+dRBWFnJY9U BaQT0b7hE/PvZmXoymCGssDke3RjKxxA7D4mgY+VHsmZlGtxFjR+v1ovlFlyrzAxGVKw CEPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=2dUsuqeUfLqT86ns1MJ7HYUh3LQxnufSMaWUgtXhgGk=; b=XsSnWLsN2zDHOnjRG+9HFwXk/iupbnLv4SQ2QkLffVbpgVBCCr/vrv3B+Qumri6ViU mLGkiupcC5kZ8wb+zcfdGXtwl0iebNJ9FiMC/3qBaao4RxGkn35mDgzAXel+QCDNUEbK PW1C0MR2Pw4HsuuXmmivMWoow7/8JE2TFYU8Gg2UAmVMseB3ZAQHNVJPjiaO3+YMjNEg T+vTvYv3MnfRN9vgj0PkvCanbyu2Nhmbal3PczqTxpRWGN/xdVqoWOZC3KH1tDDTrqRM PEhL+3N8M22bFO3yfDx5czn/omOXVG6e1shOFfHXoaHajD61cHLQbVC1HrR6XVVkPgvr 3gMw== X-Gm-Message-State: AN3rC/5NBfhIwqTTraKArBOQIxVXrXf9IF1mbnZ4fCxwh+4cNHs+RO40 Z6n5j1pE3EtyRzqxSeA= X-Received: by 10.99.253.5 with SMTP id d5mr8566739pgh.47.1492199941167; Fri, 14 Apr 2017 12:59:01 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id u22sm4697072pgo.67.2017.04.14.12.59.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 12:59:00 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_69D9A5FD-DCAF-404A-BB19-ACFAB5E1FD7B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Fri, 14 Apr 2017 12:58:59 -0700 Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <499FA6FF-E691-4941-B96C-3806072D14AA@gmail.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 19:59:02 -0000 --Apple-Mail=_69D9A5FD-DCAF-404A-BB19-ACFAB5E1FD7B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 12:49, Alan Somers wrote: >=20 > On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: >> Author: ngie >> Date: Fri Apr 14 19:41:48 2017 >> New Revision: 316938 >> URL: https://svnweb.freebsd.org/changeset/base/316938 >>=20 >> Log: >> savecore: fix space calculation with respect to `minfree` in = check_space(..) >>=20 >> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >> representable data to INT_MAX. Check the values received from >> strtoll(3), trimming trailing whitespace off the end to maintain >> POLA. >> - Use `KiB` instead of `kB` when describing free space, total space, >> etc. I am now fully aware of `KiB` being the IEC standard for 1024 >> bytes and `kB` being the IEC standard for 1000 bytes. >> - Store available number of KiB in `available` so it can be more >> easily queried and compared to ensure that there are enough KiB to >> store the dump image on disk. >> - Print out the reserved space on disk, per `minfree`, so end-users >> can troubleshoot why check_space(..) is reporting that there isn't >> enough free space. >>=20 >> MFC after: 7 weeks >> Reviewed by: Anton Rang (earlier diff), cem (earlier = diff) >> Tested with: positive/negative cases (see review); make tinderbox >> Sponsored by: Dell EMC Isilon >> Differential Revision: D10379 >=20 > The free space calculation is still uselessly conservative, because it > doesn't account for the fact that core dumps will always be either > spare or compressed. The result is that savecore will frequently > refuse to save corefiles even when there's plenty of space. I > proposed removing the space check altogether in > https://reviews.freebsd.org/D2587. However, I agreed to wait until > after the compressed core dump feature was merged, because then mostly > accurate space checks will be possible. AFAIK the compressed core > dump feature still hasn't been finished. That CR concerns me. The whole being able to check how much space we have on disk before = dumping is a wonderful tool because it prevents users from having = /var/crash be full of truncated full dumps, text dumps, and/or mini = dumps. The real problem that you=E2=80=99re bringing up is that the size being = passed in to check_size(..) is wrong. It needs to be the on-disk size = (which can be a pessimization from gzip/zlib), not the in-memory size of = all of the dumped pages. Thanks for the note =E2=80=94 this helps me with another related issue = at $work that will likely prevent me from being able to write proper = tests to test out panic dumps on OneFS :). Cheers! -Ngie --Apple-Mail=_69D9A5FD-DCAF-404A-BB19-ACFAB5E1FD7B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8SoDAAoJEPWDqSZpMIYV7voQAKbufDeLzoHSyypP7EJKI49d 3s+0YWJUpPNC6JSxxzMF5CBEJvdPYrjXlPsLiswrwjxwN9DhH3MipoO+KKwvH6q0 XU91WgtlgKoEb93DN7/SE1NeEDBwBT/v/iQYlay+jEQT8Oc7gZJk+FuVuuJBec6d Fx+r1tq7JYSUHUEHVyMBJj9v3n9CjGxm0Cf7g9bWICwJZto9gbwMxMsVeB9Wl37w i2l83PNRGbUy5fduu+xwYgDRfGV/1tA88zwT+bl87mX1TEMkExAO3ZVTbVgVktkc /hS6x/Ao1+l5EcbI/7sDJ20yW8hVv/XCkO+ysOCJNbWCb355BiQXypvFi/oCOTEl CO3+YOadHsPEArC5dbsczI+lTcH/e8pY0d+EteoN7b4UiOQkIn6+ZjfC7Zih36ZM kcvPG367Wdzjhcb5YJSqQEZ3nNHM5pVeHWnIr6Vc/ul1ECYNq/aRLPG1DGd+fhGa x3zVPhCj1ouq5Tb/lNbsAjCh5sOThRC6172Sn3V8vln673mr2ZNl/z+T8lmv6RHo FjYh7gQS3oorcrsPINBakEf9I8rzWVD7Xj4mMdfbUgS09rRyzVN53HDWGfUbWKzB z0LwE46P0IvofiYl+b8Q3FiZscag3MSn5dRadFeFe/F9DQG+mwG9jtjl/FL1o6XV AVe62xAQbTWB01VUPAbE =r1XN -----END PGP SIGNATURE----- --Apple-Mail=_69D9A5FD-DCAF-404A-BB19-ACFAB5E1FD7B-- From owner-svn-src-all@freebsd.org Fri Apr 14 20:02:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A25DDD3EA16; Fri, 14 Apr 2017 20:02:26 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yw0-x22d.google.com (mail-yw0-x22d.google.com [IPv6:2607:f8b0:4002:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5ED1D8D; Fri, 14 Apr 2017 20:02:26 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yw0-x22d.google.com with SMTP id j9so38734649ywj.3; Fri, 14 Apr 2017 13:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=vAjVSUbuLlx43u8jTu+lI3olwW+D77R43yXKBe3r3Tw=; b=pD8yb4/rZgW4GM9Srnq4Vcnsss+d9k77kLJyqCrejEg73+DrIAN8nfJNHutCsrUsFn Z9+yxL1C/1kqxgoJg0olLMr1xEKQQCpSDK7pdQsVaeraU5bA8JcH41gtrbD5sBwHWK8k aQFNnQtioSFVyeOUDpZsj9iAhNiM8txAIfgFUkraQPq1sXrPsLXRMaJGRfA1F/wLNcvr htJewdUcaYrOm8z+PlDb/7GbNZEsex4iOdBTvwODQUxE9awPIKTOL8UneP4+GsZR99XX vJ+JsDPwuO7NINZFx4W/iy4uFbfigchnNJQ8M4fGd8pfsbvVlc+B+lrwE3Bpq202MX/4 wvGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=vAjVSUbuLlx43u8jTu+lI3olwW+D77R43yXKBe3r3Tw=; b=CzroFN+bVDc+LDbJbc4wRRX1p7Kq4Rg2zuXpPnJdoGwnR+zocenRcxlG56YkE8Fjsh NvWmG0m1BYEJ/TBsxMl8nPuDeIG7B6dven+U3ZmP4glZdU3Y1E2GfDSW1MoDQ8EUZUxu Y7kfhLzIe/DASckfBNMTGsOEzsVPXIOLWzq7HIn5aifP8MJXHULaqUkaWXfw3bkqArLk Z1PWHBZCocEX9sDzHoeYrXQCaaFzMwy0yiJOu0EP5g/NkUwo98chO/mXKAMiHdSnQe8g Wg44G73Oex6AmLGci0+2l818Nd308DjLYQVYbsOBaRBj+/hrFp0e+IHJAC4jcSPT71LC 1L0A== X-Gm-Message-State: AN3rC/5HvCunv64nc5jHvzQbU127yJxFjqyBpNV8ABZ1imsOiBL6bIfd YM095UeULJyn722MCuHK8HMbd2Mz9g== X-Received: by 10.129.173.69 with SMTP id l5mr7325877ywk.351.1492200145360; Fri, 14 Apr 2017 13:02:25 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.20.214 with HTTP; Fri, 14 Apr 2017 13:02:24 -0700 (PDT) In-Reply-To: <499FA6FF-E691-4941-B96C-3806072D14AA@gmail.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <499FA6FF-E691-4941-B96C-3806072D14AA@gmail.com> From: Alan Somers Date: Fri, 14 Apr 2017 14:02:24 -0600 X-Google-Sender-Auth: pEMtt7mKqj2zrkS9xyxsVjfjzq0 Message-ID: Subject: Re: svn commit: r316938 - head/sbin/savecore To: "Ngie Cooper (yaneurabeya)" Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:02:26 -0000 On Fri, Apr 14, 2017 at 1:58 PM, Ngie Cooper (yaneurabeya) wrote: > >> On Apr 14, 2017, at 12:49, Alan Somers wrote: >> >> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: >>> Author: ngie >>> Date: Fri Apr 14 19:41:48 2017 >>> New Revision: 316938 >>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>> >>> Log: >>> savecore: fix space calculation with respect to `minfree` in check_spa= ce(..) >>> >>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>> representable data to INT_MAX. Check the values received from >>> strtoll(3), trimming trailing whitespace off the end to maintain >>> POLA. >>> - Use `KiB` instead of `kB` when describing free space, total space, >>> etc. I am now fully aware of `KiB` being the IEC standard for 1024 >>> bytes and `kB` being the IEC standard for 1000 bytes. >>> - Store available number of KiB in `available` so it can be more >>> easily queried and compared to ensure that there are enough KiB to >>> store the dump image on disk. >>> - Print out the reserved space on disk, per `minfree`, so end-users >>> can troubleshoot why check_space(..) is reporting that there isn't >>> enough free space. >>> >>> MFC after: 7 weeks >>> Reviewed by: Anton Rang (earlier diff), cem (earlier d= iff) >>> Tested with: positive/negative cases (see review); make tinderbox >>> Sponsored by: Dell EMC Isilon >>> Differential Revision: D10379 >> >> The free space calculation is still uselessly conservative, because it >> doesn't account for the fact that core dumps will always be either >> spare or compressed. The result is that savecore will frequently >> refuse to save corefiles even when there's plenty of space. I >> proposed removing the space check altogether in >> https://reviews.freebsd.org/D2587. However, I agreed to wait until >> after the compressed core dump feature was merged, because then mostly >> accurate space checks will be possible. AFAIK the compressed core >> dump feature still hasn't been finished. > > That CR concerns me. > > The whole being able to check how much space we have on disk before dumpi= ng is a wonderful tool because it prevents users from having /var/crash be = full of truncated full dumps, text dumps, and/or mini dumps. > > The real problem that you=E2=80=99re bringing up is that the size being p= assed in to check_size(..) is wrong. It needs to be the on-disk size (which= can be a pessimization from gzip/zlib), not the in-memory size of all of t= he dumped pages. > > Thanks for the note =E2=80=94 this helps me with another related issue at= $work that will likely prevent me from being able to write proper tests to= test out panic dumps on OneFS :). > > Cheers! > -Ngie Right: check_size() needs to know the on-disk size of the core dump. But it doesn't have any way to know the on-disk size until after it's written everything to disk. That's why I simply disabled the check at $WORK. Another possibility would be for savecore to ignore the up-front check, but handle ENOSPC by deleting the fragmentary vmcore file. I never tried to implement that. -Alan From owner-svn-src-all@freebsd.org Fri Apr 14 20:04:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E60D3EA9D; Fri, 14 Apr 2017 20:04:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 217DA1FD; Fri, 14 Apr 2017 20:04:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x230.google.com with SMTP id s16so44179652pfs.0; Fri, 14 Apr 2017 13:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=ZebSJd16E7ja05nWnz39h9nKWC2zCPpDy73zRsqwB44=; b=gvq+YFJAXHClT2fyhZ6qWT2AsnwEnadAQZA3bOi2+ooNJepC8HIOEID/slfLs1fcaT 04du6qdOfP4zRPwly8FJMDAmtEPX8Ba1lXznsoMkrny0p2N9WPc71Wx41FU2hjpDh2X9 Zfl8ln0ik/dwaZbuIxMjQdJtLFzb8NM+G/w/VlfCjzXC0ns5Qxf9FGrb7TFGU9nOQkLE A5LwzmFhnukoQ4CKGwG8bC2OwX/CFbgwBSkZSHPU5SUVqrUBShCxA1HGnMQe4bA2xuTi 2YGQxElf2LSJs91wAtsVazTkNSOKXu8IWnTvX0vC3Jagr4W78ojPhzcKL6IR4dh72Shg /pLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=ZebSJd16E7ja05nWnz39h9nKWC2zCPpDy73zRsqwB44=; b=aSGCXZmMTEWOXsQu/AWaUAkGcC3l6d1VRKDJTjs5bjn+O0DmrXWRtOrHnLv3rJrwme JkbMtZwG6jpWLHmP6u0b5dxqkc81NAgA8ocsOB0W+Iy/zW6ruPBU53UerGoI8pbHgnkx wbcp3N5id5HVBmXnQWrMinOsA5gCmUajzf8+fBXHLr/wAfwHc4TIACMniwEVoTGzhZZs R7lR72QynAGyMuDgArylsZ+VekzuXj5bSQOJZeWpP6C8aVTDxogcUTBlCRGLS3lghTix 8zGyRdrCspMFe7SL4aT0xeZml9hAObMyeImMfOFzjeox1MwuOzGxR37byxBPHErkz7YQ 8vqg== X-Gm-Message-State: AN3rC/6I8czDtu7ct1qCyLdaiuQNNQfBqsfnHkYbldSnmAuv2dFS2fxw wBmUWGaQNOQ03cx4Vd8= X-Received: by 10.99.223.70 with SMTP id h6mr8945310pgj.50.1492200275476; Fri, 14 Apr 2017 13:04:35 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id b128sm4727562pgc.16.2017.04.14.13.04.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 13:04:34 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_9D992930-BC47-4C34-9469-C80D9504EB99"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Fri, 14 Apr 2017 13:04:33 -0700 Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <7DCBB59B-388F-463D-8FFF-06390E5B5165@gmail.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <499FA6FF-E691-4941-B96C-3806072D14AA@gmail.com> To: Alan Somers X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:04:36 -0000 --Apple-Mail=_9D992930-BC47-4C34-9469-C80D9504EB99 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Apr 14, 2017, at 13:02, Alan Somers wrote: ... > Right: check_size() needs to know the on-disk size of the core dump. > But it doesn't have any way to know the on-disk size until after it's > written everything to disk. That's why I simply disabled the check at > $WORK. Another possibility would be for savecore to ignore the > up-front check, but handle ENOSPC by deleting the fragmentary vmcore > file. I never tried to implement that. Let me dig through the gzip format a bit. There should be a reasonably = good upper bound approximation that we can use for compressed minidumps. Thanks! -Ngie --Apple-Mail=_9D992930-BC47-4C34-9469-C80D9504EB99 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8StRAAoJEPWDqSZpMIYVHy4P/3WBVmu2EtkkpvcIGCcO/2Bx YGCw021TgUG5BP1YF99gQUwgRaIk0cX6wj1XQxqS+UOyZPmsiyVGA64qF0ExibGt U1D8e8wBx/cz/3i0czH4oWGvboeN3S/5GRPDfPLcXKqqrBJIXw7a58zuS8Zvm6W8 2xHRD6DtxwsPW5RSPYnWcyb0Dvya1Y7U6BnEmirVjlKxbWeQE3zYiVuMvXiPoIUy TSMvO5gKpWuRkvg9uz8Uzl9d0pb6Z6EHm8UI6uUXDq4oZCULCkrG0quloedQTu5m EWRnK6Y6xxXNt1g8zre7/Ivyixs/7JirXVRpiYtSLNT4FOCXbYeF7iFiLdkOpZlN Xffz3wvw4l9a48Z/2gAEHd8D10NdmYMU5sfkykeCJMjHnBL+DScPxZb4HdOD9PDi 1Jj7pfSDZAk3E6FEV6z2i3wOlnwVI/r0UFORDX3M2bPjHCrI4PI6lRMZSiVUSqSE IqvkEMM9iI1twKKbS0F3UF8znbS3SPfX2FJ3WaG21plXMTCGoWU2k0PWIPn1FFHj yMgfTZUnFgvTywsQNVNe1newV663kYZxX0iXB8glmtGmw4nWi+eqcGQWSVJhJsNN A+8uayzrRspjr4RhQfBBirb4JbbNQ5vClkdkvISD0W88m6Nf8YT3iswgzPZwoYBn 96RzsLFZZ9HWLxUvLZze =Q9El -----END PGP SIGNATURE----- --Apple-Mail=_9D992930-BC47-4C34-9469-C80D9504EB99-- From owner-svn-src-all@freebsd.org Fri Apr 14 20:07:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 130D2D3EB54; Fri, 14 Apr 2017 20:07:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x229.google.com (mail-pg0-x229.google.com [IPv6:2607:f8b0:400e:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE38F3D6; Fri, 14 Apr 2017 20:07:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x229.google.com with SMTP id 21so47247360pgg.1; Fri, 14 Apr 2017 13:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=yiuIOuGgHvcF9QEPTc6Ud+VoZlP4Bs8fN9mWL+y0jv8=; b=RCL9DK2Vpdh1ZuYau4h3Jcr5IJBRhxY3EcYtRap4W4Rg/PtAPLAOwmE4rierNd0mAc VdAHxWDBIO45hK9IpEC2FzCqhlYgD6DRwnFCHPM9iLnZpeAXYca+UVBUslmS/8V74oXe g8GoSu0cgacaiC7TYtaPOQBx1cglDYuoOQ+WFt+LlfOR9dzebin1zDXn00f4pE55Klli o4eQAPikP8kFk7cDk4CZAiCcJtghSEMRL9EXyau4U/K8rW/IztRaJ0Pes0HsBv32Ti5k YlyvIOzYYCkOTBsyDU41erWv/lUg+ggE00GfrZ9gqKZL5aHxo9ztMS+BQD2JQTGLoe/0 ijIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=yiuIOuGgHvcF9QEPTc6Ud+VoZlP4Bs8fN9mWL+y0jv8=; b=kGSbjHvUAD3S7+ffxTlOmDcq6ZUoRr0VYSU47QdL0svfZPSdY9GjaitKn8yAexG04J jKpqux+kGIbIdAC5moRQwEcgRqCU+LL56BMlLoWool7DSqz9O0tr4ihfDEuK1G51nLjv HCg2jXiCQNPwmfJYcepa8IedXXaFhv7wk8Jbt5p0MwcAPQeoYhCIxSmJ3xla98Cq3dD4 OiPISOHvvuSst6APi8sW3yH7LfujOs/OiufyG01EYV1tDJ+MjfJB+dnGlKpWj0+O7kg1 AkcNBSDBKD8hnufBIndCYHVnMuTAm4jWRXH56/uqbWBMxt3apKIGnYXOSgZqhePioUx0 AyeQ== X-Gm-Message-State: AN3rC/5FRxim5S/OWIZORC+s3tFRo/t0Vhf6EiuR9bUfX4yNZT2IVLM3 00O29YRUT8UObS/cBBg= X-Received: by 10.99.61.130 with SMTP id k124mr8572887pga.68.1492200424177; Fri, 14 Apr 2017 13:07:04 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id a77sm4732452pfj.1.2017.04.14.13.07.02 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 13:07:03 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_A38279AE-4145-470F-902C-5F719E69AB0A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <7DCBB59B-388F-463D-8FFF-06390E5B5165@gmail.com> Date: Fri, 14 Apr 2017 13:07:02 -0700 Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <25EDEFF2-4993-4C95-B005-8670DF513B72@gmail.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <499FA6FF-E691-4941-B96C-3806072D14AA@gmail.com> <7DCBB59B-388F-463D-8FFF-06390E5B5165@gmail.com> To: Alan Somers X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:07:05 -0000 --Apple-Mail=_A38279AE-4145-470F-902C-5F719E69AB0A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Apr 14, 2017, at 13:04, Ngie Cooper (yaneurabeya) = wrote: >=20 >=20 >> On Apr 14, 2017, at 13:02, Alan Somers wrote: >=20 > ... >=20 >> Right: check_size() needs to know the on-disk size of the core dump. >> But it doesn't have any way to know the on-disk size until after it's >> written everything to disk. That's why I simply disabled the check = at >> $WORK. Another possibility would be for savecore to ignore the >> up-front check, but handle ENOSPC by deleting the fragmentary vmcore >> file. I never tried to implement that. >=20 > Let me dig through the gzip format a bit. There should be a reasonably = good upper bound approximation that we can use for compressed mini = dumps. Also: deleting truncated dumps sounds great to me: their value when = truncated is pretty low from what I remember. -Ngie --Apple-Mail=_A38279AE-4145-470F-902C-5F719E69AB0A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8SvmAAoJEPWDqSZpMIYVMwUP/is9SwaUluIZqVpzW7koduPG DNu4ejTX6ZgR0YZ8//+PiTNI4S7WfKUiCZdeIaScDDQWtftLRWUzKyhvSnyfPwLg /WPc5+NDjpih7rwmMvXm+uBRV6VhQosY83cl81DSBD7q3bhC8g00WLDH8325xaFe OPUWG2XCzyo2jzTXeABHxiX1Px/+L/+17UzorBxhnXrNAxlzBkjKwrWucmu2oef5 YgfPM/M3CkqCNPsbnVCiTQ2VQR3EsOGd6IAfJ7sQkcWiRE5o9hmpIpT62s05sftr rGjOiEXlgfMmRpxRE2r7StJ5ltPorwMI61Svc8cNTLbsOxJPwd5D4l8qvpSwVvWf HicHbLVkXegMt3yOfkD7d6aQ+PzUW68kz4zHnr8JaaTxhqEUc8fRpfeiMtyZTl2T twoD7nShU0r4whbvRfTO5nozzhVHlHwSuuvsNbEeLOyEx0hi2sv2IuN6HoV2WdHP wmSDua3qlFZYPfiFj64mXDvr8ncKkjBNQ4ycuQQVObqQrc8IfV7/P0NSwDVLaxzm 0nd+qDE+Tna18ThBwZXFOHrR0Cl91TYPL4GkHF5pdrL3VJeVWL9Xgcae79DqRWK5 YXsTk0v4dswr4gLCs3buI2Hl+wfqCGJHT5UH8fAOK2OCuHwx/ZhWvhH6K9eFjL5J 9PsHnv/15xiDkLzUhrtV =9WWL -----END PGP SIGNATURE----- --Apple-Mail=_A38279AE-4145-470F-902C-5F719E69AB0A-- From owner-svn-src-all@freebsd.org Fri Apr 14 20:10:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63A56D3EC0A; Fri, 14 Apr 2017 20:10:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3311D7C2; Fri, 14 Apr 2017 20:10:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EKAIlK013843; Fri, 14 Apr 2017 20:10:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EKAINl013842; Fri, 14 Apr 2017 20:10:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201704142010.v3EKAINl013842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 14 Apr 2017 20:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316939 - head/lib/lib80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:10:19 -0000 Author: adrian Date: Fri Apr 14 20:10:18 2017 New Revision: 316939 URL: https://svnweb.freebsd.org/changeset/base/316939 Log: [lib80211] fix a missing cleanup path. PR: lib/218655 Reported by: Modified: head/lib/lib80211/lib80211_regdomain.c Modified: head/lib/lib80211/lib80211_regdomain.c ============================================================================== --- head/lib/lib80211/lib80211_regdomain.c Fri Apr 14 19:41:48 2017 (r316938) +++ head/lib/lib80211/lib80211_regdomain.c Fri Apr 14 20:10:18 2017 (r316939) @@ -569,6 +569,7 @@ cleanup_bands(netband_head *head) nb = LIST_FIRST(head); if (nb == NULL) break; + LIST_REMOVE(nb, next); free(nb); } } From owner-svn-src-all@freebsd.org Fri Apr 14 20:14:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF5E8D3EFA4; Fri, 14 Apr 2017 20:14:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B431C96; Fri, 14 Apr 2017 20:14:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cz7bz-000AG5-Js; Fri, 14 Apr 2017 23:14:31 +0300 Date: Fri, 14 Apr 2017 23:14:31 +0300 From: Slawa Olhovchenkov To: Alan Somers Cc: Ngie Cooper , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170414201431.GF20974@zxy.spb.ru> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:14:39 -0000 On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: > On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: > > Author: ngie > > Date: Fri Apr 14 19:41:48 2017 > > New Revision: 316938 > > URL: https://svnweb.freebsd.org/changeset/base/316938 > > > > Log: > > savecore: fix space calculation with respect to `minfree` in check_space(..) > > > > - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > > representable data to INT_MAX. Check the values received from > > strtoll(3), trimming trailing whitespace off the end to maintain > > POLA. > > - Use `KiB` instead of `kB` when describing free space, total space, > > etc. I am now fully aware of `KiB` being the IEC standard for 1024 > > bytes and `kB` being the IEC standard for 1000 bytes. > > - Store available number of KiB in `available` so it can be more > > easily queried and compared to ensure that there are enough KiB to > > store the dump image on disk. > > - Print out the reserved space on disk, per `minfree`, so end-users > > can troubleshoot why check_space(..) is reporting that there isn't > > enough free space. > > > > MFC after: 7 weeks > > Reviewed by: Anton Rang (earlier diff), cem (earlier diff) > > Tested with: positive/negative cases (see review); make tinderbox > > Sponsored by: Dell EMC Isilon > > Differential Revision: D10379 > > The free space calculation is still uselessly conservative, because it > doesn't account for the fact that core dumps will always be either > spare or compressed. The result is that savecore will frequently > refuse to save corefiles even when there's plenty of space. I > proposed removing the space check altogether in > https://reviews.freebsd.org/D2587. However, I agreed to wait until > after the compressed core dump feature was merged, because then mostly > accurate space checks will be possible. AFAIK the compressed core > dump feature still hasn't been finished. Is posible (in the future) to use multiple swaps (on multiple disks) for save core dumps? From owner-svn-src-all@freebsd.org Fri Apr 14 20:15:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9447D3A00A; Fri, 14 Apr 2017 20:15:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A496DEB; Fri, 14 Apr 2017 20:15:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EKFH3u017570; Fri, 14 Apr 2017 20:15:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EKFHrT017566; Fri, 14 Apr 2017 20:15:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201704142015.v3EKFHrT017566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 14 Apr 2017 20:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316940 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:15:18 -0000 Author: np Date: Fri Apr 14 20:15:17 2017 New Revision: 316940 URL: https://svnweb.freebsd.org/changeset/base/316940 Log: cxgbe/iw_cxgbe: Report the actual values of various parameters as configured by the firmware. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c head/sys/dev/cxgbe/iw_cxgbe/qp.c head/sys/dev/cxgbe/iw_cxgbe/t4.h Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/provider.c Fri Apr 14 20:10:18 2017 (r316939) +++ head/sys/dev/cxgbe/iw_cxgbe/provider.c Fri Apr 14 20:15:17 2017 (r316940) @@ -307,6 +307,7 @@ c4iw_query_device(struct ib_device *ibde { struct c4iw_dev *dev = to_c4iw_dev(ibdev); struct adapter *sc = dev->rdev.adap; + const int spg_ndesc = sc->params.sge.spg_len / EQ_ESIZE; CTR3(KTR_IW_CXGBE, "%s ibdev %p, props %p", __func__, ibdev, props); @@ -320,13 +321,15 @@ c4iw_query_device(struct ib_device *ibde props->vendor_id = pci_get_vendor(sc->dev); props->vendor_part_id = pci_get_device(sc->dev); props->max_mr_size = T4_MAX_MR_SIZE; - props->max_qp = T4_MAX_NUM_QP; - props->max_qp_wr = T4_MAX_QP_DEPTH; + props->max_qp = sc->vres.qp.size / 2; + props->max_qp_wr = T4_MAX_QP_DEPTH(spg_ndesc); props->max_sge = T4_MAX_RECV_SGE; props->max_sge_rd = 1; - props->max_qp_rd_atom = c4iw_max_read_depth; - props->max_qp_init_rd_atom = c4iw_max_read_depth; - props->max_cq = T4_MAX_NUM_CQ; + props->max_res_rd_atom = sc->params.max_ird_adapter; + props->max_qp_rd_atom = min(sc->params.max_ordird_qp, + c4iw_max_read_depth); + props->max_qp_init_rd_atom = props->max_qp_rd_atom; + props->max_cq = sc->vres.qp.size; props->max_cqe = T4_MAX_CQ_DEPTH; props->max_mr = c4iw_num_stags(&dev->rdev); props->max_pd = T4_MAX_NUM_PD; Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Apr 14 20:10:18 2017 (r316939) +++ head/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Apr 14 20:15:17 2017 (r316940) @@ -133,6 +133,7 @@ static int create_qp(struct c4iw_rdev *r int ret; int eqsize; struct wrqe *wr; + const int spg_ndesc = sc->params.sge.spg_len / EQ_ESIZE; wq->sq.qid = c4iw_get_qpid(rdev, uctx); if (!wq->sq.qid) @@ -214,8 +215,7 @@ static int create_qp(struct c4iw_rdev *r res->u.sqrq.op = FW_RI_RES_OP_WRITE; /* eqsize is the number of 64B entries plus the status page size. */ - eqsize = wq->sq.size * T4_SQ_NUM_SLOTS + - (sc->params.sge.spg_len / EQ_ESIZE); + eqsize = wq->sq.size * T4_SQ_NUM_SLOTS + spg_ndesc; res->u.sqrq.fetchszm_to_iqid = cpu_to_be32( V_FW_RI_RES_WR_HOSTFCMODE(0) | /* no host cidx updates */ @@ -237,8 +237,7 @@ static int create_qp(struct c4iw_rdev *r res->u.sqrq.op = FW_RI_RES_OP_WRITE; /* eqsize is the number of 64B entries plus the status page size. */ - eqsize = wq->rq.size * T4_RQ_NUM_SLOTS + - (sc->params.sge.spg_len / EQ_ESIZE); + eqsize = wq->rq.size * T4_RQ_NUM_SLOTS + spg_ndesc; res->u.sqrq.fetchszm_to_iqid = cpu_to_be32( V_FW_RI_RES_WR_HOSTFCMODE(0) | /* no host cidx updates */ V_FW_RI_RES_WR_CPRIO(0) | /* don't keep in chip cache */ @@ -1523,7 +1522,7 @@ c4iw_create_qp(struct ib_pd *pd, struct struct c4iw_create_qp_resp uresp; int sqsize, rqsize; struct c4iw_ucontext *ucontext; - int ret; + int ret, spg_ndesc; struct c4iw_mm_entry *mm1, *mm2, *mm3, *mm4; CTR2(KTR_IW_CXGBE, "%s ib_pd %p", __func__, pd); @@ -1541,12 +1540,13 @@ c4iw_create_qp(struct ib_pd *pd, struct if (attrs->cap.max_inline_data > T4_MAX_SEND_INLINE) return ERR_PTR(-EINVAL); + spg_ndesc = rhp->rdev.adap->params.sge.spg_len / EQ_ESIZE; rqsize = roundup(attrs->cap.max_recv_wr + 1, 16); - if (rqsize > T4_MAX_RQ_SIZE) + if (rqsize > T4_MAX_RQ_SIZE(spg_ndesc)) return ERR_PTR(-E2BIG); sqsize = roundup(attrs->cap.max_send_wr + 1, 16); - if (sqsize > T4_MAX_SQ_SIZE) + if (sqsize > T4_MAX_SQ_SIZE(spg_ndesc)) return ERR_PTR(-E2BIG); ucontext = pd->uobject ? to_c4iw_ucontext(pd->uobject->context) : NULL; @@ -1556,9 +1556,10 @@ c4iw_create_qp(struct ib_pd *pd, struct if (!qhp) return ERR_PTR(-ENOMEM); qhp->wq.sq.size = sqsize; - qhp->wq.sq.memsize = (sqsize + 1) * sizeof *qhp->wq.sq.queue; + qhp->wq.sq.memsize = (sqsize + spg_ndesc) * sizeof *qhp->wq.sq.queue + + 16 * sizeof(__be64); qhp->wq.rq.size = rqsize; - qhp->wq.rq.memsize = (rqsize + 1) * sizeof *qhp->wq.rq.queue; + qhp->wq.rq.memsize = (rqsize + spg_ndesc) * sizeof *qhp->wq.rq.queue; if (ucontext) { qhp->wq.sq.memsize = roundup(qhp->wq.sq.memsize, PAGE_SIZE); Modified: head/sys/dev/cxgbe/iw_cxgbe/t4.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 20:10:18 2017 (r316939) +++ head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 20:15:17 2017 (r316940) @@ -59,21 +59,17 @@ #define CIDXINC_SHIFT 0 #define CIDXINC(x) ((x) << CIDXINC_SHIFT) -#define T4_MAX_NUM_QP (1<<16) -#define T4_MAX_NUM_CQ (1<<15) #define T4_MAX_NUM_PD 65536 -#define T4_EQ_STATUS_ENTRIES (L1_CACHE_BYTES > 64 ? 2 : 1) -#define T4_MAX_EQ_SIZE (65520 - T4_EQ_STATUS_ENTRIES) -#define T4_MAX_IQ_SIZE (65520 - 1) -#define T4_MAX_RQ_SIZE (8192 - T4_EQ_STATUS_ENTRIES) -#define T4_MAX_SQ_SIZE (T4_MAX_EQ_SIZE - 1) -#define T4_MAX_QP_DEPTH (T4_MAX_RQ_SIZE - 1) -#define T4_MAX_CQ_DEPTH (T4_MAX_IQ_SIZE - 1) +#define T4_MAX_EQ_SIZE 65520 +#define T4_MAX_IQ_SIZE 65520 +#define T4_MAX_RQ_SIZE(n) (8192 - (n) - 1) +#define T4_MAX_SQ_SIZE(n) (T4_MAX_EQ_SIZE - (n) - 1) +#define T4_MAX_QP_DEPTH(n) (T4_MAX_RQ_SIZE(n)) +#define T4_MAX_CQ_DEPTH (T4_MAX_IQ_SIZE - 2) #define T4_MAX_MR_SIZE (~0ULL - 1) #define T4_PAGESIZE_MASK 0xffffffff000 /* 4KB-8TB */ #define T4_STAG_UNSET 0xffffffff #define T4_FW_MAJ 0 -#define T4_EQ_STATUS_ENTRIES (L1_CACHE_BYTES > 64 ? 2 : 1) #define A_PCIE_MA_SYNC 0x30b4 struct t4_status_page { From owner-svn-src-all@freebsd.org Fri Apr 14 20:15:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0029D3A063; Fri, 14 Apr 2017 20:15:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 774DDEF9; Fri, 14 Apr 2017 20:15:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EKFYsQ017624; Fri, 14 Apr 2017 20:15:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EKFYWA017623; Fri, 14 Apr 2017 20:15:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704142015.v3EKFYWA017623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 14 Apr 2017 20:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316941 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:15:35 -0000 Author: trasz Date: Fri Apr 14 20:15:34 2017 New Revision: 316941 URL: https://svnweb.freebsd.org/changeset/base/316941 Log: Don't try to write out bufs that have already failed with ENXIO. This fixes some panics after disconnecting mounted disks. Submitted by: imp (slightly different version, which I've then lost) Reviewed by: kib, imp, mckusick MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D9674 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Apr 14 20:15:17 2017 (r316940) +++ head/sys/kern/vfs_bio.c Fri Apr 14 20:15:34 2017 (r316941) @@ -2290,18 +2290,28 @@ brelse(struct buf *bp) bdirty(bp); } if (bp->b_iocmd == BIO_WRITE && (bp->b_ioflags & BIO_ERROR) && + (bp->b_error != ENXIO || !LIST_EMPTY(&bp->b_dep)) && !(bp->b_flags & B_INVAL)) { /* - * Failed write, redirty. Must clear BIO_ERROR to prevent - * pages from being scrapped. + * Failed write, redirty. All errors except ENXIO (which + * means the device is gone) are expected to be potentially + * transient - underlying media might work if tried again + * after EIO, and memory might be available after an ENOMEM. + * + * Do this also for buffers that failed with ENXIO, but have + * non-empty dependencies - the soft updates code might need + * to access the buffer to untangle them. + * + * Must clear BIO_ERROR to prevent pages from being scrapped. */ bp->b_ioflags &= ~BIO_ERROR; bdirty(bp); } else if ((bp->b_flags & (B_NOCACHE | B_INVAL)) || (bp->b_ioflags & BIO_ERROR) || (bp->b_bufsize <= 0)) { /* - * Either a failed read I/O or we were asked to free or not - * cache the buffer. + * Either a failed read I/O, or we were asked to free or not + * cache the buffer, or we failed to write to a device that's + * no longer present. */ bp->b_flags |= B_INVAL; if (!LIST_EMPTY(&bp->b_dep)) From owner-svn-src-all@freebsd.org Fri Apr 14 20:19:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9D3BD3A190; Fri, 14 Apr 2017 20:19:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4CA110D6; Fri, 14 Apr 2017 20:19:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id g2so17747784pge.2; Fri, 14 Apr 2017 13:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=jJo3k3OACHc01NZ8uBPNNbceYVwkKcvH3Bt72g26Oe4=; b=bH/dl/JXE8n6VXGD1DyeICnAVUne1XbeiHSKFSmiVtvEjgzPcBqRbuFcLx1pThbYdV F89EZPzj44JMyC/6Jd9cpC5fX4/bODHEXmQDroVUfzqUcew+fdDBMHOWZqtl5hlp6Vaj o+CfHwRwMQxMVgTW3vk/7SOJxL0N6hBQ8VCAaRFSjgHhD17QBuuRxrkgUrqn64BWrEYo C07T2rFlfq+1YIN8EF37vGFRthZ2jisvtYvzgMHpVj6lB23N9u5In39sPggNR4KHwWEg BnCc550/vkh/A8rgefhaaR4QYM8g9d7V5GFQANvvHMf99Zt863k4KBNKQVAfGgrtXt30 Xwlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=jJo3k3OACHc01NZ8uBPNNbceYVwkKcvH3Bt72g26Oe4=; b=ZS7W74EmRvU0TchpOnUsTi4Q4kqMOZAiiMkVZE01TpWupmi1XB0zCm0NHufJBP/Vam GHXK/y3YSRLEXJbV6XVZvPYsvYkv8I2ezk0EI6U3rlB3S36Ns7rxMIZlR85gj/w7uHXO VEpV0m9yk1zqQf3Dd0s+Sq7p6QTVkp6yitNaFXG3YsJg128VGAq3VK7VfWH5cNzHvqwb pclTIpRPXDtcdBO/dSPS3Qe+/Cy8YvsefuXfzeesS8qBoz6vR8CiavTe3X/75LnlWW6j Agnax5ZNrYBvcFZR9sDM136+UyA8zWDcLDRk4UwLJoD0PG1eYujsTDMQqHaLFolc1h7G g4jw== X-Gm-Message-State: AN3rC/4U5TJpw3ZthBbGAlBNSBBZUuFF4vqFyTfkbw3rk3vX1i6ZDiCx Z/RA041IGI1sD7GMdvg= X-Received: by 10.99.238.69 with SMTP id n5mr8791443pgk.6.1492201192141; Fri, 14 Apr 2017 13:19:52 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id g5sm4755745pfe.12.2017.04.14.13.19.50 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 13:19:51 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F6044C16-A008-41A2-B2C9-8CDBA517C385"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20170414201431.GF20974@zxy.spb.ru> Date: Fri, 14 Apr 2017 13:19:49 -0700 Cc: Alan Somers , Ngie Cooper , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Message-Id: References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:19:53 -0000 --Apple-Mail=_F6044C16-A008-41A2-B2C9-8CDBA517C385 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 13:14, Slawa Olhovchenkov wrote: >=20 > On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >=20 >> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper = wrote: >>> Author: ngie >>> Date: Fri Apr 14 19:41:48 2017 >>> New Revision: 316938 >>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>=20 >>> Log: >>> savecore: fix space calculation with respect to `minfree` in = check_space(..) >>>=20 >>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>> representable data to INT_MAX. Check the values received from >>> strtoll(3), trimming trailing whitespace off the end to maintain >>> POLA. >>> - Use `KiB` instead of `kB` when describing free space, total = space, >>> etc. I am now fully aware of `KiB` being the IEC standard for = 1024 >>> bytes and `kB` being the IEC standard for 1000 bytes. >>> - Store available number of KiB in `available` so it can be more >>> easily queried and compared to ensure that there are enough KiB = to >>> store the dump image on disk. >>> - Print out the reserved space on disk, per `minfree`, so end-users >>> can troubleshoot why check_space(..) is reporting that there = isn't >>> enough free space. >>>=20 >>> MFC after: 7 weeks >>> Reviewed by: Anton Rang (earlier diff), cem = (earlier diff) >>> Tested with: positive/negative cases (see review); make tinderbox >>> Sponsored by: Dell EMC Isilon >>> Differential Revision: D10379 >>=20 >> The free space calculation is still uselessly conservative, because = it >> doesn't account for the fact that core dumps will always be either >> spare or compressed. The result is that savecore will frequently >> refuse to save corefiles even when there's plenty of space. I >> proposed removing the space check altogether in >> https://reviews.freebsd.org/D2587. However, I agreed to wait until >> after the compressed core dump feature was merged, because then = mostly >> accurate space checks will be possible. AFAIK the compressed core >> dump feature still hasn't been finished. >=20 > Is posible (in the future) to use multiple swaps (on multiple disks) > for save core dumps? Multiple swap devices is already handled by savecore(8), if one uses = fstab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on = individual devices. As far as saving to multiple disks is concerned, I would hope that one = is using a redundancy capable filesystem (zfs) or RAID-like technology = (gmirror, graid, LSI Fusion=E2=80=99s RAID product line) to stripe = and/or mirror the data across multiple disks. Thanks! -Ngie --Apple-Mail=_F6044C16-A008-41A2-B2C9-8CDBA517C385 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8S7mAAoJEPWDqSZpMIYVD0YP/1KlgFSYpCIlRRlB0/oCMf60 CNmZheuJosq0Hg4ddFIUY3qtkeCGlflCBGT87TtkjUO9JjchT9qThHoxrK6WM+nS URNkAWephN9ZR2XuwkNAtXwOYMBHXvVARYD31YCpCcoCvTIKaVcW4YGfEbNgQOAR k2u64ca8VZEso6BL8CDjR9OWnn61cMKezdi8tnwkgfVbvs2pZo9DpyWpQm0syW8B IjwPe68d7MA74tgggSdAUBnso8GUjJU3QLXYw8vu11x+o9G4OHwQ0d9kO9l7AF3e ACcDF+1pRi4x9qNWpirPeRl2u+BHCbvAExK5OPFemuBFM/tFRgy4hNGTVRPfKmPM w0+zK3PpBJVjh5PS+LdKCRjE5vQvnQF88k2tJmoIlq5a7xCGpoCCLLDrUpv3U3gt vaworVe6X+4WVvOtxdWy77hPKW8LoprrxY7HADBl6SK/713wgX0UqtpOywffkc59 G55JqxKwi/5WyAFRixpFgzN1GXykVUKaROXJhJFHmOK9ET0Evxc4qJsQ3TLW+VGn 7ELzrfd+WjNAoaCtCtufWDhopZO+gzy3JzuzISpVyXlXF0MQjg89ByXqlihi6obK +jmj0mbvrKKEnX9ZQNVEEoHmsVdD0oxa0Ujh0BYH334VyfU3gWV23ogmmZDvI3JI NLtwHCAagYRtm9jSSWzw =nYn+ -----END PGP SIGNATURE----- --Apple-Mail=_F6044C16-A008-41A2-B2C9-8CDBA517C385-- From owner-svn-src-all@freebsd.org Fri Apr 14 20:26:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2961D3A388; Fri, 14 Apr 2017 20:26:52 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC0C15B9; Fri, 14 Apr 2017 20:26:52 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-transfer-encoding:Content-type:Mime-version:In-Reply-To: References:Message-ID:CC:To:From:Subject:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TA6nEgScfnIN5WmScTSR/Pz7prf/sBUM22JQDb+Sspo=; b=E53AwMNqOTbbyhaO40EsPo8Pco FH5CnJzQ7Mgz1Fgpt/yKbWvslAdBlAugexc1o6P8wQ2lxHLuycSxLLP0od311r02TlZuMW9eV7tta fip7DBR9+zJDhROWC24Roo6BEcSJOAMVdbB6PIxzH6moGNRg6L4sQo0Ay+skjk1RtQog=; Received: from [74.203.163.58] (port=50895 helo=[10.106.10.41]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1cz7nv-000IAx-7m; Fri, 14 Apr 2017 15:26:51 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Fri, 14 Apr 2017 15:26:20 -0500 Subject: Re: svn commit: r316938 - head/sbin/savecore From: Larry Rosenman To: "Ngie Cooper (yaneurabeya)" , Slawa Olhovchenkov CC: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Message-ID: <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> Thread-Topic: svn commit: r316938 - head/sbin/savecore References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:26:52 -0000 On 4/14/17, 3:19 PM, "Ngie Cooper (yaneurabeya)" wrote: =20 > On Apr 14, 2017, at 13:14, Slawa Olhovchenkov wrote: >=20 > On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >=20 >> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrot= e: >>> Author: ngie >>> Date: Fri Apr 14 19:41:48 2017 >>> New Revision: 316938 >>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>=20 >>> Log: >>> savecore: fix space calculation with respect to `minfree` in check= _space(..) >>>=20 >>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>> representable data to INT_MAX. Check the values received from >>> strtoll(3), trimming trailing whitespace off the end to maintain >>> POLA. >>> - Use `KiB` instead of `kB` when describing free space, total spac= e, >>> etc. I am now fully aware of `KiB` being the IEC standard for 10= 24 >>> bytes and `kB` being the IEC standard for 1000 bytes. >>> - Store available number of KiB in `available` so it can be more >>> easily queried and compared to ensure that there are enough KiB = to >>> store the dump image on disk. >>> - Print out the reserved space on disk, per `minfree`, so end-user= s >>> can troubleshoot why check_space(..) is reporting that there isn= 't >>> enough free space. >>>=20 >>> MFC after: 7 weeks >>> Reviewed by: Anton Rang (earlier diff), cem (earli= er diff) >>> Tested with: positive/negative cases (see review); make tinderbox >>> Sponsored by: Dell EMC Isilon >>> Differential Revision: D10379 >>=20 >> The free space calculation is still uselessly conservative, because = it >> doesn't account for the fact that core dumps will always be either >> spare or compressed. The result is that savecore will frequently >> refuse to save corefiles even when there's plenty of space. I >> proposed removing the space check altogether in >> https://reviews.freebsd.org/D2587. However, I agreed to wait until >> after the compressed core dump feature was merged, because then most= ly >> accurate space checks will be possible. AFAIK the compressed core >> dump feature still hasn't been finished. >=20 > Is posible (in the future) to use multiple swaps (on multiple disks) > for save core dumps? =20 Multiple swap devices is already handled by savecore(8), if one uses fs= tab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on individual de= vices. =20 As far as saving to multiple disks is concerned, I would hope that one = is using a redundancy capable filesystem (zfs) or RAID-like technology (gmir= ror, graid, LSI Fusion=E2=80=99s RAID product line) to stripe and/or mirror the da= ta across multiple disks. =20 Thanks! -Ngie =20 How do I use multiple devices to have the system dump on all of my swap? I= got a message about not enough space, but there (I think) was enough betwee= n multiple drives=E2=80=A6. From owner-svn-src-all@freebsd.org Fri Apr 14 20:29:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6F30D3A484; Fri, 14 Apr 2017 20:29:40 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x22e.google.com (mail-qt0-x22e.google.com [IPv6:2607:f8b0:400d:c0d::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E65A1760; Fri, 14 Apr 2017 20:29:40 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x22e.google.com with SMTP id m36so70993782qtb.0; Fri, 14 Apr 2017 13:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VovzLQB9qyODv+kHXRjOTRsdIRJA83w3RA3ZxyZPyNo=; b=m4UCUVCTwc3Axhp5SJl/MlS1wHatvP4zKgylh+m4BQMiJnqXjWZdoL+N8gLFNoyYDx lcLMyu6nu8LeToMALAYXtZ1b04K52CT1Atk/nx4vcUplOb0nMb1XZTE4WhI6hJtYXKHI n+EW4CyC3msP4cwRZ+pONhnu95xGWT+8lF0NM/kIbcZ4OWr4Wfh1Ia7JQ7f7q9Zyo3RW TXEPeqZQ+RqCedi5H0/TXfBBPGcwM+0oN2YZ7RmDOA/it/wJh7kN+LEJlIdcRfXIAXSR GQPmThyE5lsBdh63yeU1L5Hy28HtI5LxKvL6jwfToni6Cal5Kf2zuD/5MZZdSAGj2WPO DOQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=VovzLQB9qyODv+kHXRjOTRsdIRJA83w3RA3ZxyZPyNo=; b=Z+F0tBHGQIwtJ0PVGvejkq3urTUH+CP3Dub3mtqHgqU37LcvJAYAuK5rBEYaJyqAJb FeckUediaAYZv/dnPnscCKH2VspGIFBPVm5REaQjxD7bsx2Rgnmvu2op4zVA8lKYNF+c 8iNwgY7HVZn0K/vBaUKqDv4tCgZWWDHtoTQPCIxB86KiEC7PJChuj2mTQ/D0wDQCFl/a WIKswGzt0ErdrOKGkWib5x40Gi8LfRINW/DWPtrsFpYljYaC0JolYZKuqpKfuqopaL4G fLES2SzaWWeWqOR8we5ZVqO4oO+EdhoyL95KFZATvJ5H0do6LYN/J668T2dPS7kmNe0l UzxQ== X-Gm-Message-State: AN3rC/48bY7hZRQ7Jbldi5Fhf0FXgxM2jY37LfEFsA4LSOQ12v08Afyq 5cG01e6KOwU2HAg6 X-Received: by 10.237.62.46 with SMTP id l43mr8403536qtf.88.1492201779507; Fri, 14 Apr 2017 13:29:39 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id a19sm1880352qta.48.2017.04.14.13.29.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 13:29:38 -0700 (PDT) Sender: Mark Johnston Date: Fri, 14 Apr 2017 13:29:18 -0700 From: Mark Johnston To: Alan Somers Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:29:40 -0000 On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: > On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: > > Author: ngie > > Date: Fri Apr 14 19:41:48 2017 > > New Revision: 316938 > > URL: https://svnweb.freebsd.org/changeset/base/316938 > > > > Log: > > savecore: fix space calculation with respect to `minfree` in check_space(..) > > > > - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > > representable data to INT_MAX. Check the values received from > > strtoll(3), trimming trailing whitespace off the end to maintain > > POLA. > > - Use `KiB` instead of `kB` when describing free space, total space, > > etc. I am now fully aware of `KiB` being the IEC standard for 1024 > > bytes and `kB` being the IEC standard for 1000 bytes. > > - Store available number of KiB in `available` so it can be more > > easily queried and compared to ensure that there are enough KiB to > > store the dump image on disk. > > - Print out the reserved space on disk, per `minfree`, so end-users > > can troubleshoot why check_space(..) is reporting that there isn't > > enough free space. > > > > MFC after: 7 weeks > > Reviewed by: Anton Rang (earlier diff), cem (earlier diff) > > Tested with: positive/negative cases (see review); make tinderbox > > Sponsored by: Dell EMC Isilon > > Differential Revision: D10379 > > The free space calculation is still uselessly conservative, because it > doesn't account for the fact that core dumps will always be either > spare or compressed. The result is that savecore will frequently > refuse to save corefiles even when there's plenty of space. I > proposed removing the space check altogether in > https://reviews.freebsd.org/D2587. However, I agreed to wait until > after the compressed core dump feature was merged, because then mostly > accurate space checks will be possible. AFAIK the compressed core > dump feature still hasn't been finished. I had held off on it for a while because it was going to conflict with the work to add encrypted dump support, which of course has finished. The patch to add compression support is here and should largely still work: https://people.freebsd.org/~markj/patches/core-compression/20141110-kern_dump.diff I've been hesitant about pushing it forward: - The dump_write* APIs need some simplification after the addition of encrypted dump support and support for dumping to 4Kn drives. - I'm not sure how encryption should compose with compression. It seems intuitively obvious that we should compress before encrypting if the compression is to be of any use, but I don't know enough to know whether the compression might somehow compromise the effectiveness of the encryption. If anyone has some insight on the second of these two points, I'd appreciate hearing it. From owner-svn-src-all@freebsd.org Fri Apr 14 20:33:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19E2BD3A6C9; Fri, 14 Apr 2017 20:33:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7ABF1BE6; Fri, 14 Apr 2017 20:33:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x242.google.com with SMTP id o123so17792320pga.1; Fri, 14 Apr 2017 13:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=ScsIUx0yl2WRPiXfY9B8lhBsRrBh7N01AuMlX7XjJZA=; b=QDD86mMtmGUMM63Gk3JUy/7PSA/2w2KFxDjOfEoToSczKZRV5A5VPnQcDM4yCh1OUf 81LSMNHNZp1KtkoMgCVRV172S4EAFONG+/6FGD1HUPiVAnVLjGjUGaRFIUNFu2Vrbl8r JXXKUxcqsbmrNviFtvdgfkwDqH9HBWlAq2/BV1sA2tIMD7k4gV2RGokLVIKG2sddbtJ0 iIVNQJrir9cPTRiQptebSc4i7rCinbyI4zbCtTp2wamY3NyBJQVGnK2bX2Qt0bsPHX9p CsV5DDYTcCdKVePVZZhfUFYU/0SOckjizhHvuQwbXbdKBCySvRGHH4Jd/nEXiiucdXUo aCjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=ScsIUx0yl2WRPiXfY9B8lhBsRrBh7N01AuMlX7XjJZA=; b=Rv5j0HFOHpJiSddPKFgdtttCOoBPPFBLTpYJoywqi+3MeT+bhfA1iw5WwFfpgrImG9 hIgpRajh2Cigq/QlqyrOtTl/6MW9A48+CcRXSh2C9Rxa9Rkhvil86pmU1f6T3Sjhd8cM MlY7fZYr5aJSrbVMRUaptEXhSJ1JVQLRgsva2yTqc+XOEHhG9q1PiSxxdCLBY37eKTxZ NIWyLui28CgxWU04X6nz0FotKdIeyOTXRY2YsT5gcomc1UFV8l7kDzm1FPAbGNda32ck Eyk75ozVBwcbPSBCaWj0qJgIEhPas3wzCaVPQJu2ekfogq37c3jmoKdHBzd+vsh+VPID tXaQ== X-Gm-Message-State: AN3rC/6VIu1U3/ddiIO73QKcXn6s1JGYH6pKEgsz/EuiFoeAbQt+9pFU +xWsDHrV+v0L7A== X-Received: by 10.84.224.73 with SMTP id a9mr11219074plt.38.1492202019371; Fri, 14 Apr 2017 13:33:39 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p2sm4762491pfj.93.2017.04.14.13.33.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 13:33:38 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C790D917-BF6F-4C2A-8142-67B1435377E7"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> Date: Fri, 14 Apr 2017 13:33:36 -0700 Cc: Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Message-Id: References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> To: Larry Rosenman X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:33:40 -0000 --Apple-Mail=_C790D917-BF6F-4C2A-8142-67B1435377E7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 13:26, Larry Rosenman wrote: >=20 > On 4/14/17, 3:19 PM, "Ngie Cooper (yaneurabeya)" = = wrote: >=20 >> On Apr 14, 2017, at 13:14, Slawa Olhovchenkov wrote: >>=20 >> On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >>=20 >>> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper = wrote: >>>> Author: ngie >>>> Date: Fri Apr 14 19:41:48 2017 >>>> New Revision: 316938 >>>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>>=20 >>>> Log: >>>> savecore: fix space calculation with respect to `minfree` in = check_space(..) >>>>=20 >>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>>> representable data to INT_MAX. Check the values received from >>>> strtoll(3), trimming trailing whitespace off the end to maintain >>>> POLA. >>>> - Use `KiB` instead of `kB` when describing free space, total = space, >>>> etc. I am now fully aware of `KiB` being the IEC standard for = 1024 >>>> bytes and `kB` being the IEC standard for 1000 bytes. >>>> - Store available number of KiB in `available` so it can be more >>>> easily queried and compared to ensure that there are enough KiB = to >>>> store the dump image on disk. >>>> - Print out the reserved space on disk, per `minfree`, so end-users >>>> can troubleshoot why check_space(..) is reporting that there = isn't >>>> enough free space. >>>>=20 >>>> MFC after: 7 weeks >>>> Reviewed by: Anton Rang (earlier diff), cem = (earlier diff) >>>> Tested with: positive/negative cases (see review); make tinderbox >>>> Sponsored by: Dell EMC Isilon >>>> Differential Revision: D10379 >>>=20 >>> The free space calculation is still uselessly conservative, because = it >>> doesn't account for the fact that core dumps will always be either >>> spare or compressed. The result is that savecore will frequently >>> refuse to save corefiles even when there's plenty of space. I >>> proposed removing the space check altogether in >>> https://reviews.freebsd.org/D2587. However, I agreed to wait until >>> after the compressed core dump feature was merged, because then = mostly >>> accurate space checks will be possible. AFAIK the compressed core >>> dump feature still hasn't been finished. >>=20 >> Is posible (in the future) to use multiple swaps (on multiple disks) >> for save core dumps? >=20 > Multiple swap devices is already handled by savecore(8), if one = uses fstab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on = individual devices. >=20 > As far as saving to multiple disks is concerned, I would hope that = one is using a redundancy capable filesystem (zfs) or RAID-like = technology (gmirror, graid, LSI Fusion=E2=80=99s RAID product line) to = stripe and/or mirror the data across multiple disks. =E2=80=A6 > How do I use multiple devices to have the system dump on all of my = swap? I got a message about not enough space, but there (I think) was = enough between multiple drives=E2=80=A6. Something like: - Create a zpool - Mount zpool to /crashdumps - Change dumpdir in /etc/rc.conf to be /crashdumps, e.g., echo = =E2=80=98dumpdir=3D/crashdumps=E2=80=99 ? HTH, -Ngie PS The issue with lack of space might be the issue that Alan brought up = earlier with compressed dumps and overly conservative free space checks, = or it might be the fact that dumpdir (default: /var/crash) is full. --Apple-Mail=_C790D917-BF6F-4C2A-8142-67B1435377E7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8TIhAAoJEPWDqSZpMIYVLx0P/iUXgYmmooUe4Wxn+Pml9V5g kXBFrlo082lBIiz+YYkUdwyt4jdthXgminrGzugXmpXdWalB3GbLL9m76z2CCQ85 IJ6HBpyWUs918P7I0yhA4YnXCXVwP9cbcsdBcpMQH6bVDGE0slncJdMqtsYqItpo eHd03Bmw+6F+J+wh1Ysh1lo3gfHWW6HpKi4Q8R4oWInODH8Nz2d7U6YAlSu9udMo Plt2grjGsCqwfiz6ZY6/zC3cjFmB8LnVlcKmjprri7eM1RWdiqiXYpHxDKGHOjgs DAEmNMTf3wXUKQlKEF4GyTN1Nb6Q033v/LHi7JbDD56f+A7MHy0+MaPMMcx31IAI HGIicG8cpdhKkt9SOsENfN3aw/7UlNjdyKchWUS1dQrvaf1GcOqP7eZW34F0f7Se 2VOG4YPUsEBVTPA9nM5APvHVlEiDikpx5KSg1cSg4feB0fJBbGgQZcqUi4Fynasn yrFWlary8j3FSjStDMGd+vgXl75m7RwBpIY7IZyuELODDCGRyeHzE6PXOlPDDfOw oZPeSxSpbH3qvGuevgiZQpshttGo7koeIl1so7SM9PDWRzIFlXo0yajAGcF5rgVR WUzbeMoqkPPv3iJU3OqxPz4H6N1O8OJ2kic1TFqQpXZ+nyVxq2zCmCaQTAdNi/TZ +zIlkOp5WrlJh/g00GPs =SxUU -----END PGP SIGNATURE----- --Apple-Mail=_C790D917-BF6F-4C2A-8142-67B1435377E7-- From owner-svn-src-all@freebsd.org Fri Apr 14 20:37:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B29ADD3A7D5; Fri, 14 Apr 2017 20:37:41 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D9731E27; Fri, 14 Apr 2017 20:37:41 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-transfer-encoding:Content-type:Mime-version:In-Reply-To: References:Message-ID:CC:To:From:Subject:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=MVZQOjrlrhpsxebE2wLM+/juVvbJKm5HlqSqgOSVnfw=; b=nSO2/jCDAoOnt0I9QgZQBMKRfS S0Jj736Y7DOI/yOoM1rXJ1rAuKmPGv11nM4eGKMqImfxYdOAYl1cD8eBJoGwW6lttgjZaFjfHnOZi u3pKOdJw2NZrZgakj3LDh9BPYKCVncTSZDcNgIz/FWig4OoSwQCwX2VyREumHWzx/ZG8=; Received: from [74.203.163.58] (port=32826 helo=[10.106.10.41]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1cz7yO-000IUK-Go; Fri, 14 Apr 2017 15:37:40 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Fri, 14 Apr 2017 15:37:10 -0500 Subject: Re: svn commit: r316938 - head/sbin/savecore From: Larry Rosenman To: "Ngie Cooper (yaneurabeya)" CC: Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Message-ID: Thread-Topic: svn commit: r316938 - head/sbin/savecore References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:37:41 -0000 On 4/14/17, 3:33 PM, "Ngie Cooper (yaneurabeya)" wr= ote: =20 > On Apr 14, 2017, at 13:26, Larry Rosenman wrote: >=20 > On 4/14/17, 3:19 PM, "Ngie Cooper (yaneurabeya)" wrote: >=20 >> On Apr 14, 2017, at 13:14, Slawa Olhovchenkov wrote= : >>=20 >> On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >>=20 >>> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wro= te: >>>> Author: ngie >>>> Date: Fri Apr 14 19:41:48 2017 >>>> New Revision: 316938 >>>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>>=20 >>>> Log: >>>> savecore: fix space calculation with respect to `minfree` in check= _space(..) >>>>=20 >>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>>> representable data to INT_MAX. Check the values received from >>>> strtoll(3), trimming trailing whitespace off the end to maintain >>>> POLA. >>>> - Use `KiB` instead of `kB` when describing free space, total spac= e, >>>> etc. I am now fully aware of `KiB` being the IEC standard for 10= 24 >>>> bytes and `kB` being the IEC standard for 1000 bytes. >>>> - Store available number of KiB in `available` so it can be more >>>> easily queried and compared to ensure that there are enough KiB = to >>>> store the dump image on disk. >>>> - Print out the reserved space on disk, per `minfree`, so end-user= s >>>> can troubleshoot why check_space(..) is reporting that there isn= 't >>>> enough free space. >>>>=20 >>>> MFC after: 7 weeks >>>> Reviewed by: Anton Rang (earlier diff), cem (earli= er diff) >>>> Tested with: positive/negative cases (see review); make tinderbox >>>> Sponsored by: Dell EMC Isilon >>>> Differential Revision: D10379 >>>=20 >>> The free space calculation is still uselessly conservative, because= it >>> doesn't account for the fact that core dumps will always be either >>> spare or compressed. The result is that savecore will frequently >>> refuse to save corefiles even when there's plenty of space. I >>> proposed removing the space check altogether in >>> https://reviews.freebsd.org/D2587. However, I agreed to wait until >>> after the compressed core dump feature was merged, because then mos= tly >>> accurate space checks will be possible. AFAIK the compressed core >>> dump feature still hasn't been finished. >>=20 >> Is posible (in the future) to use multiple swaps (on multiple disks) >> for save core dumps? >=20 > Multiple swap devices is already handled by savecore(8), if one us= es fstab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on individu= al devices. >=20 > As far as saving to multiple disks is concerned, I would hope that= one is using a redundancy capable filesystem (zfs) or RAID-like technology = (gmirror, graid, LSI Fusion=E2=80=99s RAID product line) to stripe and/or mirror t= he data across multiple disks. =20 =E2=80=A6 =20 > How do I use multiple devices to have the system dump on all of my sw= ap? I got a message about not enough space, but there (I think) was enough = between multiple drives=E2=80=A6. =20 Something like: =20 - Create a zpool - Mount zpool to /crashdumps - Change dumpdir in /etc/rc.conf to be /crashdumps, e.g., echo =E2=80=98dumpd= ir=3D/crashdumps=E2=80=99 =20 ? HTH, -Ngie =20 PS The issue with lack of space might be the issue that Alan brought up= earlier with compressed dumps and overly conservative free space checks, or= it might be the fact that dumpdir (default: /var/crash) is full. I was talking about the actual crashdump to swap by the system. /var/crash= has 10T of space (my root pool). =20 From owner-svn-src-all@freebsd.org Fri Apr 14 20:39:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AECFCD3A86B; Fri, 14 Apr 2017 20:39:47 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 772781F8C; Fri, 14 Apr 2017 20:39:47 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id c198so16534130pfc.0; Fri, 14 Apr 2017 13:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=irXVje+m8CLSJAb62ehT2qVpRpQqepcvon8JPA5q4cA=; b=Vh1a82+EpcqoVw9QVXhdnCub7Kf+15J/oVpgvxMfcslHFDXvb1VJPa3IE9JG4ehCz+ M5dlKRkXn/2OUJ6cy7Rpz9C3PwU1hwFi5FCk7B4DnDbutjFH791MD0am5fWyebuyd5Np cNsd9/kY4/JuFQGJqzsugEm9r/KSR4nbhAVlu0IvhnzXt5jEU7NyQAQ9aWtVKVqYLNuP 6lH/gn0FMm1vcPQuLIsXkUw/wsiBmjIF8E4IYFOJs1/Uyn8ug0JsZBSE+ecMwX6HKfO2 T/jlONxNbHoDc7N5KCbi4ZYC6s5AVNo+IfvDjcVqIJyXWrB7M+TgQoefnj4vzGyCu5EG DbiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=irXVje+m8CLSJAb62ehT2qVpRpQqepcvon8JPA5q4cA=; b=NRUCzFGIyrByGAHfqfAuemfB0qo0P6Grb7R9u//s9YrZOcjseWssP9ZXA/aPOD4TOI IjzJCh4RNlMbJ3OM4XQT0ZuUCmN0zn3eJFnkDL4V5Rt4Q14goFiGopBgSthfirhbh1kH 3PQugm1HQQBkgZzt8y/lWRHEMCtxfP7qb6qUC9eQQ6zoW1nBCbD9D/+AEJ/etzQr53ho CKFwfSmdsgIkfDCefvOCGpr2qTcZciF/z2thDz1VbYUlsHjx//FPLtTwV3ctck1svuEs UtN1ZTWExMeMaTCN3YWr2ma7iOiayNBI7ubYQ7GOowx2Y7QzBr04fMeYZIh8BPCnMQ9d x9dQ== X-Gm-Message-State: AN3rC/7guOCOemBDyAJzUGpU2myC3hDXersM7zJzY+Pp3tsZlWdDE9zb whVxJIdYXjNCbw== X-Received: by 10.99.135.193 with SMTP id i184mr8670201pge.120.1492202387036; Fri, 14 Apr 2017 13:39:47 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id f24sm4770477pfk.88.2017.04.14.13.39.45 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 13:39:45 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_215A0B22-5F85-4831-9C44-17E7863F09D3"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Fri, 14 Apr 2017 13:39:44 -0700 Cc: Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Message-Id: <12820BAB-D8BA-4EDE-89BC-4BDB56B1E57A@gmail.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> To: Larry Rosenman X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:39:47 -0000 --Apple-Mail=_215A0B22-5F85-4831-9C44-17E7863F09D3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 13:37, Larry Rosenman wrote: >=20 > On 4/14/17, 3:33 PM, "Ngie Cooper (yaneurabeya)" = wrote: >=20 >> On Apr 14, 2017, at 13:26, Larry Rosenman wrote: >>=20 >> On 4/14/17, 3:19 PM, "Ngie Cooper (yaneurabeya)" = = wrote: >>=20 >>> On Apr 14, 2017, at 13:14, Slawa Olhovchenkov = wrote: >>>=20 >>> On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >>>=20 >>>> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper = wrote: >>>>> Author: ngie >>>>> Date: Fri Apr 14 19:41:48 2017 >>>>> New Revision: 316938 >>>>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>>>=20 >>>>> Log: >>>>> savecore: fix space calculation with respect to `minfree` in = check_space(..) >>>>>=20 >>>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>>>> representable data to INT_MAX. Check the values received from >>>>> strtoll(3), trimming trailing whitespace off the end to maintain >>>>> POLA. >>>>> - Use `KiB` instead of `kB` when describing free space, total = space, >>>>> etc. I am now fully aware of `KiB` being the IEC standard for = 1024 >>>>> bytes and `kB` being the IEC standard for 1000 bytes. >>>>> - Store available number of KiB in `available` so it can be more >>>>> easily queried and compared to ensure that there are enough KiB = to >>>>> store the dump image on disk. >>>>> - Print out the reserved space on disk, per `minfree`, so = end-users >>>>> can troubleshoot why check_space(..) is reporting that there = isn't >>>>> enough free space. >>>>>=20 >>>>> MFC after: 7 weeks >>>>> Reviewed by: Anton Rang (earlier diff), cem = (earlier diff) >>>>> Tested with: positive/negative cases (see review); make tinderbox >>>>> Sponsored by: Dell EMC Isilon >>>>> Differential Revision: D10379 >>>>=20 >>>> The free space calculation is still uselessly conservative, because = it >>>> doesn't account for the fact that core dumps will always be either >>>> spare or compressed. The result is that savecore will frequently >>>> refuse to save corefiles even when there's plenty of space. I >>>> proposed removing the space check altogether in >>>> https://reviews.freebsd.org/D2587. However, I agreed to wait until >>>> after the compressed core dump feature was merged, because then = mostly >>>> accurate space checks will be possible. AFAIK the compressed core >>>> dump feature still hasn't been finished. >>>=20 >>> Is posible (in the future) to use multiple swaps (on multiple disks) >>> for save core dumps? >>=20 >> Multiple swap devices is already handled by savecore(8), if one = uses fstab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on = individual devices. >>=20 >> As far as saving to multiple disks is concerned, I would hope that = one is using a redundancy capable filesystem (zfs) or RAID-like = technology (gmirror, graid, LSI Fusion=E2=80=99s RAID product line) to = stripe and/or mirror the data across multiple disks. >=20 > =E2=80=A6 >=20 >> How do I use multiple devices to have the system dump on all of my = swap? I got a message about not enough space, but there (I think) was = enough between multiple drives=E2=80=A6. >=20 > Something like: >=20 > - Create a zpool > - Mount zpool to /crashdumps > - Change dumpdir in /etc/rc.conf to be /crashdumps, e.g., echo = =E2=80=98dumpdir=3D/crashdumps=E2=80=99 >=20 > ? > HTH, > -Ngie >=20 > PS The issue with lack of space might be the issue that Alan = brought up earlier with compressed dumps and overly conservative free = space checks, or it might be the fact that dumpdir (default: /var/crash) = is full. >=20 >=20 > I was talking about the actual crashdump to swap by the system. = /var/crash has 10T of space (my root pool). If your memory is bigger than your swap, you=E2=80=99re unfortunately = not able to save the mini dump if the size of the saved pages exceed the = space on swap. I think this is where markj=E2=80=99s compressed dumps = feature will come in handy. Thanks! -Ngie --Apple-Mail=_215A0B22-5F85-4831-9C44-17E7863F09D3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8TOQAAoJEPWDqSZpMIYVIckP/1/wc/m+cB8E/xrSul7Da/3t rEEac5Wd87AcepXrjWINm76mV4ptWr2Wxob/1JH7xBC0tw3Tv8FcqKhsPRKW6Pyu phufjxc3yy1KZCZWRPhz6SA1k3hD3Q6zfnXbtxy13YH8M7CpLb78ni/wSmhuEorD VjJgdijY5y19f3JTfhw/FU3+5OOR/n+0058o5cEKavIZ6VWZmG2iQ4iujx808xpm V5q4OOVGlNNWXGIxGWnvea98dITdVIJYnUbW0ENLRAnxEcsFg0S0TWDFbBQA9qeR L3Co0SCfQaOw+nnPY8u84aiPqhaefrVzcn5iUr+M4qU9v3WPupj3Z0j2A5ZMExR9 19UQm6Aofm0ZnS1/Gp+wi7XLbMfxkhsVxlljLpRBR5q4KtWwttFwZijnLvdlYw0v zLiJqu0jCW5ZA+U3qKIXlU4uIqSmLj9iZEETA2/6J4SvcllMRI+raHgugIbHSBEl UlqFC/p40ByArQvzU4xWb2Ll8VR6iaKSWledkukKpRruHc0JU0h7GmIW4qzx1HlF Fsp9fzcTL1nAGJfqy3CW1SaBQ8d+kaw/9zLGSSRpzHkF6FUYl20+TWIxiB1luB3y 8UcYFNJdYh5NjXv2gybPvjogueU48ZceBQ9t3UM1ZKDvKSt2Tb/kzpGiXP5kf45t /Xw83eOleAC2Tq3Egj/t =288l -----END PGP SIGNATURE----- --Apple-Mail=_215A0B22-5F85-4831-9C44-17E7863F09D3-- From owner-svn-src-all@freebsd.org Fri Apr 14 20:41:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 364D4D3AA90; Fri, 14 Apr 2017 20:41:28 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yb0-x231.google.com (mail-yb0-x231.google.com [IPv6:2607:f8b0:4002:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7C89363; Fri, 14 Apr 2017 20:41:27 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yb0-x231.google.com with SMTP id l201so21111924ybf.0; Fri, 14 Apr 2017 13:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PFysNNThXkZBd3AVBwh5zjHDsdLezan9OO7QdSDNKZE=; b=bcZod9JZK1oK2kWjO1mKm3qgoL7yqzJNOkx+6lH5NSwGJM6W9VHvzot6UritHasq6o ubhZjFrzatdYbMT/QfQYDA9FntE3upSVXrHSHQzgKAA3Lf6q2YpeY94/AuzmZeamQKQC S07YKVhFf3gSYl+pRAfc/7YzVro+aBo2Ru2ua/7NgxVbz3mwiuCeUsLzsBCPPQKeeCj8 KA4unDUksOv8Sc//2biUHL0qal5xY2qEOmkw8wm1q/4B1h6cm0+4Pcp0YVay7EQ5Rjdq TMQZ7ZJVLQTip82mz4rTXgXM0SL7mNfT9PV0e9f6gpv/vteXdIu8tf/y8FOIAeAHWlfV CAhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PFysNNThXkZBd3AVBwh5zjHDsdLezan9OO7QdSDNKZE=; b=ajBjKY5Snf6tnEht0ulXqMzA1OT9xdlMQCknAi5Obd4PL7R2zsWupGVIaLgmfOkW4v pHTqtfpr/1W7+6noJfJanO9/nBuuns1juQUEHciquP89G0UPORKzLu4DUtxFdYZhgtIq d8KAHQ7VksVRKP6qPzbVmd4T0+WXyHFYOHKZrVaLGP1Y/rHoFKznuOIxrsEB4CQQbjrz Q+sX5HY8B7H6yE93pltToQH5vk8OTpd3MGGHxK3Odq45qqlabN4+UfatL498aI6uB7at aRucJm7LAYum1wRAU3xiC2FMn1mDmZl2G+62xiuvuUzoH/5fuDFOUjoDXfMLtP4/nQEN enYQ== X-Gm-Message-State: AN3rC/5uEjZEocwS8jfE7tKTibjJEX78mfrrxoKw65xdJo+h9RezwLcj 1xFNOi+RLTlqtLNxPIiKzdOdUmV2kP+D X-Received: by 10.37.165.8 with SMTP id h8mr7369341ybi.113.1492202485931; Fri, 14 Apr 2017 13:41:25 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.20.214 with HTTP; Fri, 14 Apr 2017 13:41:25 -0700 (PDT) In-Reply-To: <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> From: Alan Somers Date: Fri, 14 Apr 2017 14:41:25 -0600 X-Google-Sender-Auth: _BCSZgroLun7ev6CXaeVUzQSnTY Message-ID: Subject: Re: svn commit: r316938 - head/sbin/savecore To: Mark Johnston Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:41:28 -0000 On Fri, Apr 14, 2017 at 2:29 PM, Mark Johnston wrote: > On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: >> > Author: ngie >> > Date: Fri Apr 14 19:41:48 2017 >> > New Revision: 316938 >> > URL: https://svnweb.freebsd.org/changeset/base/316938 >> > >> > Log: >> > savecore: fix space calculation with respect to `minfree` in check_space(..) >> > >> > - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >> > representable data to INT_MAX. Check the values received from >> > strtoll(3), trimming trailing whitespace off the end to maintain >> > POLA. >> > - Use `KiB` instead of `kB` when describing free space, total space, >> > etc. I am now fully aware of `KiB` being the IEC standard for 1024 >> > bytes and `kB` being the IEC standard for 1000 bytes. >> > - Store available number of KiB in `available` so it can be more >> > easily queried and compared to ensure that there are enough KiB to >> > store the dump image on disk. >> > - Print out the reserved space on disk, per `minfree`, so end-users >> > can troubleshoot why check_space(..) is reporting that there isn't >> > enough free space. >> > >> > MFC after: 7 weeks >> > Reviewed by: Anton Rang (earlier diff), cem (earlier diff) >> > Tested with: positive/negative cases (see review); make tinderbox >> > Sponsored by: Dell EMC Isilon >> > Differential Revision: D10379 >> >> The free space calculation is still uselessly conservative, because it >> doesn't account for the fact that core dumps will always be either >> spare or compressed. The result is that savecore will frequently >> refuse to save corefiles even when there's plenty of space. I >> proposed removing the space check altogether in >> https://reviews.freebsd.org/D2587. However, I agreed to wait until >> after the compressed core dump feature was merged, because then mostly >> accurate space checks will be possible. AFAIK the compressed core >> dump feature still hasn't been finished. > > I had held off on it for a while because it was going to conflict with > the work to add encrypted dump support, which of course has finished. > > The patch to add compression support is here and should largely still > work: > https://people.freebsd.org/~markj/patches/core-compression/20141110-kern_dump.diff > > I've been hesitant about pushing it forward: > - The dump_write* APIs need some simplification after the addition of > encrypted dump support and support for dumping to 4Kn drives. > - I'm not sure how encryption should compose with compression. It seems > intuitively obvious that we should compress before encrypting if the > compression is to be of any use, but I don't know enough to know > whether the compression might somehow compromise the effectiveness of > the encryption. > > If anyone has some insight on the second of these two points, I'd > appreciate hearing it. I think compress then encrypt should be ok. AFAIK all attacks against compress-then-encrypt systems have involved either incredibly short payloads that are easy to guess, or a stream of separately compressed blocks that can be fingerprinted. But core dumps are very long, and they can't be fingerprinted in whole because they're unique. If you were to encrypt each page individually then pages could be fingerprinted, so don't do that. Instead, compress the entire core dump as a single stream and you should be ok. -Alan From owner-svn-src-all@freebsd.org Fri Apr 14 20:42:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1838D3AB96; Fri, 14 Apr 2017 20:42:22 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EA178C4; Fri, 14 Apr 2017 20:42:22 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cz82t-000AqM-AD; Fri, 14 Apr 2017 23:42:19 +0300 Date: Fri, 14 Apr 2017 23:42:19 +0300 From: Slawa Olhovchenkov To: "Ngie Cooper (yaneurabeya)" Cc: Larry Rosenman , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170414204219.GB70430@zxy.spb.ru> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:42:22 -0000 On Fri, Apr 14, 2017 at 01:33:36PM -0700, Ngie Cooper (yaneurabeya) wrote: > > > On Apr 14, 2017, at 13:26, Larry Rosenman wrote: > > > > On 4/14/17, 3:19 PM, "Ngie Cooper (yaneurabeya)" wrote: > > > >> On Apr 14, 2017, at 13:14, Slawa Olhovchenkov wrote: > >> > >> On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: > >> > >>> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: > >>>> Author: ngie > >>>> Date: Fri Apr 14 19:41:48 2017 > >>>> New Revision: 316938 > >>>> URL: https://svnweb.freebsd.org/changeset/base/316938 > >>>> > >>>> Log: > >>>> savecore: fix space calculation with respect to `minfree` in check_space(..) > >>>> > >>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > >>>> representable data to INT_MAX. Check the values received from > >>>> strtoll(3), trimming trailing whitespace off the end to maintain > >>>> POLA. > >>>> - Use `KiB` instead of `kB` when describing free space, total space, > >>>> etc. I am now fully aware of `KiB` being the IEC standard for 1024 > >>>> bytes and `kB` being the IEC standard for 1000 bytes. > >>>> - Store available number of KiB in `available` so it can be more > >>>> easily queried and compared to ensure that there are enough KiB to > >>>> store the dump image on disk. > >>>> - Print out the reserved space on disk, per `minfree`, so end-users > >>>> can troubleshoot why check_space(..) is reporting that there isn't > >>>> enough free space. > >>>> > >>>> MFC after: 7 weeks > >>>> Reviewed by: Anton Rang (earlier diff), cem (earlier diff) > >>>> Tested with: positive/negative cases (see review); make tinderbox > >>>> Sponsored by: Dell EMC Isilon > >>>> Differential Revision: D10379 > >>> > >>> The free space calculation is still uselessly conservative, because it > >>> doesn't account for the fact that core dumps will always be either > >>> spare or compressed. The result is that savecore will frequently > >>> refuse to save corefiles even when there's plenty of space. I > >>> proposed removing the space check altogether in > >>> https://reviews.freebsd.org/D2587. However, I agreed to wait until > >>> after the compressed core dump feature was merged, because then mostly > >>> accurate space checks will be possible. AFAIK the compressed core > >>> dump feature still hasn't been finished. > >> > >> Is posible (in the future) to use multiple swaps (on multiple disks) > >> for save core dumps? > > > > Multiple swap devices is already handled by savecore(8), if one uses fstab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on individual devices. > > > > As far as saving to multiple disks is concerned, I would hope that one is using a redundancy capable filesystem (zfs) or RAID-like technology (gmirror, graid, LSI Fusion’s RAID product line) to stripe and/or mirror the data across multiple disks. > > … > > > How do I use multiple devices to have the system dump on all of my swap? I got a message about not enough space, but there (I think) was enough between multiple drives…. > > Something like: > > - Create a zpool > - Mount zpool to /crashdumps > - Change dumpdir in /etc/rc.conf to be /crashdumps, e.g., echo ‘dumpdir=/crashdumps’ > > ? No, something like: % swapinfo Device 1K-blocks Used Avail Capacity /dev/ada0p2 33554432 0 33554432 0% /dev/ada1p2 33554432 0 33554432 0% Total 67108864 0 67108864 0% > > PS The issue with lack of space might be the issue that Alan brought up earlier with compressed dumps and overly conservative free space checks, or it might be the fact that dumpdir (default: /var/crash) is full. From owner-svn-src-all@freebsd.org Fri Apr 14 20:44:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D6BAD3ACC8; Fri, 14 Apr 2017 20:44:04 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77500A8B; Fri, 14 Apr 2017 20:44:04 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-transfer-encoding:Content-type:Mime-version:In-Reply-To: References:Message-ID:CC:To:From:Subject:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=VD2ICm0DhFwAuihFl/K9aLXlSBiBeBQz+AZiLt8g++g=; b=WW4vNruYl+NmKrjTiIGggu1mKQ cMQFyAkGVY+0sGfy9F13trfO0MJ9S5qxZrJuqlnaljyGLamRubMnP1FDCTjV0JOWzQF2Snq6iEVIU N/OgCMsXUmmy4BDbeQHnPdH9Q09Mckq+Q/q81TBJi6AMOY1nETPqBGwpa3JSJ4/f6E30=; Received: from [74.203.163.58] (port=22830 helo=[10.106.10.41]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1cz84Z-000Ifi-Rl; Fri, 14 Apr 2017 15:44:03 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Fri, 14 Apr 2017 15:43:34 -0500 Subject: Re: svn commit: r316938 - head/sbin/savecore From: Larry Rosenman To: "Ngie Cooper (yaneurabeya)" CC: "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ngie Cooper Message-ID: Thread-Topic: svn commit: r316938 - head/sbin/savecore References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> <12820BAB-D8BA-4EDE-89BC-4BDB56B1E57A@gmail.com> In-Reply-To: <12820BAB-D8BA-4EDE-89BC-4BDB56B1E57A@gmail.com> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:44:04 -0000 On 4/14/17, 3:39 PM, "Ngie Cooper (yaneurabeya)" wrote: =20 > On Apr 14, 2017, at 13:37, Larry Rosenman wrote: >=20 > On 4/14/17, 3:33 PM, "Ngie Cooper (yaneurabeya)" wrote: >=20 >> On Apr 14, 2017, at 13:26, Larry Rosenman wrote: >>=20 >> On 4/14/17, 3:19 PM, "Ngie Cooper (yaneurabeya)" wrote: >>=20 >>> On Apr 14, 2017, at 13:14, Slawa Olhovchenkov wrot= e: >>>=20 >>> On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >>>=20 >>>> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wr= ote: >>>>> Author: ngie >>>>> Date: Fri Apr 14 19:41:48 2017 >>>>> New Revision: 316938 >>>>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>>>=20 >>>>> Log: >>>>> savecore: fix space calculation with respect to `minfree` in chec= k_space(..) >>>>>=20 >>>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>>>> representable data to INT_MAX. Check the values received from >>>>> strtoll(3), trimming trailing whitespace off the end to maintain >>>>> POLA. >>>>> - Use `KiB` instead of `kB` when describing free space, total spa= ce, >>>>> etc. I am now fully aware of `KiB` being the IEC standard for 10= 24 >>>>> bytes and `kB` being the IEC standard for 1000 bytes. >>>>> - Store available number of KiB in `available` so it can be more >>>>> easily queried and compared to ensure that there are enough KiB = to >>>>> store the dump image on disk. >>>>> - Print out the reserved space on disk, per `minfree`, so end-use= rs >>>>> can troubleshoot why check_space(..) is reporting that there isn= 't >>>>> enough free space. >>>>>=20 >>>>> MFC after: 7 weeks >>>>> Reviewed by: Anton Rang (earlier diff), cem (earl= ier diff) >>>>> Tested with: positive/negative cases (see review); make tinderbo= x >>>>> Sponsored by: Dell EMC Isilon >>>>> Differential Revision: D10379 >>>>=20 >>>> The free space calculation is still uselessly conservative, becaus= e it >>>> doesn't account for the fact that core dumps will always be either >>>> spare or compressed. The result is that savecore will frequently >>>> refuse to save corefiles even when there's plenty of space. I >>>> proposed removing the space check altogether in >>>> https://reviews.freebsd.org/D2587. However, I agreed to wait unti= l >>>> after the compressed core dump feature was merged, because then mo= stly >>>> accurate space checks will be possible. AFAIK the compressed core >>>> dump feature still hasn't been finished. >>>=20 >>> Is posible (in the future) to use multiple swaps (on multiple disks= ) >>> for save core dumps? >>=20 >> Multiple swap devices is already handled by savecore(8), if one us= es fstab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on individu= al devices. >>=20 >> As far as saving to multiple disks is concerned, I would hope that= one is using a redundancy capable filesystem (zfs) or RAID-like technology = (gmirror, graid, LSI Fusion=E2=80=99s RAID product line) to stripe and/or mirror t= he data across multiple disks. >=20 > =E2=80=A6 >=20 >> How do I use multiple devices to have the system dump on all of my s= wap? I got a message about not enough space, but there (I think) was enough= between multiple drives=E2=80=A6. >=20 > Something like: >=20 > - Create a zpool > - Mount zpool to /crashdumps > - Change dumpdir in /etc/rc.conf to be /crashdumps, e.g., echo =E2=80=98= dumpdir=3D/crashdumps=E2=80=99 >=20 > ? > HTH, > -Ngie >=20 > PS The issue with lack of space might be the issue that Alan broug= ht up earlier with compressed dumps and overly conservative free space check= s, or it might be the fact that dumpdir (default: /var/crash) is full. >=20 >=20 > I was talking about the actual crashdump to swap by the system. /var= /crash has 10T of space (my root pool). =20 If your memory is bigger than your swap, you=E2=80=99re unfortunately not abl= e to save the mini dump if the size of the saved pages exceed the space on s= wap. I think this is where markj=E2=80=99s compressed dumps feature will come in h= andy. Thanks! -Ngie Yeah, I have the following: borg.lerctr.org /home/ler $ swapctl -l Device: 1024-blocks Used: /dev/mfid0p3 8388608 0 /dev/mfid1p3 8388608 0 /dev/mfid2p3 8388608 0 /dev/mfid3p3 8388608 0 /dev/mfid4p3 8388608 0 /dev/mfid5p3 8388608 0 borg.lerctr.org /home/ler $ sysctl hw.physmem hw.physmem: 137368682496 borg.lerctr.org /home/ler $ SO 6 8G partitions (48G), but the dump is larger than 8G.=20 =20 From owner-svn-src-all@freebsd.org Fri Apr 14 20:45:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 243DAD3AD49; Fri, 14 Apr 2017 20:45:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1A8BBF6; Fri, 14 Apr 2017 20:45:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 63so4731264pgh.0; Fri, 14 Apr 2017 13:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=2WaHE29vm44UIcg18q6Pcav3tJytdv0guw+NIYZ6WK4=; b=iK+9DBFUnn2xgiN5YgchU+3X2sEo8kYUzNZmjPVQh4PZaxoyN2YdSzsplqddD5AnO4 zv8qA+OwfN8hqebhxfCBwAL7uBdeXQjSF0eJB/Jx6FYtAzizLvt3LbsL0huOTLfHGD5k Hm31iAeDcJjl3Veeetj5J3KRr6CjkuFDnnbJFZneLuKzbv6wCZVZeKtzLcA2IDG8MbrA 7j8UMf0Nlfs5zeIeHbvk1saQAkwnox36mvA2sHsUzOdc9zUZAJTDAoUzUungZYkVqPgo NSkAuyB4bgNUHPHcjq3owXoi+CnJnlIpLW+ow0gTHsPDWjgpH0j1CgV4ztWUQa4gEaq2 isbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=2WaHE29vm44UIcg18q6Pcav3tJytdv0guw+NIYZ6WK4=; b=KFTs2DeEyNdmlSJuFhQs07N7xamiqO14QXKygXAxUMVkTZjsMkjBMAfCU9gmWRbYU9 PVe3W0cexw/D9QP/nCRQLJ6mdobJixyG+dTX5gunoppXvkNNUsUdY+zyuCL+koGrOz1C vT0bj3S4Rh0kxCOMUApAqDnhuSdfaf/cghMB6MdPRFBe5nS+hOldZEU6xp9R2TbtGgEx 2BT0Ja0eaBLnpMcXmEOLZ1iQaDKiDC4Zk1TNOFAMIyBIZz9tJZrVXxPn4mxR3rnSvyXQ ZhH1Bd8+PyqzYN/B4iXKr5VQ9mhelqv5hGFpn43k83CX2whlf2HEDhcgWDFprmmdvnPW wYrg== X-Gm-Message-State: AN3rC/5Us/6dwQkmWJSniA9YEUmaD0fMGS7PPw1a5VS+kEKf+vsHp+Zb IIg7coapPixB7A== X-Received: by 10.84.128.47 with SMTP id 44mr10976100pla.35.1492202724482; Fri, 14 Apr 2017 13:45:24 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id j4sm4771390pfk.91.2017.04.14.13.45.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 13:45:23 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_686C0686-354A-4705-A42A-46B7ACB999BC"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20170414204219.GB70430@zxy.spb.ru> Date: Fri, 14 Apr 2017 13:45:22 -0700 Cc: Larry Rosenman , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Message-Id: <5B71CE05-0791-4D90-A457-EA251F3989D2@gmail.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> <20170414204219.GB70430@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:45:25 -0000 --Apple-Mail=_686C0686-354A-4705-A42A-46B7ACB999BC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 13:42, Slawa Olhovchenkov wrote: =E2=80=A6 > No, something like: > % swapinfo > Device 1K-blocks Used Avail Capacity > /dev/ada0p2 33554432 0 33554432 0% > /dev/ada1p2 33554432 0 33554432 0% > Total 67108864 0 67108864 0% Striping dumps across multiple swap devices isn=E2=80=99t supported. = Sorry. -Ngie --Apple-Mail=_686C0686-354A-4705-A42A-46B7ACB999BC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8TTiAAoJEPWDqSZpMIYVFY0P/01YafKD3OXv9rrhvHwaUCJ4 7ZKiOFZVNuneiV+xci0Qj8JhRBAuylGY0i9Rtn3/5Dz2NFpu9H3CBmxsrK37ljtW G7zac5RIbsoGakOs1J81TMeWF10xhJgUScN+Ub+CrZkKDT6Rvojd3zKfwhQc0qps 8KFPv5bzubO7rHzzZK4eGFJGWTT9WCgDU5E8m690gdHf/A+CDALM4kSZloR5yI11 0KYmp6u7j3EvM5AuO7Rw9km7cj0a2IOJ1/YpkrlDzkKgpNIelprBOK5nSAL6OHSj k4smT+b2/jeyH7xrsMI3qBgxIB0vN7h8KQNc2+wR5Jm0TFwaMi9R9PB5U5WTKcc7 TcouvqckPkkhHCbdyB+t8F7EVSceqlObA2RGxfFH5D1ccHzzZQS8mhVTO85Z4oRI eDC6ujE4HIagYPNXv3KMeb1RtX2pS060ZO5XoOP68lLTdSj5WLN6QlaYpCaYFLxB VUIEzmi8rNVUD0/hLRyIuI9KBZCbSg20QaGRi3xe/eB6uxJMhhmMGnwwxb25xjyh sGB7d43t9x6RNEQVmZhm4ev73DAF9ni0PtTikZ5hxWjiyAyEBe3W//+f7WRWqtRK h3U3ksJ1RXh89KFDHkLstDfxtBxOwTHhv2F1gR01/FfBy60OmkaoEZ9qewN/sKh2 K8/HHR9oCnuZEmjZbpyI =3eC1 -----END PGP SIGNATURE----- --Apple-Mail=_686C0686-354A-4705-A42A-46B7ACB999BC-- From owner-svn-src-all@freebsd.org Fri Apr 14 20:46:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01E40D3ADE8; Fri, 14 Apr 2017 20:46:46 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3993D50; Fri, 14 Apr 2017 20:46:45 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cz878-000Aux-To; Fri, 14 Apr 2017 23:46:42 +0300 Date: Fri, 14 Apr 2017 23:46:42 +0300 From: Slawa Olhovchenkov To: "Ngie Cooper (yaneurabeya)" Cc: Larry Rosenman , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170414204642.GC70430@zxy.spb.ru> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> <20170414204219.GB70430@zxy.spb.ru> <5B71CE05-0791-4D90-A457-EA251F3989D2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5B71CE05-0791-4D90-A457-EA251F3989D2@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:46:46 -0000 On Fri, Apr 14, 2017 at 01:45:22PM -0700, Ngie Cooper (yaneurabeya) wrote: > > > On Apr 14, 2017, at 13:42, Slawa Olhovchenkov wrote: > > … > > > No, something like: > > % swapinfo > > Device 1K-blocks Used Avail Capacity > > /dev/ada0p2 33554432 0 33554432 0% > > /dev/ada1p2 33554432 0 33554432 0% > > Total 67108864 0 67108864 0% > > Striping dumps across multiple swap devices isn’t supported. Sorry. What about support in the future? From owner-svn-src-all@freebsd.org Fri Apr 14 20:46:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC2AFD3AE36; Fri, 14 Apr 2017 20:46:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A386CD98; Fri, 14 Apr 2017 20:46:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id i5so16482288pfc.3; Fri, 14 Apr 2017 13:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=8BWiGTiW0VOVw6dRH/rMAUFkS4N3ARiMg1FyOTVnKn8=; b=IjqSuRymmJcPpTXp86aYz02cxnxBhFi3SE75ZmmNZcM/oJvPFL87B5PiANktf/kvJ4 UbC/DnrWxSt34wP67ltRiviGaAiyBWo7P/Y56Zo33rgpH7uNeeK3+v0YBkYH7Y6zwaHw w318Zxp8F7BIs09AZarkUtkIken8aGkO/DpGs7YCBDWt53zyzjFOK0mGimzVdG0CCsaN GI0LsD4YXmdKD8LHDs1/sF8UlUn6y+ogoIFryjOyrEQfkDtBmNgUAYO84VsymSlkIfNc EJ2KhaRrhpxnFs1la7hwu8VVVJb9RvXhUCWElYE+FTYDj7aNdNqYGpgFpNfRs4TwwX/E Dh8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=8BWiGTiW0VOVw6dRH/rMAUFkS4N3ARiMg1FyOTVnKn8=; b=RUN5A/Wds4ojq1HFGEgktWzr3WbiDOhdSqYO9d0D1UJ0N5Eqf/tI4dzl7jn9q831Bw MMss7/1yhs8zTUoB12YyS5JxRNBrYeBpnJuPjrWh2V16LhoFcuKjeJn+3O9TQ00PB8jU HnG8zWGu6TH5gKYdF2X5ewi7RQI7tB20Uyjt3dcJEUAStw7YAREf5i6UL4BoxA6hzN94 HHjz2c2VGBG1MsIFQbg0gHwEvbaOciyw04uZbRYTKttwyqnOe2GfEe5Od0kiI7LolI/t W7ejudmYCuH+IgPBy7XPVXfO18QTmvMRQ17rASHqMaL3BxuReFUdzaCoXYTnzgvJjUDu TIsQ== X-Gm-Message-State: AN3rC/7XO+VjfUjTuyyDc8CYjRQ/fUb1J9n68ojRsc8U594/HupEzjP3 GndwswhuD6w5oQ== X-Received: by 10.98.214.12 with SMTP id r12mr8621067pfg.204.1492202811246; Fri, 14 Apr 2017 13:46:51 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p11sm4806807pfl.4.2017.04.14.13.46.49 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 13:46:49 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_A2F74109-396E-4EE1-B8D1-4DB860669382"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Fri, 14 Apr 2017 13:46:49 -0700 Cc: "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ngie Cooper Message-Id: <15ABDD42-E2C4-4519-B736-04A56FA8C2D0@gmail.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> <12820BAB-D8BA-4EDE-89BC-4BDB56B1E57A@gmail.com> To: Larry Rosenman X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:46:52 -0000 --Apple-Mail=_A2F74109-396E-4EE1-B8D1-4DB860669382 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 13:43, Larry Rosenman wrote: >=20 > On 4/14/17, 3:39 PM, "Ngie Cooper (yaneurabeya)" = = wrote: >=20 >> On Apr 14, 2017, at 13:37, Larry Rosenman wrote: >>=20 >> On 4/14/17, 3:33 PM, "Ngie Cooper (yaneurabeya)" = wrote: >>=20 >>> On Apr 14, 2017, at 13:26, Larry Rosenman wrote: >>>=20 >>> On 4/14/17, 3:19 PM, "Ngie Cooper (yaneurabeya)" = = wrote: >>>=20 >>>> On Apr 14, 2017, at 13:14, Slawa Olhovchenkov = wrote: >>>>=20 >>>> On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >>>>=20 >>>>> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper = wrote: >>>>>> Author: ngie >>>>>> Date: Fri Apr 14 19:41:48 2017 >>>>>> New Revision: 316938 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>>>>=20 >>>>>> Log: >>>>>> savecore: fix space calculation with respect to `minfree` in = check_space(..) >>>>>>=20 >>>>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>>>>> representable data to INT_MAX. Check the values received from >>>>>> strtoll(3), trimming trailing whitespace off the end to maintain >>>>>> POLA. >>>>>> - Use `KiB` instead of `kB` when describing free space, total = space, >>>>>> etc. I am now fully aware of `KiB` being the IEC standard for = 1024 >>>>>> bytes and `kB` being the IEC standard for 1000 bytes. >>>>>> - Store available number of KiB in `available` so it can be more >>>>>> easily queried and compared to ensure that there are enough KiB = to >>>>>> store the dump image on disk. >>>>>> - Print out the reserved space on disk, per `minfree`, so = end-users >>>>>> can troubleshoot why check_space(..) is reporting that there = isn't >>>>>> enough free space. >>>>>>=20 >>>>>> MFC after: 7 weeks >>>>>> Reviewed by: Anton Rang (earlier diff), cem = (earlier diff) >>>>>> Tested with: positive/negative cases (see review); make = tinderbox >>>>>> Sponsored by: Dell EMC Isilon >>>>>> Differential Revision: D10379 >>>>>=20 >>>>> The free space calculation is still uselessly conservative, = because it >>>>> doesn't account for the fact that core dumps will always be either >>>>> spare or compressed. The result is that savecore will frequently >>>>> refuse to save corefiles even when there's plenty of space. I >>>>> proposed removing the space check altogether in >>>>> https://reviews.freebsd.org/D2587. However, I agreed to wait = until >>>>> after the compressed core dump feature was merged, because then = mostly >>>>> accurate space checks will be possible. AFAIK the compressed core >>>>> dump feature still hasn't been finished. >>>>=20 >>>> Is posible (in the future) to use multiple swaps (on multiple = disks) >>>> for save core dumps? >>>=20 >>> Multiple swap devices is already handled by savecore(8), if one = uses fstab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on = individual devices. >>>=20 >>> As far as saving to multiple disks is concerned, I would hope that = one is using a redundancy capable filesystem (zfs) or RAID-like = technology (gmirror, graid, LSI Fusion=E2=80=99s RAID product line) to = stripe and/or mirror the data across multiple disks. >>=20 >> =E2=80=A6 >>=20 >>> How do I use multiple devices to have the system dump on all of my = swap? I got a message about not enough space, but there (I think) was = enough between multiple drives=E2=80=A6. >>=20 >> Something like: >>=20 >> - Create a zpool >> - Mount zpool to /crashdumps >> - Change dumpdir in /etc/rc.conf to be /crashdumps, e.g., echo = =E2=80=98dumpdir=3D/crashdumps=E2=80=99 >>=20 >> ? >> HTH, >> -Ngie >>=20 >> PS The issue with lack of space might be the issue that Alan = brought up earlier with compressed dumps and overly conservative free = space checks, or it might be the fact that dumpdir (default: /var/crash) = is full. >>=20 >>=20 >> I was talking about the actual crashdump to swap by the system. = /var/crash has 10T of space (my root pool). >=20 > If your memory is bigger than your swap, you=E2=80=99re = unfortunately not able to save the mini dump if the size of the saved = pages exceed the space on swap. I think this is where markj=E2=80=99s = compressed dumps feature will come in handy. > Thanks! > -Ngie >=20 >=20 > Yeah, I have the following: > borg.lerctr.org /home/ler $ swapctl -l > Device: 1024-blocks Used: > /dev/mfid0p3 8388608 0 > /dev/mfid1p3 8388608 0 > /dev/mfid2p3 8388608 0 > /dev/mfid3p3 8388608 0 > /dev/mfid4p3 8388608 0 > /dev/mfid5p3 8388608 0 > borg.lerctr.org /home/ler $ sysctl hw.physmem > hw.physmem: 137368682496 > borg.lerctr.org /home/ler $ >=20 > SO 6 8G partitions (48G), but the dump is larger than 8G. Yup, that=E2=80=99s not going to work. Since you=E2=80=99re using = mfi(4), I=E2=80=99d try creating another 48GB large RAID-0 volume to = help deal with that issue. Cheers, -Ngie --Apple-Mail=_A2F74109-396E-4EE1-B8D1-4DB860669382 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8TU5AAoJEPWDqSZpMIYV/ZsP/R26qszjM8/4ZKtWuVhoNk5x fqKWa2SccHz3QgKomh13v92Yi+omgxUKxjrG3hoya0gs3ijDuAATu0ulbgp6NMMe a874IZZ+vZ6LxBS0+r3urcurqp26vmBDwqIj7OEC2IY7l6gmbErhAwbwLspJs06w tS1xxsmE7SSXnVMmUPHR5HAE/mLcMtI1evLZfHOoI7e6gHqtCSfDuA8od8UZDQse v7s1jdGJPIyRqifnTahrvx6nKEUU1zd3p2zCundIOARiIviCfNWHJyJ91SvQlIte cL8F2dvGhw6ORSRvKfj/45W0si/20vXT/3H/sNB2r3MQmWjGKx9jQhWPJgYrQoW7 ZiDFt6bBTeNmiiWCJijjCpLJM64dE4zjZ1rXx5YRgxPrasnVknE1MPNd93OTq/FB OuWA26NDPvzMRrAnjSKSxiEjUmkLtlbGzOJt7ekRqMjDl3GkJRheBTJblaMW1n1I qr4+G++kvWiuxBpmtW8tZlBRnEKLEEyiAU9MGi+WqzzM0pvovJa+/NfeBpV+NwUN RBrvhSEOOevBCSN5821BMfkwVt42ozwINLHyg6vkV+MgR4wZ8jEfz8Ns61ChtRX5 gb19gawJcIw4VrB8dp3Z1gXHLoK/nbFBlpycM14GUOiLxG9dLFY7pIjBrlM9+jjX lXzqkxuEqsjnRjqUXnQP =O4ss -----END PGP SIGNATURE----- --Apple-Mail=_A2F74109-396E-4EE1-B8D1-4DB860669382-- From owner-svn-src-all@freebsd.org Fri Apr 14 20:47:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33613D3AF71; Fri, 14 Apr 2017 20:47:59 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFFF4AD; Fri, 14 Apr 2017 20:47:57 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1cz88I-0005S3-Li; Fri, 14 Apr 2017 22:47:55 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Alan Somers" , "Mark Johnston" Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Ngie Cooper" Subject: Re: svn commit: r316938 - head/sbin/savecore References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> Date: Fri, 14 Apr 2017 22:47:53 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: 4868b52b90b9144be14ceb212c82ef23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:47:59 -0000 On Fri, 14 Apr 2017 22:29:18 +0200, Mark Johnston wrote: > On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: >> > Author: ngie >> > Date: Fri Apr 14 19:41:48 2017 >> > New Revision: 316938 >> > URL: https://svnweb.freebsd.org/changeset/base/316938 >> > >> > Log: >> > savecore: fix space calculation with respect to `minfree` in >> check_space(..) >> > >> > - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >> > representable data to INT_MAX. Check the values received from >> > strtoll(3), trimming trailing whitespace off the end to maintain >> > POLA. >> > - Use `KiB` instead of `kB` when describing free space, total space, >> > etc. I am now fully aware of `KiB` being the IEC standard for 1024 >> > bytes and `kB` being the IEC standard for 1000 bytes. >> > - Store available number of KiB in `available` so it can be more >> > easily queried and compared to ensure that there are enough KiB to >> > store the dump image on disk. >> > - Print out the reserved space on disk, per `minfree`, so end-users >> > can troubleshoot why check_space(..) is reporting that there isn't >> > enough free space. >> > >> > MFC after: 7 weeks >> > Reviewed by: Anton Rang (earlier diff), cem >> (earlier diff) >> > Tested with: positive/negative cases (see review); make tinderbox >> > Sponsored by: Dell EMC Isilon >> > Differential Revision: D10379 >> >> The free space calculation is still uselessly conservative, because it >> doesn't account for the fact that core dumps will always be either >> spare or compressed. The result is that savecore will frequently >> refuse to save corefiles even when there's plenty of space. I >> proposed removing the space check altogether in >> https://reviews.freebsd.org/D2587. However, I agreed to wait until >> after the compressed core dump feature was merged, because then mostly >> accurate space checks will be possible. AFAIK the compressed core >> dump feature still hasn't been finished. > > I had held off on it for a while because it was going to conflict with > the work to add encrypted dump support, which of course has finished. > > The patch to add compression support is here and should largely still > work: > https://people.freebsd.org/~markj/patches/core-compression/20141110-kern_dump.diff > > I've been hesitant about pushing it forward: > - The dump_write* APIs need some simplification after the addition of > encrypted dump support and support for dumping to 4Kn drives. > - I'm not sure how encryption should compose with compression. It seems > intuitively obvious that we should compress before encrypting if the > compression is to be of any use, but I don't know enough to know > whether the compression might somehow compromise the effectiveness of > the encryption. > > If anyone has some insight on the second of these two points, I'd > appreciate hearing it. About compression before encryption there is some information. For example: https://en.wikipedia.org/wiki/CRIME Openssh removed compression in pre-authentication in http://www.openssh.com/txt/release-7.4 Regards, Ronald. From owner-svn-src-all@freebsd.org Fri Apr 14 20:48:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AAEDD3AFFF; Fri, 14 Apr 2017 20:48:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0445D280; Fri, 14 Apr 2017 20:48:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id g23so1851842pfj.1; Fri, 14 Apr 2017 13:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=2/WXq9IIH1TBB3wberFA1DU/gs02HjPRE/sNCjaIgCA=; b=gtu2MidoEOcoySk0IZt/jpkrddSOzPYadgAYiewdrUUPRzjmTP8r+355G/UyjnDVFa gXU/O/Scj/BW/h2Or+tSrjvrwWi6TUmcGcDdRrW6n5xJPlh6zOrf4Ob6mU81M274/O+c tkjAdhHpZRakb88wpHy0GFTLC5V0J2Vbdo+m+bhRvN+wcpucox1AoakFxhhOGmUNns/u BnPPZw2AvWRZUF0wL+slJp3tQU2jiL2uMv0DRRX0ZeZk/NUboHW38lW35wn+Xv/8uqeQ /NAD16SRP3KmRMu+Ho0CBaAFJNxQ49Rfey6HOxBlwAUHe+RpiAMzfScXcvporqGCqP7o WBiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=2/WXq9IIH1TBB3wberFA1DU/gs02HjPRE/sNCjaIgCA=; b=XYh02dMtztlUozvCXeANJnepJF2ZN0re7gNNKvQu+shE+DA7AvNKbyy+DrB2MD0LJ1 IKnbZ2wrc3FPqRDMPlKmcrSN0vLu9W92nlbNlHjZYeg3Wp5a/O7IyEq/aeHfRrmG4ayp /avjj4Botebqeai2I5pmWxG+uPn5+B0TMNbnH5383F1xn6+8WuRxGPnqG1J2U3AS971T 08b4uKSEVnM7And4wam9VyCXFHGlzGYR/S6UyEkeu/M1dvVw92nb5uqW8itJ0DTeQxjT CHodCas0cbDypLDNt3gfySxLLGS5ZDR2Vm0BV/ZusOWQz5nX052JBpBx5Y47vjS2gKda aDTA== X-Gm-Message-State: AN3rC/7SnaO2HBblENagXlnN2URFWdEhtXXgIGRmbB0XH9L8eF7V2ppv cKAsqW66YMz2fQ== X-Received: by 10.98.141.216 with SMTP id p85mr4619336pfk.195.1492202899671; Fri, 14 Apr 2017 13:48:19 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id w23sm4787379pfa.84.2017.04.14.13.48.18 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 13:48:18 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_53E51C39-2BFA-4461-AA7B-BCEE9F52B13C"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20170414204642.GC70430@zxy.spb.ru> Date: Fri, 14 Apr 2017 13:48:17 -0700 Cc: Larry Rosenman , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Message-Id: <15897BA3-F2AC-40B0-9C71-5DC4E213309B@gmail.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> <20170414204219.GB70430@zxy.spb.ru> <5B71CE05-0791-4D90-A457-EA251F3989D2@gmail.com> <20170414204642.GC70430@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:48:20 -0000 --Apple-Mail=_53E51C39-2BFA-4461-AA7B-BCEE9F52B13C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 13:46, Slawa Olhovchenkov wrote: >=20 > On Fri, Apr 14, 2017 at 01:45:22PM -0700, Ngie Cooper (yaneurabeya) = wrote: >=20 >>=20 >>> On Apr 14, 2017, at 13:42, Slawa Olhovchenkov = wrote: >>=20 >> =E2=80=A6 >>=20 >>> No, something like: >>> % swapinfo >>> Device 1K-blocks Used Avail Capacity >>> /dev/ada0p2 33554432 0 33554432 0% >>> /dev/ada1p2 33554432 0 33554432 0% >>> Total 67108864 0 67108864 0% >>=20 >> Striping dumps across multiple swap devices isn=E2=80=99t supported. = Sorry. >=20 > What about support in the future? *shrugs* I don=E2=80=99t have a crystal ball to say yay or nay, but = saving full dumps out to disk seems foolhardy to say the least. = Shrinking down the dataset seems like a more sensible problem to solve = than striping data across disks. -Ngie --Apple-Mail=_53E51C39-2BFA-4461-AA7B-BCEE9F52B13C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8TWRAAoJEPWDqSZpMIYVyhsQAImJEM0imKHDWEZQW1yeYe4n Cy3zB6m3hcJYrgl4esoZorzz2sWspCKGalvG9zh6sexRt7tbn9jfyp9G+mUiStpM 2qTGSqKb/Fz7GowVRx9klQaonKLv9v3OPdH9ybqT5etJqlYz/qYZvrn5MW9mVZLh YSqsfrkzZjDfEsZGA72IdyA4oR+OIztN4DTRST6RsM7nj6UgpWKm6ABY+gEDM/cj 4fz2tdksKAg6Ke42/iaxmIpFSxV3cqEMUAORB9H+WUozI9LFqAvBaFrdeW33w1JJ nl5XaGSw751qgA2I1vjZjavsD8zJhzZ2o6akaCXcaoGarupjQvaM6O+99+HRt5Pn K6OvPFQy6B4fBY8UPtgeyXmdMgRnMdSJrle45ST4CfzuC6ZFAPjfhrH662sKfcTF 0oofcodvzVT0CapfB2yzlC9RH/Ok6aQ/CxykjkIAz5yl8sqCwK2Ga/WElqkFO4K4 D5dT8FHHHZzjekKhv2XcBY98keCNBNPtkVNjlFjU4+kO9rBnqAayq7mDYHNkhJgp 4dns+Rs+hpWoigsJ2AnFX8fuz3BB36YxJ7692+zYKPvU15KkrkbJCDtLAr77I5++ jrQi4udCHafZkGsl1jz2NMhsMRTHIP2s7RBtWvmQC6F7PPwgcP/FqFGACBUgBpCt bkHCpWsC35Vtz/cPwJ6Z =zdrZ -----END PGP SIGNATURE----- --Apple-Mail=_53E51C39-2BFA-4461-AA7B-BCEE9F52B13C-- From owner-svn-src-all@freebsd.org Fri Apr 14 20:48:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACEB4D3E06E; Fri, 14 Apr 2017 20:48:36 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 780A03D3; Fri, 14 Apr 2017 20:48:36 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-transfer-encoding:Content-type:Mime-version:In-Reply-To: References:Message-ID:CC:To:From:Subject:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=UDTZ+qx6i9G3JJzEIg+awJVN7S5+HgnqaL8gTSQpJyE=; b=FQE2oGRw1i1zV3aSNwHMbr2oOA T+dfQJnEb5CQ3nu75weBgzflpNUs+vjLLoBSGsk8nZVreFbscz4fh0GTdeX37COeFnU/08PNprysO snklbYgOuyLmrzDOF8Wvt1zP0LkzXkQcScWmE/I9M7X9ZBqy0KjelhHPC3FppNEsME8U=; Received: from [74.203.163.58] (port=3743 helo=[10.106.10.41]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1cz88x-000Izz-Rf; Fri, 14 Apr 2017 15:48:35 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Fri, 14 Apr 2017 15:48:06 -0500 Subject: Re: svn commit: r316938 - head/sbin/savecore From: Larry Rosenman To: "Ngie Cooper (yaneurabeya)" CC: "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ngie Cooper Message-ID: <3D9A20AF-074F-494A-95FF-7A39CC964EA3@lerctr.org> Thread-Topic: svn commit: r316938 - head/sbin/savecore References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> <12820BAB-D8BA-4EDE-89BC-4BDB56B1E57A@gmail.com> <15ABDD42-E2C4-4519-B736-04A56FA8C2D0@gmail.com> In-Reply-To: <15ABDD42-E2C4-4519-B736-04A56FA8C2D0@gmail.com> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:48:36 -0000 On 4/14/17, 3:46 PM, "Ngie Cooper (yaneurabeya)" wr= ote: =20 > On Apr 14, 2017, at 13:43, Larry Rosenman wrote: >=20 > On 4/14/17, 3:39 PM, "Ngie Cooper (yaneurabeya)" wrote: >=20 >> On Apr 14, 2017, at 13:37, Larry Rosenman wrote: >>=20 >> On 4/14/17, 3:33 PM, "Ngie Cooper (yaneurabeya)" wrote: >>=20 >>> On Apr 14, 2017, at 13:26, Larry Rosenman wrote: >>>=20 >>> On 4/14/17, 3:19 PM, "Ngie Cooper (yaneurabeya)" wrote: >>>=20 >>>> On Apr 14, 2017, at 13:14, Slawa Olhovchenkov wro= te: >>>>=20 >>>> On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >>>>=20 >>>>> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper w= rote: >>>>>> Author: ngie >>>>>> Date: Fri Apr 14 19:41:48 2017 >>>>>> New Revision: 316938 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>>>>=20 >>>>>> Log: >>>>>> savecore: fix space calculation with respect to `minfree` in che= ck_space(..) >>>>>>=20 >>>>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>>>>> representable data to INT_MAX. Check the values received from >>>>>> strtoll(3), trimming trailing whitespace off the end to maintain >>>>>> POLA. >>>>>> - Use `KiB` instead of `kB` when describing free space, total sp= ace, >>>>>> etc. I am now fully aware of `KiB` being the IEC standard for 10= 24 >>>>>> bytes and `kB` being the IEC standard for 1000 bytes. >>>>>> - Store available number of KiB in `available` so it can be more >>>>>> easily queried and compared to ensure that there are enough KiB = to >>>>>> store the dump image on disk. >>>>>> - Print out the reserved space on disk, per `minfree`, so end-us= ers >>>>>> can troubleshoot why check_space(..) is reporting that there isn= 't >>>>>> enough free space. >>>>>>=20 >>>>>> MFC after: 7 weeks >>>>>> Reviewed by: Anton Rang (earlier diff), cem (ear= lier diff) >>>>>> Tested with: positive/negative cases (see review); make tinderb= ox >>>>>> Sponsored by: Dell EMC Isilon >>>>>> Differential Revision: D10379 >>>>>=20 >>>>> The free space calculation is still uselessly conservative, becau= se it >>>>> doesn't account for the fact that core dumps will always be eithe= r >>>>> spare or compressed. The result is that savecore will frequently >>>>> refuse to save corefiles even when there's plenty of space. I >>>>> proposed removing the space check altogether in >>>>> https://reviews.freebsd.org/D2587. However, I agreed to wait unt= il >>>>> after the compressed core dump feature was merged, because then m= ostly >>>>> accurate space checks will be possible. AFAIK the compressed cor= e >>>>> dump feature still hasn't been finished. >>>>=20 >>>> Is posible (in the future) to use multiple swaps (on multiple disk= s) >>>> for save core dumps? >>>=20 >>> Multiple swap devices is already handled by savecore(8), if one us= es fstab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on individu= al devices. >>>=20 >>> As far as saving to multiple disks is concerned, I would hope that= one is using a redundancy capable filesystem (zfs) or RAID-like technology = (gmirror, graid, LSI Fusion=E2=80=99s RAID product line) to stripe and/or mirror t= he data across multiple disks. >>=20 >> =E2=80=A6 >>=20 >>> How do I use multiple devices to have the system dump on all of my = swap? I got a message about not enough space, but there (I think) was enoug= h between multiple drives=E2=80=A6. >>=20 >> Something like: >>=20 >> - Create a zpool >> - Mount zpool to /crashdumps >> - Change dumpdir in /etc/rc.conf to be /crashdumps, e.g., echo =E2=80=98= dumpdir=3D/crashdumps=E2=80=99 >>=20 >> ? >> HTH, >> -Ngie >>=20 >> PS The issue with lack of space might be the issue that Alan broug= ht up earlier with compressed dumps and overly conservative free space check= s, or it might be the fact that dumpdir (default: /var/crash) is full. >>=20 >>=20 >> I was talking about the actual crashdump to swap by the system. /va= r/crash has 10T of space (my root pool). >=20 > If your memory is bigger than your swap, you=E2=80=99re unfortunately no= t able to save the mini dump if the size of the saved pages exceed the space= on swap. I think this is where markj=E2=80=99s compressed dumps feature will come= in handy. > Thanks! > -Ngie >=20 >=20 > Yeah, I have the following: > borg.lerctr.org /home/ler $ swapctl -l > Device: 1024-blocks Used: > /dev/mfid0p3 8388608 0 > /dev/mfid1p3 8388608 0 > /dev/mfid2p3 8388608 0 > /dev/mfid3p3 8388608 0 > /dev/mfid4p3 8388608 0 > /dev/mfid5p3 8388608 0 > borg.lerctr.org /home/ler $ sysctl hw.physmem > hw.physmem: 137368682496 > borg.lerctr.org /home/ler $ >=20 > SO 6 8G partitions (48G), but the dump is larger than 8G. =20 Yup, that=E2=80=99s not going to work. Since you=E2=80=99re using mfi(4), I=E2=80=99d try= creating another 48GB large RAID-0 volume to help deal with that issue. Cheers, -Ngie No can do, the rest of the space is zpool. borg.lerctr.org /home/ler $ gpart show =3D> 40 3905945520 mfid0 GPT (1.8T) 40 1600 1 efi (800K) 1640 1024 2 freebsd-boot (512K) 2664 1432 - free - (716K) 4096 16777216 3 freebsd-swap (8.0G) 16781312 3889162240 4 freebsd-zfs (1.8T) 3905943552 2008 - free - (1.0M) =3D> 40 3905945520 mfid1 GPT (1.8T) 40 1600 1 efi (800K) 1640 1024 2 freebsd-boot (512K) 2664 1432 - free - (716K) 4096 16777216 3 freebsd-swap (8.0G) 16781312 3889162240 4 freebsd-zfs (1.8T) 3905943552 2008 - free - (1.0M) =3D> 40 3905945520 mfid2 GPT (1.8T) 40 1600 1 efi (800K) 1640 1024 2 freebsd-boot (512K) 2664 1432 - free - (716K) 4096 16777216 3 freebsd-swap (8.0G) 16781312 3889162240 4 freebsd-zfs (1.8T) 3905943552 2008 - free - (1.0M) =3D> 40 3905945520 mfid3 GPT (1.8T) 40 1600 1 efi (800K) 1640 1024 2 freebsd-boot (512K) 2664 1432 - free - (716K) 4096 16777216 3 freebsd-swap (8.0G) 16781312 3889162240 4 freebsd-zfs (1.8T) 3905943552 2008 - free - (1.0M) =3D> 40 3905945520 mfid4 GPT (1.8T) 40 1600 1 efi (800K) 1640 1024 2 freebsd-boot (512K) 2664 1432 - free - (716K) 4096 16777216 3 freebsd-swap (8.0G) 16781312 3889162240 4 freebsd-zfs (1.8T) 3905943552 2008 - free - (1.0M) =3D> 40 3905945520 mfid5 GPT (1.8T) 40 1600 1 efi (800K) 1640 1024 2 freebsd-boot (512K) 2664 1432 - free - (716K) 4096 16777216 3 freebsd-swap (8.0G) 16781312 3889162240 4 freebsd-zfs (1.8T) 3905943552 2008 - free - (1.0M) borg.lerctr.org /home/ler $ =20 From owner-svn-src-all@freebsd.org Fri Apr 14 20:53:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40125D3E2C0; Fri, 14 Apr 2017 20:53:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B774B8A; Fri, 14 Apr 2017 20:53:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id c198so16561613pfc.0; Fri, 14 Apr 2017 13:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=cwle98wvSi0uS7NqzRk4PyX4DLYcx8oD+XkFO6B+FvU=; b=tJSP8LfXBYdERYdQvPAkujMaZisltxMFycnFZg2fsj3D5ai+U2cswRsPBuqw9t3Lv3 fxHc2RwxMaXg9XFGAXVRb38Cl2uziudxu1pJMSuH7QHNaIIdB/2w2HLnBfVD7kE8qlUF CfWi95pkl53iQ4RhkrrDrdYVB7LRi3/PArbidHcv+ZnGkB0lkw2Fn/jmyanZK8yonCmm trCi7B8L+B1sX9fdZCf0cd9azOwvMqaRSESyj9tsicCVz6U0nsxN50QxmLKo6h7CMbMX t9hoX8T9YhTXlxVDaeQv24HSM13Ob9FcKLJjKUvqbbvV+kh1CmCDgaTWmZCgmhfm7Ty6 fi7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=cwle98wvSi0uS7NqzRk4PyX4DLYcx8oD+XkFO6B+FvU=; b=nrb5LjCoqf3PdM8tpeoNi57e5801lJm9u4zT9cpXWNiKfDA2BW3J7Pw9fNwZsfo4eT 3rxuDLc8azUwkw80eZlLLCzjjWwrregYbXETeuUreLjJT9utfLlQG0wu6UqPLhw9qiDs NErhcy450nbOk45x7Q3qXTcRHyiMLxI7uZvQfVv7FWyPB2XQVyFedfOvcIalnujwrl8s zKl9VLnt4lv9t78dFMpOuwRejn+7Ta0/aNM1bg7oZBoKbNoGzoA7YLlbuE8KMPClyTnS GzkSMSo/BICjKPsvUXcxdGtw8ISlN2zqtOnSXyq9h08jWNAFOK9zgOm1FBq3N332wxTC k1fg== X-Gm-Message-State: AN3rC/44NtEaNAzjaFKW23sI9NjSqjTg1aT9/A9+JLhzceOIZOqOSGVh Y4u07FHSgljtZteR7Y8= X-Received: by 10.98.34.20 with SMTP id i20mr9007789pfi.102.1492203197653; Fri, 14 Apr 2017 13:53:17 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id e76sm4792355pfk.75.2017.04.14.13.53.16 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 13:53:16 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_DA8712BE-056C-41D2-850D-848F4A200F8D"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <3D9A20AF-074F-494A-95FF-7A39CC964EA3@lerctr.org> Date: Fri, 14 Apr 2017 13:53:15 -0700 Cc: "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ngie Cooper Message-Id: <6F064C87-173F-47DF-A72A-D52B07F9F9A0@gmail.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> <12820BAB-D8BA-4EDE-89BC-4BDB56B1E57A@gmail.com> <15ABDD42-E2C4-4519-B736-04A56FA8C2D0@gmail.com> <3D9A20AF-074F-494A-95FF-7A39CC964EA3@lerctr.org> To: Larry Rosenman X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:53:18 -0000 --Apple-Mail=_DA8712BE-056C-41D2-850D-848F4A200F8D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 13:48, Larry Rosenman wrote: =E2=80=A6 > No can do, the rest of the space is pool. >_>=E2=80=A6 that sucks. This is part of the reason why I still make my = swap partitions greater than or equal to the amount of memory I have in = systems :/.. The best recommendation I have is either: wait for compressed dump = support, repartition/shuffle around data on your disks so the = configuration fits, or try and get ccd to work *shrugs*. -Ngie --Apple-Mail=_DA8712BE-056C-41D2-850D-848F4A200F8D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8Ta7AAoJEPWDqSZpMIYVbxsP/1D2tbeJPwFwpkRQJElBupGg VSBfLo4j94MOpILkE8vYnWzmcxVHC9rjgZLjXbkGnmOmr+5BUS1+RTsYie75VTaN Mu7vJdan21/ijHufZqCeOFt/YTiDGM0KS2HUw0RTd3XAknk/sKzxqg60r/U5WvEg VqXEffF8f7YcqPrQIoE6GaeHdJ/PnQty/YG1ej92uU5UgJwa0lyOIPiRT8cUPaH0 xivhaD5Jrqy49QWKEzSGS6E1l6ExoksMek7ac9lWvy7CHft+3TcimePw7G1Nxe6P lo0mfeXqQVNg+LDwd/UtvV6B22D61hb90WJV4kIzb4NRzEOqkVfJaBBP9Q132fKj h/YfZMdep1NaUS62tah8OSPMUqMxLcKD4SqaRNtq91niB7EEilM+lSgiWd3YP+vA ELdmsRKzlma6wewnJ91/TnKWe7cYqi4iIjTWQl2qvkWYk3LLzq6X4YO+kYKtYr2E mw3U5tS0qQuXlstIeTNEXBRlwRpz/icbKDLVBWNaknw/CQ1HxX7MpgB+EyIASQki lkedahaI9aMzGJEceEC3kkUaUwbygdKjqBVuP9CNCpKLv94kZOlaOcitXLZbfNyD 7/PnTOgqoeK/c1V3c/y6dfxtvv4FCxwanXQxW6MAsOpY5l6Im6SoYj8/jpGIWbMr iHOjrgSxFvKk3FRNnSpU =zDTX -----END PGP SIGNATURE----- --Apple-Mail=_DA8712BE-056C-41D2-850D-848F4A200F8D-- From owner-svn-src-all@freebsd.org Fri Apr 14 20:54:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFFBDD3E336; Fri, 14 Apr 2017 20:54:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7EBCD9; Fri, 14 Apr 2017 20:54:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f51.google.com with SMTP id y18so2655266wmh.0; Fri, 14 Apr 2017 13:54:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=jLJHTvhQ45fPLtF6i8vRX49c8KtjsF7jFekdo0eCAAE=; b=q9FzmMpvspeIaiHFKQvnsVx/MOpL2ei9o8/wr++jexAYkdfHIek4nMqRqSw1+dH8O4 c8e0HYtbIb27wBbqju0HUbWjijy7ZO17mdHLB/JBxz+EEDDK0Y+k1CIrftPtK+Zsp8Ev 27F4hRTgeoQo6eD2qAzSe+pUCU7OEyMwefMMKG5GOM1RUMH/j5JA2Cvalw1jR7AHSXkq zSMeBt+1y48JdGFfteVzVHH2wBRRopQCo9gBcUZpAp5YWzcsOIIDkZgj0109KRWOCjNZ ddTunqCkuuyJOdC7nvRwRckvSO1vTdczO2adEDk3coF5/tQGdNJWLhXMhkIc0tYH345+ RXvQ== X-Gm-Message-State: AN3rC/7KX7wi6QMQBvYTQT+2s6nxEmdPslaaSgQ5cccTZoXP+muRuF4S eW4nvgnu05ecjzWLjkbbsw== X-Received: by 10.28.7.18 with SMTP id 18mr64052wmh.80.1492203243425; Fri, 14 Apr 2017 13:54:03 -0700 (PDT) Received: from mail-wr0-f173.google.com (mail-wr0-f173.google.com. [209.85.128.173]) by smtp.gmail.com with ESMTPSA id y66sm3740141wrb.39.2017.04.14.13.54.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 13:54:03 -0700 (PDT) Received: by mail-wr0-f173.google.com with SMTP id z109so55818787wrb.1; Fri, 14 Apr 2017 13:54:03 -0700 (PDT) X-Received: by 10.223.160.214 with SMTP id n22mr9389993wrn.198.1492203243152; Fri, 14 Apr 2017 13:54:03 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Fri, 14 Apr 2017 13:54:02 -0700 (PDT) In-Reply-To: References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> From: Conrad Meyer Date: Fri, 14 Apr 2017 13:54:02 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316938 - head/sbin/savecore To: Alan Somers Cc: Mark Johnston , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:54:06 -0000 On Fri, Apr 14, 2017 at 1:41 PM, Alan Somers wrote: > On Fri, Apr 14, 2017 at 2:29 PM, Mark Johnston wrote: >> I've been hesitant about pushing it forward: >> - The dump_write* APIs need some simplification after the addition of >> encrypted dump support and support for dumping to 4Kn drives. >> - I'm not sure how encryption should compose with compression. It seems >> intuitively obvious that we should compress before encrypting if the >> compression is to be of any use, but I don't know enough to know >> whether the compression might somehow compromise the effectiveness of >> the encryption. >> >> If anyone has some insight on the second of these two points, I'd >> appreciate hearing it. > > I think compress then encrypt should be ok. AFAIK all attacks against > compress-then-encrypt systems have involved either incredibly short > payloads that are easy to guess, or a stream of separately compressed > blocks that can be fingerprinted. But core dumps are very long, and > they can't be fingerprinted in whole because they're unique. If you > were to encrypt each page individually then pages could be > fingerprinted, so don't do that. Instead, compress the entire core > dump as a single stream and you should be ok. +1. From owner-svn-src-all@freebsd.org Fri Apr 14 20:57:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D4ADD3E3BE; Fri, 14 Apr 2017 20:57:25 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-oi0-x22c.google.com (mail-oi0-x22c.google.com [IPv6:2607:f8b0:4003:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3561E51; Fri, 14 Apr 2017 20:57:24 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-oi0-x22c.google.com with SMTP id f22so100861290oib.2; Fri, 14 Apr 2017 13:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LsQ9R81ymmjNdMlanNSo9alSr4oIT8XWYPIgpRLGJtw=; b=AtSIxN/u3DXnd3vgXZgJtmOGAGUYKnOll1eBraLKlK7lgbX5pg4r0vTbN23NpLsqit HB62p7f7vWc0njpkGL9MlsCWgmFk6I1mE/YI0kCNbhL6zagiMcwJvA7DWG6OUcQFcC/5 tuB++aBFkyeoG5hNUuzn1s7MzTvXDBA3+RNXwXPa4xPXt4pGt0vVHFELyHO0BUP8nntD UCHP6XH3UPEedFvHH6Re9yHaLcGW8BBfSesOckl7dMC2BtUrI6joKHD4xw/5QTrlJk/G jR/k6RXesEM8oRZWAXZDctJMtc3mdZNrjdQ8JVMu9fc3yttiv/kez/JMQ1agGWQi5Hls ljDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LsQ9R81ymmjNdMlanNSo9alSr4oIT8XWYPIgpRLGJtw=; b=SFHd656iL7qCgIkQmjhuiPM6CG1b2vLuAVsU36F/Bg2Cq0BAGRukKcSA/3HTSWczNj 8wJd+2p8ZqNrcIOexppo3ifO3clCKN/z9xqlG/N2GsOxHPNwctBcesPHiJFD0y2+8FJT mb/XAX3tpZBbOw9hh5HO7HZYJntTGz5dR3CFSMvR4lP0XoKNZpJofOCyT4Q78IfXLwyT 9zg/jD2Xf5DLfTmd7KdeDGDrfjCamrpGL5hNiTgUmTr7JNjZkTb2gXjr4k8z9Qye9Os7 cp9nmPl0ph26K8q7bNP/+wf0cDw3MDzkSJ78acj1y0i40X99FrZMRfJwetjfRCLyEGr2 TCuw== X-Gm-Message-State: AN3rC/7/BZlryhIlG++FRyIVqtghgEi+DqXGa+ltF5oGJdYCOpVpNY7G +qjtW1rDntpujzDtC1J9Pprg/5pajQac X-Received: by 10.202.215.67 with SMTP id o64mr5480427oig.83.1492203443948; Fri, 14 Apr 2017 13:57:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.63.179 with HTTP; Fri, 14 Apr 2017 13:57:23 -0700 (PDT) In-Reply-To: References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> From: Xin LI Date: Fri, 14 Apr 2017 13:57:23 -0700 Message-ID: Subject: Re: svn commit: r316938 - head/sbin/savecore To: Ronald Klop Cc: Alan Somers , Mark Johnston , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 20:57:25 -0000 No, this is not the threat model for swaps. On Fri, Apr 14, 2017 at 1:47 PM, Ronald Klop wrote: > On Fri, 14 Apr 2017 22:29:18 +0200, Mark Johnston wrote: > >> On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: >>> >>> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: >>> > Author: ngie >>> > Date: Fri Apr 14 19:41:48 2017 >>> > New Revision: 316938 >>> > URL: https://svnweb.freebsd.org/changeset/base/316938 >>> > >>> > Log: >>> > savecore: fix space calculation with respect to `minfree` in >>> > check_space(..) >>> > >>> > - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>> > representable data to INT_MAX. Check the values received from >>> > strtoll(3), trimming trailing whitespace off the end to maintain >>> > POLA. >>> > - Use `KiB` instead of `kB` when describing free space, total space, >>> > etc. I am now fully aware of `KiB` being the IEC standard for 1024 >>> > bytes and `kB` being the IEC standard for 1000 bytes. >>> > - Store available number of KiB in `available` so it can be more >>> > easily queried and compared to ensure that there are enough KiB to >>> > store the dump image on disk. >>> > - Print out the reserved space on disk, per `minfree`, so end-users >>> > can troubleshoot why check_space(..) is reporting that there isn't >>> > enough free space. >>> > >>> > MFC after: 7 weeks >>> > Reviewed by: Anton Rang (earlier diff), cem (earlier >>> > diff) >>> > Tested with: positive/negative cases (see review); make tinderbox >>> > Sponsored by: Dell EMC Isilon >>> > Differential Revision: D10379 >>> >>> The free space calculation is still uselessly conservative, because it >>> doesn't account for the fact that core dumps will always be either >>> spare or compressed. The result is that savecore will frequently >>> refuse to save corefiles even when there's plenty of space. I >>> proposed removing the space check altogether in >>> https://reviews.freebsd.org/D2587. However, I agreed to wait until >>> after the compressed core dump feature was merged, because then mostly >>> accurate space checks will be possible. AFAIK the compressed core >>> dump feature still hasn't been finished. >> >> >> I had held off on it for a while because it was going to conflict with >> the work to add encrypted dump support, which of course has finished. >> >> The patch to add compression support is here and should largely still >> work: >> >> https://people.freebsd.org/~markj/patches/core-compression/20141110-kern_dump.diff >> >> I've been hesitant about pushing it forward: >> - The dump_write* APIs need some simplification after the addition of >> encrypted dump support and support for dumping to 4Kn drives. >> - I'm not sure how encryption should compose with compression. It seems >> intuitively obvious that we should compress before encrypting if the >> compression is to be of any use, but I don't know enough to know >> whether the compression might somehow compromise the effectiveness of >> the encryption. >> >> If anyone has some insight on the second of these two points, I'd >> appreciate hearing it. > > > About compression before encryption there is some information. For example: > https://en.wikipedia.org/wiki/CRIME > Openssh removed compression in pre-authentication in > http://www.openssh.com/txt/release-7.4 > > Regards, > Ronald. > From owner-svn-src-all@freebsd.org Fri Apr 14 21:10:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F301D3E5EC for ; Fri, 14 Apr 2017 21:10:58 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 338CC6E8 for ; Fri, 14 Apr 2017 21:10:58 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io0-x22f.google.com with SMTP id a103so120282868ioj.1 for ; Fri, 14 Apr 2017 14:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=omPZ9aZno4X4MatDoAzosacGpeYjIkg4UH5YgK8z+IY=; b=fz4Z3Svqy78+ACqjb0f+HJYUYRp2D3KIuonqFuhlRk+S9uxj/8380xkmeJLYAZrarQ aPHcveF3uySDvbo1Ds0irFD3DF42hujY8DUVqTb05itLFhyv2UUew2vdJ1CZkEq9sjSZ Ej23ArpwuAUJm2n/QrT/7T+VY+F3wplWAlgXkIo7Ag4GCYcW3Y+fzlaS54L4DYIfa0HQ OQ1HvyvghJVTHG+9vExeMPJV6bqEaArd770qi33bBoeBqzWU6D7Q/a8Xq2JDyxz459UP BQ3gwSUmBbtCKQMvv2cfLd/zkdX3XGwQnHJR9Raecd1BZ3w0NSVybf57NTsY5I11BgjM 7icA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=omPZ9aZno4X4MatDoAzosacGpeYjIkg4UH5YgK8z+IY=; b=C6PmUn4VoBKqGOjNP8wmfdV71n2VPaMy9p82F3XRscFRcNJVORId8DNlWLRv/9NkGm Io5zXYpjNJYHPi/7BzcbiyjqgjMxoMWu0fhTRRtGyJfTiEZH5okbCC6Hhkz+WbKAcKqL eHXQaeyAhFEQw3H4X9NxVhyO5yFAyc1C++x0CqLueBkvCm70AUMdVCp+yIC7htYAjyBi byTp2so/41l/dmFoeGKjAPOX9AaYuLrgvBwPcA9Q+SyQ9wbYVMfCEQQFRRQtX1yICH53 cayL1YMEciE0J63ajveGsDW9CE2454FFV0pg9z1wkO2wHB5PT1bwR8SyymA8cGbSb9Dn KO/g== X-Gm-Message-State: AN3rC/7tdpItytOhChhR0ULSAT2KFA/rCv6HNMFIC+PSgcdqoLQCUHcQ urOa8NMMPQx6QwSXPhll3pmu73P3EBlt X-Received: by 10.107.128.69 with SMTP id b66mr13293094iod.25.1492204257567; Fri, 14 Apr 2017 14:10:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.104.135 with HTTP; Fri, 14 Apr 2017 14:10:56 -0700 (PDT) In-Reply-To: <513B1846-02E3-49E0-BAA2-CA923EDC5DFF@gmail.com> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <12133324.zHp9vo75vZ@overcee.wemm.org> <6942092.OsECkgAp13@overcee.wemm.org> <513B1846-02E3-49E0-BAA2-CA923EDC5DFF@gmail.com> From: Maxim Sobolev Date: Fri, 14 Apr 2017 14:10:56 -0700 Message-ID: Subject: Re: svn commit: r316874 - head/sys/kern To: "Ngie Cooper (yaneurabeya)" Cc: Peter Wemm , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Hiren Panchasara Content-Type: multipart/mixed; boundary=001a113f8c6cb4eaad054d26e0ee X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 21:10:58 -0000 --001a113f8c6cb4eaad054d26e0ee Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Peter, Ngie, Looks like out of that refactoring came a logical bug that is present in the head, which causes syslod to first to shutdown the socket for reading and then try to select/recv on it (which is somewhat stupid). And that issue has been masked by shutdown() on datagram socket becoming effectively a NOP in 11 & head 20 months ago. It only affects head though, 11-stable still has the old code which does not include that half-closed socket into the select list. Attached patch is expected to fix head, Peter, it would be nice if you can give it a try (restoring latest changes into uipc_sockets.c) and let me know if it helps. Thanks! On Fri, Apr 14, 2017 at 12:48 PM, Ngie Cooper (yaneurabeya) < yaneurabeya@gmail.com> wrote: > > > On Apr 14, 2017, at 12:46, Peter Wemm wrote: > > > > On Friday, April 14, 2017 12:41:52 PM Maxim Sobolev wrote: > >> Thanks, Peter. I will try to look into this asap. > > > > I don't understand what is going on yet. Presumably there must be other > > changes in play that affect udp/select sometime between the original 20= 15 > > change and this. The syslogd -s code is Old(TM). I'm also wondering > whether > > the -s code even works at all since the 2015 / r285910 change... > > syslogd has been refactored a lot on ^/head. I don=E2=80=99t think it=E2= =80=99s safe to > say that the ^/head and ^/stable/11 and earlier copies will function the > same. > Thanks, > -Ngie > --=20 Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts Tel (Canada): +1-778-783-0474 Tel (Toll-Free): +1-855-747-7779 Fax: +1-866-857-6942 Web: http://www.sippysoft.com MSN: sales@sippysoft.com Skype: SippySoft --001a113f8c6cb4eaad054d26e0ee Content-Type: text/plain; charset=US-ASCII; name="syslogd.diff" Content-Disposition: attachment; filename="syslogd.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j1ibuchu1 SW5kZXg6IHN5c2xvZ2QuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXNsb2dkLmMJKHJldmlzaW9uIDMxNjg1 NCkKKysrIHN5c2xvZ2QuYwkod29ya2luZyBjb3B5KQpAQCAtNzAyLDcgKzcwMiw3IEBACiAJCSAg ICBzaXplb2YoZmRfbWFzaykpOwogCiAJCVNUQUlMUV9GT1JFQUNIKHNsLCAmc2hlYWQsIG5leHQp IHsKLQkJCWlmIChzbC0+c2xfc29ja2V0ICE9IC0xKQorCQkJaWYgKHNsLT5zbF9zb2NrZXQgIT0g LTEgJiYgc2wtPnNsX3JlY3YgIT0gTlVMTCkKIAkJCQlGRF9TRVQoc2wtPnNsX3NvY2tldCwgZmRz cik7CiAJCX0KIAkJaSA9IHNlbGVjdChmZHNybWF4ICsgMSwgZmRzciwgTlVMTCwgTlVMTCwKQEAg LTI4NzcsNiArMjg3Nyw3IEBACiAJc3RydWN0IGFkZHJpbmZvIGhpbnRzLCAqcmVzLCAqcmVzMDsK IAlpbnQgZXJyb3I7CiAJY2hhciAqY3A7CisJaW50ICgqc2xfcmVjdikoc3RydWN0IHNvY2tsaXN0 ICopOwogCS8qCiAJICogV2UgaGF2ZSB0byBoYW5kbGUgdGhpcyBjYXNlIGZvciBiYWNrd2FyZHMg Y29tcGF0aWJpbGl0eToKIAkgKiBJZiB0aGVyZSBhcmUgdHdvIChvciBtb3JlKSBjb2xvbnMgYnV0 IG5vICdbJyBhbmQgJ10nLApAQCAtMzAwMyw2ICszMDA0LDcgQEAKIAkJfQogCQlkcHJpbnRmKCJu ZXcgc29ja2V0IGZkIGlzICVkXG4iLCBzKTsKIAkJbGlzdGVuKHMsIDUpOworCQlzbF9yZWN2ID0g c29ja2xpc3RfcmVjdl9zb2NrOwogCQlkcHJpbnRmKCJzaHV0ZG93blxuIik7CiAJCWlmIChTZWN1 cmVNb2RlIHx8IHJlcy0+YWlfZmFtaWx5ID09IEFGX0xPQ0FMKSB7CiAJCQkvKiBGb3JiaWQgY29t bXVuaWNhdGlvbiBpbiBzZWN1cmUgbW9kZS4gKi8KQEAgLTMwMTMsNiArMzAxNSw3IEBACiAJCQkJ CWRpZSgwKTsKIAkJCX0KIAkJCWRwcmludGYoImxpc3RlbmluZyBvbiBzb2NrZXRcbiIpOworCQkJ c2xfcmVjdiA9IE5VTEw7CiAJCX0gZWxzZQogCQkJZHByaW50Zigic2VuZGluZyBvbiBzb2NrZXRc biIpOwogCQlhZGRzb2NrKHJlcy0+YWlfYWRkciwgcmVzLT5haV9hZGRybGVuLApAQCAtMzAxOSw3 ICszMDIyLDcgQEAKIAkJICAgICYoc3RydWN0IHNvY2tsaXN0KXsKIAkJCS5zbF9zb2NrZXQgPSBz LAogCQkJLnNsX3BlZXIgPSBwZSwKLQkJCS5zbF9yZWN2ID0gc29ja2xpc3RfcmVjdl9zb2NrCisJ CQkuc2xfcmVjdiA9IHNsX3JlY3YKIAkJfSk7CiAJfQogCWZyZWVhZGRyaW5mbyhyZXMwKTsK --001a113f8c6cb4eaad054d26e0ee-- From owner-svn-src-all@freebsd.org Fri Apr 14 21:14:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A87B1D3E782; Fri, 14 Apr 2017 21:14:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6A09D6; Fri, 14 Apr 2017 21:14:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x244.google.com with SMTP id g2so17875861pge.2; Fri, 14 Apr 2017 14:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=h4i/VrxLXNXu4AdNnGtVuBN267xh0HMiY/nNoJoer5U=; b=seBb1XUaqSTe7YObmx3n6JYMmYuJcHXFgKjumSykPtqS/htfK4ZdYyhgIU/7VmE0+/ flr6CWqsziCnzOB4tr7k0LBQmO1I9UnvXf2xRWWGsZjc7Qyg8mbadWbJpWNT/LXreLAt gxPRIhsGpST+3UekI9Kr8T3jh+nNSEdKW0lyqL/ZU9v95cwliDp8sv/VoyLlqn/xDUy0 GIknAoJvrLlyJtuXIZE4Xyui6/ytImx5fY0B3TdKtTMcErR5MDDlbCcxmjZcUagEKK/z Nj9chgiedMvF2johp2SayXtaNymq/P0/gTaRxcDLXFwXMMooJn7T3jthHqc65ie8w1FV 9t5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=h4i/VrxLXNXu4AdNnGtVuBN267xh0HMiY/nNoJoer5U=; b=UoMmwA3pTXIsvVAeXuYjsZdN+dsGWi5Z5xxaIZmTq3ELR3s5oKxOrmqDDbdGshHT4E 2wmEXjW6IVJFjk2e6hLOAXhh7GRhPi6lPNdjKheIIcQH+12W2K2nOkF3cChs0ULbQIiu NcmjCJcBij452jvjiB9VA6dqul4VBciMJ3rQ9b0JejbBWF/aTzFvNYCcV21y3dB/a1f4 jPeMJCo5d8helTpm4taAT721qfGSQSMXgvUxXOryFpAX5pRaeCebUiNK1f4YMApEGT11 9sXf0adrtJrUQaR9OcwVEkw4/HZ2wTYe5+DBM/c9rJ0CA7yzyMM4twoxAo9JE5qug5Cl 1mlA== X-Gm-Message-State: AN3rC/7Of6Ym0y44pbuNzRc9MYF7RqxSakFbKJqqSSGgw4bQ+Vakgz7z +qulT3NJFGJQ5wGLg2Q= X-Received: by 10.84.232.68 with SMTP id f4mr11137225pln.90.1492204458970; Fri, 14 Apr 2017 14:14:18 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p189sm4814546pfb.128.2017.04.14.14.14.17 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 14:14:18 -0700 (PDT) Subject: Re: svn commit: r316874 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_33D0C2FF-AD51-4BEE-9D9E-6749C1E773C8"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Fri, 14 Apr 2017 14:14:16 -0700 Cc: Peter Wemm , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Hiren Panchasara , Hiroki Sato Message-Id: References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <12133324.zHp9vo75vZ@overcee.wemm.org> <6942092.OsECkgAp13@overcee.wemm.org> <513B1846-02E3-49E0-BAA2-CA923EDC5DFF@gmail.com> To: Maxim Sobolev X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 21:14:19 -0000 --Apple-Mail=_33D0C2FF-AD51-4BEE-9D9E-6749C1E773C8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Apr 14, 2017, at 14:10, Maxim Sobolev = wrote: >=20 > Peter, Ngie, >=20 > Looks like out of that refactoring came a logical bug that is present = in the head, which causes syslod to first to shutdown the socket for = reading and then try to select/recv on it (which is somewhat stupid). = And that issue has been masked by shutdown() on datagram socket becoming = effectively a NOP in 11 & head 20 months ago. It only affects head = though, 11-stable still has the old code which does not include that = half-closed socket into the select list. Attached patch is expected to = fix head, Peter, it would be nice if you can give it a try (restoring = latest changes into uipc_sockets.c) and let me know if it helps. >=20 > Thanks! CCing hrs@ for input as he did the refactoring. Thanks! -Ngie PS LGTM with the change. Will wait for feedback from wemm@. --Apple-Mail=_33D0C2FF-AD51-4BEE-9D9E-6749C1E773C8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8TupAAoJEPWDqSZpMIYVO/0QAJT8tq4nDLxs65X7lQ2HjOlk v+ba03skz4hkhPU2k3N1sz67CuwFvsqFzlyu1wARBEje5yD1urBy7w6pKNQZbiYi jYdT78AE4q40XZU6XBD7Ne94BSczTe4uI8lfU3VMpv+Fnb1bL54HJ1MFUpTY4IZs KO1/CMv7XOqwuNiZDE2WFFEfTJQIB+JB/tgdQTiW3Aac7XNHiXS7i7hHC4WFp7Vi lsMZ/VGI0Umx6gvOmoimpjAK1fL2QbDh/JHDnklhm3evdIVSiS7cv9cOf+DZMsEH p8iJMHO8x7H4JVvAbJMBLZpLFDCfm47HMkDJZxaZAGhIWN43acefYgDaFnxk6oXt UJL4FoBF8XyTaHevv8Y/3KuxsBRHio36GpSpQ7/EbTw9TielxqZkUlXLAuQThtUt CsAXktFGZa3DAuOQ23/VXx0tTazNwfNuZalnIzaNfAIjCDv5K1Y0xXlz8yJqhmOe QTUOCt5Jz3M1XHhX9fGmx36utuMbavLPvhVEsueQ0JEDGhKXSBlxNIN6XB85YU29 c25O1PkvbcTlBppCMCshAONDcuSBqdjpUGbzPQmv5PXFO+IhNetQHu9PnayLbDNY JCKXIPATL1ZS28xZGASHORSe1oFze30OG5y18O2FbpUOoyDR2m9oOPjDlBZKVRcz qpJ2cJK2xWX7AD0tv3LW =aXDt -----END PGP SIGNATURE----- --Apple-Mail=_33D0C2FF-AD51-4BEE-9D9E-6749C1E773C8-- From owner-svn-src-all@freebsd.org Fri Apr 14 21:21:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C209CD3EBC2 for ; Fri, 14 Apr 2017 21:21:06 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90CDEE18 for ; Fri, 14 Apr 2017 21:21:06 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-it0-x231.google.com with SMTP id 70so1272689ita.0 for ; Fri, 14 Apr 2017 14:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Lt6woQbb8f2svgqmCXk3kRKPVnCzTbs8xRXehv558k4=; b=t8zzk+y3HvFTfLvluYbi++ati550vbrgc6oxxVVvUKcn7+83f1/aYBuZ3uWDUYRcQa IlqJJL0i/DuxPdipAMHGzHYhxp91J+8x9BU54z3JqckbOYC91RJ7k6rd7P3MM9n7X8rU 9GVIxGq/3BBVomSAk56SgHcpN59gyHwIPTCgXsmVtmuaEq1Kd6tddY9c4n6LbOmEJI2Z kraVhcLIL43ylIvTY7HmKd79US60ilbLBIaqlWCzHYL7iDvTLeUqDeoh5hwNUORxXXR6 pAVq2g8O4vIR3VW5MUJGa88NY/dYrYEA0DPxsmvvoF92b2qch4JBTfHiLu7nLGGa4Mo+ 8mCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Lt6woQbb8f2svgqmCXk3kRKPVnCzTbs8xRXehv558k4=; b=fG/FXZdM5rElbLzSk9ngD+6D0a9+hETWM6QU75rCfhU7sK4BSTZY0/DuCxvuVwkvwU O+GY/iHgBksxdJr/kvXA8KIqd33oIZqz0+kiE8zEJlQvvEmIxkVyeV2OAfQ61x9ZwZg4 f2lEmVGFLaXsmLDxLEtzAjyX3uR3peRhQD7wOX1Yixn+3n6em42CgiCt6JNrgI0xEBXq IvFnK7DggNPU7G2j1Va1ZI9WkN8FEtSWyh2PBXE7F277r5vnNHjhzIdM99wngHO/S27m CnNxaEIaZZWZXA0XblLgpLCAgcN/PiULIBCVVvbRQMo7gf5JO4KVRQlvQKamz4xF/Pnz x3JA== X-Gm-Message-State: AN3rC/7Uhgh7OI/cmBS/FGQK0fMDJE2gSImr4MfL2HWk0RoO1tkQ93wG itorUdqiQcnFOgJrX5N4xupkq+S7lmQS X-Received: by 10.36.10.129 with SMTP id 123mr632176itw.80.1492204865866; Fri, 14 Apr 2017 14:21:05 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.104.135 with HTTP; Fri, 14 Apr 2017 14:21:05 -0700 (PDT) In-Reply-To: <6942092.OsECkgAp13@overcee.wemm.org> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <12133324.zHp9vo75vZ@overcee.wemm.org> <6942092.OsECkgAp13@overcee.wemm.org> From: Maxim Sobolev Date: Fri, 14 Apr 2017 14:21:05 -0700 X-Google-Sender-Auth: kV0jSDJWo39zLMRQyxdbuopta60 Message-ID: Subject: Re: svn commit: r316874 - head/sys/kern To: Peter Wemm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Hiren Panchasara Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 21:21:06 -0000 Peter, It is actually the other way around. If you take syslogd code out of 11-stable and earlier that would work just fine with or without r316874. But since r285910 syslogd in head had been refactored a lot and I think that particular bug has introduced that has been masked by the shutdown() on datagram sockets becoming a NOP after r285910. Then r316874 restored our historical behavior for the shutdown(2) and bingo, bug in the new syslogd code is now causing it to spin when shutdown() != NOP. -Max On Fri, Apr 14, 2017 at 12:46 PM, Peter Wemm wrote: > On Friday, April 14, 2017 12:41:52 PM Maxim Sobolev wrote: > > Thanks, Peter. I will try to look into this asap. > > I don't understand what is going on yet. Presumably there must be other > changes in play that affect udp/select sometime between the original 2015 > change and this. The syslogd -s code is Old(TM). I'm also wondering > whether > the -s code even works at all since the 2015 / r285910 change... > > > -Max > > > > On Apr 14, 2017 12:32 PM, "Peter Wemm" wrote: > > > On Friday, April 14, 2017 11:49:26 AM Peter Wemm wrote: > > > > On Friday, April 14, 2017 05:23:28 PM Maxim Sobolev wrote: > > > > > Author: sobomax > > > > > Date: Fri Apr 14 17:23:28 2017 > > > > > New Revision: 316874 > > > > > URL: https://svnweb.freebsd.org/changeset/base/316874 > > > > > > > > > > Log: > > > > > Restore ability to shutdown DGRAM sockets, still forcing > ENOTCONN to > > > > > > be > > > > > > > > returned by the shutdown(2) system call. This ability has been > lost as > > > > > part > > > > > of the svn revision 285910. > > > > > > > > > > Reviewed by: ed, rwatson, glebius, hiren > > > > > MFC after: 2 weeks > > > > > Differential Revision: https://reviews.freebsd.org/D10351 > > > > > > > > This appears to have broken syslogd and had a major change in > behavior > > > > > > with > > > > > > > regards to select(2). > > > > > > > > If you run syslogd with the -s flag (which is default), it now spins > at > > > > > > 100% > > > > > > > cpu as all the shutdown sockets now return readable from select. > > > > > > > > Old releases / jails also manifest this behavor. If it wasn't for > > > > losing > > > > the ability to run old branch binaries I'd suggest changing syslogd > > > > instead, but we depend on this in the cluster and I expect others do > > > > too. > > > > > > > > I'm not 100% certain that this change is the culprit but a heads-up > > > > can't > > > > hurt. I'll try reverting it on the freebsd cluster next, after fixing > > > > the > > > > broken auditing changes. > > > > > > > > -Peter > > > > > > I can confirm that reverting r316874 fixes syslogd and backwards > > > compatability > > > with old branches. > > > > > > -- > > > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; > > > KI6FJV > > > UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 > > -- > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; > KI6FJV > UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 > From owner-svn-src-all@freebsd.org Fri Apr 14 21:28:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2AD9D3EDE4; Fri, 14 Apr 2017 21:28:59 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A38714D; Fri, 14 Apr 2017 21:28:59 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-oi0-x234.google.com with SMTP id b187so101325647oif.0; Fri, 14 Apr 2017 14:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eE4MoZ/XDlqBy+Axod21BQKoeZTwInjgWQdw7Pmj2qY=; b=MNggiWNNqhWBnxXjksZDQWzjo5/OyAFdHkboMwTR41qaz4q741xfZnmKljv3e7mH7I VQucMXDS8CyLk11sEGek6l1uImGH1s5du6d/rJNb0sp0OzzvZQmYt6aUHlQ2WVAVcZ9W lAJjUI4di4XWxTQ9stVnZX4Dr+eTvgENSTzUxItuEpwt7aSwOPXPMesngztZMmMCIpOC +qeKGSs2U9fv7gxHlni+OS67MgEK4MMNRXAQsuurmiDSnbMzSoOV2ClXoafv7O9zaLT4 g2mzbx/AVX7/Sf2UjswUye9iRab1he/5+n6WOtpDCTG9yevhq87pB2Zc92wv2K3i3qSg WhGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eE4MoZ/XDlqBy+Axod21BQKoeZTwInjgWQdw7Pmj2qY=; b=Gb0QDzb1HtB/UP+Oy7hrxmqBKQGac8uIF+VIB3Uwcxr79M4JzLHs0sWhEjU3vHiXoC axB/eueougec1Sq+Jsp+6w1EV6fpBIfyYNuPf7ob5DHgEFIKwu3p9fNqzaYdzsDTd5Z5 rTLv8vtSAHysoLojT8J0k0OXnkMU8IzeXiTFobVy0xyVXEHLNrgZwzgk739+RgcHNHAB vb2VsPmvnMhY/9G0uUdlDxV8KwK6sc0C5fPl3mzyzMMggsh5mr5ZsPxfDaqDAdNSNo8e j8VoJEW3BIt+TZD5OYn78HclQDZ4S2nr09NcN4UfXlLWJ2BK9oZ719k1ttojBkk4UGCd 3dqQ== X-Gm-Message-State: AN3rC/6B1vvEgY8sdj7kuEJkhGTz3gC007sjHZUMCA9Qy0CxbK4FvqWF uVGnx44jNyp/jXcFhJVHXCCWMb/DrKTIAZQ= X-Received: by 10.202.253.5 with SMTP id b5mr6249040oii.156.1492205338311; Fri, 14 Apr 2017 14:28:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.63.179 with HTTP; Fri, 14 Apr 2017 14:28:57 -0700 (PDT) In-Reply-To: <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> From: Xin LI Date: Fri, 14 Apr 2017 14:28:57 -0700 Message-ID: Subject: Re: svn commit: r316938 - head/sbin/savecore To: Mark Johnston Cc: Alan Somers , Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 21:28:59 -0000 On Fri, Apr 14, 2017 at 1:29 PM, Mark Johnston wrote: > - I'm not sure how encryption should compose with compression. It seems > intuitively obvious that we should compress before encrypting if the > compression is to be of any use, but I don't know enough to know > whether the compression might somehow compromise the effectiveness of > the encryption. I think the biggest concern is the added code involved in the dump process (which happen when the kernel is already unhealthy), which can jeopardize it and defeat the usefulness of having a crash dump being set up in the first place. And with textdumps available, the benefit of having compression is limited because we can request for minidump or full dumps only when the textdumps are not good enough for diagnosing the kernel bug. I don't think security (e.g. leaking information because of the use of compression) is a very big concern in this context because in order for the potential attacker to read the raw material needs a compromised system (unlike an attack from the network, where someone who controls the network would have access to the raw material); the dump is usually quite large, and measuring downtime would be hard at that scale. By the way (not meant to bikeshed) if I was to do this I'd prefer using lz4 or something that compresses faster than zlib. Cheers, From owner-svn-src-all@freebsd.org Fri Apr 14 21:30:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 380D6D3EE6F; Fri, 14 Apr 2017 21:30:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 225912D9; Fri, 14 Apr 2017 21:30:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v3ELU9Xj056487 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 14 Apr 2017 14:30:10 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v3ELU9NE056486; Fri, 14 Apr 2017 14:30:09 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 14 Apr 2017 14:30:09 -0700 From: Gleb Smirnoff To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316822 - in head/sys: kern netinet netinet6 Message-ID: <20170414213009.GI1033@FreeBSD.org> References: <201704140900.v3E90mJU030549@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704140900.v3E90mJU030549@repo.freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 21:30:12 -0000 Andrey, On Fri, Apr 14, 2017 at 09:00:48AM +0000, Andrey V. Elsukov wrote: A> Log: A> Rework r316770 to make it protocol independent and general, like we A> do for streaming sockets. A> A> And do more cleanup in the sbappendaddr_locked_internal() to prevent A> leak information from existing mbuf to the one, that will be possible A> created later by netgraph. Thanks! Your comment actually made me think that this can be improved... A> @@ -794,8 +794,20 @@ sbappendaddr_locked_internal(struct sock A> return (0); A> m->m_len = asa->sa_len; A> bcopy(asa, mtod(m, caddr_t), asa->sa_len); A> - if (m0) A> + if (m0) { A> m_clrprotoflags(m0); A> + m_tag_delete_chain(m0); A> + /* A> + * Clear some persistent info from pkthdr. A> + * We don't use m_demote(), because some netgraph consumers A> + * expect M_PKTHDR presence. A> + */ Looks like you are right and only netgraph wants to see M_PKTHDR there. Rest of datagram socket consumers just use m_nextpkt to differentiate records from parts of records. I'll see if we can fix ng_ksocket and use same code on datagram sockbufs as we do on stream ones. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Fri Apr 14 21:36:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44FC1D3C063; Fri, 14 Apr 2017 21:36:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 102C19A8; Fri, 14 Apr 2017 21:36:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 7B06BD65E7D; Sat, 15 Apr 2017 07:36:37 +1000 (AEST) Date: Sat, 15 Apr 2017 07:36:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Edward Tomasz Napierala cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316941 - head/sys/kern In-Reply-To: <201704142015.v3EKFYWA017623@repo.freebsd.org> Message-ID: <20170415064658.L4428@besplex.bde.org> References: <201704142015.v3EKFYWA017623@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=dWgNT7XYNQrq3qRgAOUA:9 a=+jEqtf1s3R9VXZ0wqowq2kgwd+I=:19 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 21:36:46 -0000 On Fri, 14 Apr 2017, Edward Tomasz Napierala wrote: > Log: > Don't try to write out bufs that have already failed with ENXIO. > This fixes some panics after disconnecting mounted disks. > > Submitted by: imp (slightly different version, which I've then lost) > Reviewed by: kib, imp, mckusick > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D9674 > > Modified: > head/sys/kern/vfs_bio.c > > Modified: head/sys/kern/vfs_bio.c > ============================================================================== > --- head/sys/kern/vfs_bio.c Fri Apr 14 20:15:17 2017 (r316940) > +++ head/sys/kern/vfs_bio.c Fri Apr 14 20:15:34 2017 (r316941) > @@ -2290,18 +2290,28 @@ brelse(struct buf *bp) > bdirty(bp); > } > if (bp->b_iocmd == BIO_WRITE && (bp->b_ioflags & BIO_ERROR) && > + (bp->b_error != ENXIO || !LIST_EMPTY(&bp->b_dep)) && > !(bp->b_flags & B_INVAL)) { > /* > - * Failed write, redirty. Must clear BIO_ERROR to prevent > - * pages from being scrapped. > + * Failed write, redirty. All errors except ENXIO (which > + * means the device is gone) are expected to be potentially > + * transient - underlying media might work if tried again > + * after EIO, and memory might be available after an ENOMEM. > + * > + * Do this also for buffers that failed with ENXIO, but have > + * non-empty dependencies - the soft updates code might need > + * to access the buffer to untangle them. > + * > + * Must clear BIO_ERROR to prevent pages from being scrapped. > */ This is hard to fix, but I have used a version that only retries after EIO for 15-20 years. I didn't think of ENOMEM. The media is unlikely to come back after EIO too. For removable media, you might be able to get the write done to new media, but a panic reading from the new media is just as likely. Geom "tasting" might prevent the new media being used. ENXIO is actually the one error that can often be recovered from. I wrote a form of "tasting" in a toy OS 30-35 years ago. It handled removal of "mounted" disks with pending writes too well, in a way that made recovery from non-transient I/O errors almost impossible without turning off the system. ENXIO was treated as a transient I/O error. It was recovered from perfectly if the user could find the original media and unremove it. The "tasting" usually worked to detect different media and disallow writing cached data to a different disk. Media errors were common, and when one occurred for writing the method of replacing the disk by a garbage one did't work since it was a different disk. The most common one was writing to a write protected disk, and that was recoverable by removing the write protection. But often you really didn't want to write to that disk, but wanted to write somewhere. The only way to continue was to reboot to discard the write. Bruce From owner-svn-src-all@freebsd.org Fri Apr 14 21:40:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CF6ED3C32E; Fri, 14 Apr 2017 21:40:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E07F0CF1; Fri, 14 Apr 2017 21:40:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 2BCDC10A7B9; Fri, 14 Apr 2017 17:40:23 -0400 (EDT) From: John Baldwin To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316938 - head/sbin/savecore Date: Fri, 14 Apr 2017 14:40:18 -0700 Message-ID: <1940104.87G28XVdqf@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201704141941.v3EJfmCW003347@repo.freebsd.org> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 14 Apr 2017 17:40:23 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 21:40:31 -0000 On Friday, April 14, 2017 07:41:48 PM Ngie Cooper wrote: > Author: ngie > Date: Fri Apr 14 19:41:48 2017 > New Revision: 316938 > URL: https://svnweb.freebsd.org/changeset/base/316938 > > Log: > savecore: fix space calculation with respect to `minfree` in check_space(..) > > - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > representable data to INT_MAX. Check the values received from > strtoll(3), trimming trailing whitespace off the end to maintain > POLA. > - Use `KiB` instead of `kB` when describing free space, total space, > etc. I am now fully aware of `KiB` being the IEC standard for 1024 > bytes and `kB` being the IEC standard for 1000 bytes. I will just rant lightly that no one actually uses this in the real world. Good lucking finding a "16 GiB" DIMM on crucial.com or a 4Kin drive. A kilobyte is a power of 2. The End. (Next up we'll have to rename 4k displays to 4k) -- John Baldwin From owner-svn-src-all@freebsd.org Fri Apr 14 21:42:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2910DD3C50A; Fri, 14 Apr 2017 21:42:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01AC9F2; Fri, 14 Apr 2017 21:42:28 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3ELgSXH052422; Fri, 14 Apr 2017 21:42:28 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3ELgRMK052395; Fri, 14 Apr 2017 21:42:27 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201704142142.v3ELgRMK052395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 14 Apr 2017 21:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316942 - in stable/10/bin/sh: . tests/expansion X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 21:42:29 -0000 Author: jilles Date: Fri Apr 14 21:42:27 2017 New Revision: 316942 URL: https://svnweb.freebsd.org/changeset/base/316942 Log: MFC r314686: sh: Fix crash if a -T trap is taken during command substitution. Code like t=$(stat -f %m "$file") segfaulted if -T was active and a trap was taken while the shell was waiting for the child process to finish. What happened was that the dotrap() call in waitforjob() was hit. This re-entered command execution (including expand.c) at a point not expected by expbackq(), and global state (unallocated stack string and argbackq) was corrupted. To fix this, change expbackq() to prepare for command execution to be re-entered. In stable/10, there is more global state that needs to be restored than in stable/11 and head. Reported by: bdrewery Added: stable/10/bin/sh/tests/expansion/cmdsubst21.0 - copied unchanged from r314686, head/bin/sh/tests/expansion/cmdsubst21.0 stable/10/bin/sh/tests/expansion/cmdsubst22.0 - copied unchanged from r314686, head/bin/sh/tests/expansion/cmdsubst22.0 Modified: stable/10/bin/sh/expand.c stable/10/bin/sh/tests/expansion/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Fri Apr 14 20:15:34 2017 (r316941) +++ stable/10/bin/sh/expand.c Fri Apr 14 21:42:27 2017 (r316942) @@ -439,9 +439,6 @@ expbackq(union node *cmd, int quoted, in p = grabstackstr(dest); evalbackcmd(cmd, &in); ungrabstackstr(p, dest); - ifsfirst = saveifs; - ifslastp = savelastp; - argbackq = saveargbackq; p = in.buf; lastc = '\0'; @@ -479,14 +476,20 @@ expbackq(union node *cmd, int quoted, in close(in.fd); if (in.buf) ckfree(in.buf); - if (in.jp) + if (in.jp) { + p = grabstackstr(dest); exitstatus = waitforjob(in.jp, (int *)NULL); - if (quoted == 0) - recordregion(startloc, dest - stackblock(), 0); + ungrabstackstr(p, dest); + } TRACE(("expbackq: size=%td: \"%.*s\"\n", ((dest - stackblock()) - startloc), (int)((dest - stackblock()) - startloc), stackblock() + startloc)); + ifsfirst = saveifs; + ifslastp = savelastp; + if (quoted == 0) + recordregion(startloc, dest - stackblock(), 0); + argbackq = saveargbackq; expdest = dest; INTON; } Modified: stable/10/bin/sh/tests/expansion/Makefile ============================================================================== --- stable/10/bin/sh/tests/expansion/Makefile Fri Apr 14 20:15:34 2017 (r316941) +++ stable/10/bin/sh/tests/expansion/Makefile Fri Apr 14 21:42:27 2017 (r316942) @@ -41,6 +41,8 @@ FILES+= cmdsubst17.0 FILES+= cmdsubst18.0 FILES+= cmdsubst19.0 FILES+= cmdsubst20.0 +FILES+= cmdsubst21.0 +FILES+= cmdsubst22.0 FILES+= export1.0 FILES+= export2.0 FILES+= export3.0 Copied: stable/10/bin/sh/tests/expansion/cmdsubst21.0 (from r314686, head/bin/sh/tests/expansion/cmdsubst21.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/bin/sh/tests/expansion/cmdsubst21.0 Fri Apr 14 21:42:27 2017 (r316942, copy of r314686, head/bin/sh/tests/expansion/cmdsubst21.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +set -T +trapped='' +trap "trapped=x$trapped" TERM +[ "x$($SH -c "kill $$")y" = xy ] && [ "$trapped" = x ] Copied: stable/10/bin/sh/tests/expansion/cmdsubst22.0 (from r314686, head/bin/sh/tests/expansion/cmdsubst22.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/bin/sh/tests/expansion/cmdsubst22.0 Fri Apr 14 21:42:27 2017 (r316942, copy of r314686, head/bin/sh/tests/expansion/cmdsubst22.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +set -T +trapped='' +trap "trapped=x$trapped" TERM +[ "x$(:; kill $$)y" = xy ] && [ "$trapped" = x ] From owner-svn-src-all@freebsd.org Fri Apr 14 21:49:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38C2CD3C5FD; Fri, 14 Apr 2017 21:49:22 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F141A3D8; Fri, 14 Apr 2017 21:49:21 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3ELnL4L054911; Fri, 14 Apr 2017 21:49:21 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3ELnKMo054907; Fri, 14 Apr 2017 21:49:20 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201704142149.v3ELnKMo054907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 14 Apr 2017 21:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316943 - in stable/11/sys: conf kern netinet netinet6 sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 21:49:22 -0000 Author: smh Date: Fri Apr 14 21:49:20 2017 New Revision: 316943 URL: https://svnweb.freebsd.org/changeset/base/316943 Log: MFC r303863: Move IPv4 & IPv6 specific jail functions to netinet and netinet6 files. Sponsored by: Multiplay Added: stable/11/sys/netinet/in_jail.c - copied unchanged from r303863, head/sys/netinet/in_jail.c stable/11/sys/netinet6/in6_jail.c - copied unchanged from r303863, head/sys/netinet6/in6_jail.c Modified: stable/11/sys/conf/files stable/11/sys/kern/kern_jail.c stable/11/sys/sys/jail.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Fri Apr 14 21:42:27 2017 (r316942) +++ stable/11/sys/conf/files Fri Apr 14 21:49:20 2017 (r316943) @@ -3805,6 +3805,7 @@ netinet/in_fib.c optional inet netinet/in_gif.c optional gif inet | netgraph_gif inet netinet/ip_gre.c optional gre inet netinet/ip_id.c optional inet +netinet/in_jail.c optional inet netinet/in_mcast.c optional inet netinet/in_pcb.c optional inet | inet6 netinet/in_pcbgroup.c optional inet pcbgroup | inet6 pcbgroup @@ -3871,6 +3872,7 @@ netinet6/in6_cksum.c optional inet6 netinet6/in6_fib.c optional inet6 netinet6/in6_gif.c optional gif inet6 | netgraph_gif inet6 netinet6/in6_ifattach.c optional inet6 +netinet6/in6_jail.c optional inet6 netinet6/in6_mcast.c optional inet6 netinet6/in6_pcb.c optional inet6 netinet6/in6_pcbgroup.c optional inet6 pcbgroup Modified: stable/11/sys/kern/kern_jail.c ============================================================================== --- stable/11/sys/kern/kern_jail.c Fri Apr 14 21:42:27 2017 (r316942) +++ stable/11/sys/kern/kern_jail.c Fri Apr 14 21:49:20 2017 (r316943) @@ -130,14 +130,6 @@ static void prison_racct_attach(struct p static void prison_racct_modify(struct prison *pr); static void prison_racct_detach(struct prison *pr); #endif -#ifdef INET -static int _prison_check_ip4(const struct prison *, const struct in_addr *); -static int prison_restrict_ip4(struct prison *pr, struct in_addr *newip4); -#endif -#ifdef INET6 -static int _prison_check_ip6(struct prison *pr, struct in6_addr *ia6); -static int prison_restrict_ip6(struct prison *pr, struct in6_addr *newip6); -#endif /* Flags for prison_deref */ #define PD_DEREF 0x01 @@ -252,54 +244,6 @@ prison0_init(void) strlcpy(prison0.pr_osrelease, osrelease, sizeof(prison0.pr_osrelease)); } -#ifdef INET -static int -qcmp_v4(const void *ip1, const void *ip2) -{ - in_addr_t iaa, iab; - - /* - * We need to compare in HBO here to get the list sorted as expected - * by the result of the code. Sorting NBO addresses gives you - * interesting results. If you do not understand, do not try. - */ - iaa = ntohl(((const struct in_addr *)ip1)->s_addr); - iab = ntohl(((const struct in_addr *)ip2)->s_addr); - - /* - * Do not simply return the difference of the two numbers, the int is - * not wide enough. - */ - if (iaa > iab) - return (1); - else if (iaa < iab) - return (-1); - else - return (0); -} -#endif - -#ifdef INET6 -static int -qcmp_v6(const void *ip1, const void *ip2) -{ - const struct in6_addr *ia6a, *ia6b; - int i, rc; - - ia6a = (const struct in6_addr *)ip1; - ia6b = (const struct in6_addr *)ip2; - - rc = 0; - for (i = 0; rc == 0 && i < sizeof(struct in6_addr); i++) { - if (ia6a->s6_addr[i] > ia6b->s6_addr[i]) - rc = 1; - else if (ia6a->s6_addr[i] < ia6b->s6_addr[i]) - rc = -1; - } - return (rc); -} -#endif - /* * struct jail_args { * struct jail *jail; @@ -845,7 +789,8 @@ kern_jail_set(struct thread *td, struct * address to connect from. */ if (ip4s > 1) - qsort(ip4 + 1, ip4s - 1, sizeof(*ip4), qcmp_v4); + qsort(ip4 + 1, ip4s - 1, sizeof(*ip4), + prison_qcmp_v4); /* * Check for duplicate addresses and do some simple * zero and broadcast checks. If users give other bogus @@ -893,7 +838,8 @@ kern_jail_set(struct thread *td, struct ip6 = malloc(ip6s * sizeof(*ip6), M_PRISON, M_WAITOK); bcopy(op, ip6, ip6s * sizeof(*ip6)); if (ip6s > 1) - qsort(ip6 + 1, ip6s - 1, sizeof(*ip6), qcmp_v6); + qsort(ip6 + 1, ip6s - 1, sizeof(*ip6), + prison_qcmp_v6); for (ii = 0; ii < ip6s; ii++) { if (IN6_IS_ADDR_UNSPECIFIED(&ip6[ii])) { error = EINVAL; @@ -1486,7 +1432,8 @@ kern_jail_set(struct thread *td, struct (ip4s == 1 && tpr->pr_ip4s == 1)) continue; for (ii = 0; ii < ip4s; ii++) { - if (_prison_check_ip4(tpr, &ip4[ii]) == 0) { + if (prison_check_ip4_locked(tpr, &ip4[ii]) == + 0) { error = EADDRINUSE; vfs_opterror(opts, "IPv4 addresses clash"); @@ -1552,7 +1499,8 @@ kern_jail_set(struct thread *td, struct (ip6s == 1 && tpr->pr_ip6s == 1)) continue; for (ii = 0; ii < ip6s; ii++) { - if (_prison_check_ip6(tpr, &ip6[ii]) == 0) { + if (prison_check_ip6_locked(tpr, &ip6[ii]) == + 0) { error = EADDRINUSE; vfs_opterror(opts, "IPv6 addresses clash"); @@ -2770,684 +2718,6 @@ prison_proc_free(struct prison *pr) mtx_unlock(&pr->pr_mtx); } - -#ifdef INET -/* - * Restrict a prison's IP address list with its parent's, possibly replacing - * it. Return true if the replacement buffer was used (or would have been). - */ -static int -prison_restrict_ip4(struct prison *pr, struct in_addr *newip4) -{ - int ii, ij, used; - struct prison *ppr; - - ppr = pr->pr_parent; - if (!(pr->pr_flags & PR_IP4_USER)) { - /* This has no user settings, so just copy the parent's list. */ - if (pr->pr_ip4s < ppr->pr_ip4s) { - /* - * There's no room for the parent's list. Use the - * new list buffer, which is assumed to be big enough - * (if it was passed). If there's no buffer, try to - * allocate one. - */ - used = 1; - if (newip4 == NULL) { - newip4 = malloc(ppr->pr_ip4s * sizeof(*newip4), - M_PRISON, M_NOWAIT); - if (newip4 != NULL) - used = 0; - } - if (newip4 != NULL) { - bcopy(ppr->pr_ip4, newip4, - ppr->pr_ip4s * sizeof(*newip4)); - free(pr->pr_ip4, M_PRISON); - pr->pr_ip4 = newip4; - pr->pr_ip4s = ppr->pr_ip4s; - } - return (used); - } - pr->pr_ip4s = ppr->pr_ip4s; - if (pr->pr_ip4s > 0) - bcopy(ppr->pr_ip4, pr->pr_ip4, - pr->pr_ip4s * sizeof(*newip4)); - else if (pr->pr_ip4 != NULL) { - free(pr->pr_ip4, M_PRISON); - pr->pr_ip4 = NULL; - } - } else if (pr->pr_ip4s > 0) { - /* Remove addresses that aren't in the parent. */ - for (ij = 0; ij < ppr->pr_ip4s; ij++) - if (pr->pr_ip4[0].s_addr == ppr->pr_ip4[ij].s_addr) - break; - if (ij < ppr->pr_ip4s) - ii = 1; - else { - bcopy(pr->pr_ip4 + 1, pr->pr_ip4, - --pr->pr_ip4s * sizeof(*pr->pr_ip4)); - ii = 0; - } - for (ij = 1; ii < pr->pr_ip4s; ) { - if (pr->pr_ip4[ii].s_addr == ppr->pr_ip4[0].s_addr) { - ii++; - continue; - } - switch (ij >= ppr->pr_ip4s ? -1 : - qcmp_v4(&pr->pr_ip4[ii], &ppr->pr_ip4[ij])) { - case -1: - bcopy(pr->pr_ip4 + ii + 1, pr->pr_ip4 + ii, - (--pr->pr_ip4s - ii) * sizeof(*pr->pr_ip4)); - break; - case 0: - ii++; - ij++; - break; - case 1: - ij++; - break; - } - } - if (pr->pr_ip4s == 0) { - free(pr->pr_ip4, M_PRISON); - pr->pr_ip4 = NULL; - } - } - return (0); -} - -/* - * Pass back primary IPv4 address of this jail. - * - * If not restricted return success but do not alter the address. Caller has - * to make sure to initialize it correctly (e.g. INADDR_ANY). - * - * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv4. - * Address returned in NBO. - */ -int -prison_get_ip4(struct ucred *cred, struct in_addr *ia) -{ - struct prison *pr; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP4)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP4)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip4 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - ia->s_addr = pr->pr_ip4[0].s_addr; - mtx_unlock(&pr->pr_mtx); - return (0); -} - -/* - * Return 1 if we should do proper source address selection or are not jailed. - * We will return 0 if we should bypass source address selection in favour - * of the primary jail IPv4 address. Only in this case *ia will be updated and - * returned in NBO. - * Return EAFNOSUPPORT, in case this jail does not allow IPv4. - */ -int -prison_saddrsel_ip4(struct ucred *cred, struct in_addr *ia) -{ - struct prison *pr; - struct in_addr lia; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); - - if (!jailed(cred)) - return (1); - - pr = cred->cr_prison; - if (pr->pr_flags & PR_IP4_SADDRSEL) - return (1); - - lia.s_addr = INADDR_ANY; - error = prison_get_ip4(cred, &lia); - if (error) - return (error); - if (lia.s_addr == INADDR_ANY) - return (1); - - ia->s_addr = lia.s_addr; - return (0); -} - -/* - * Return true if pr1 and pr2 have the same IPv4 address restrictions. - */ -int -prison_equal_ip4(struct prison *pr1, struct prison *pr2) -{ - - if (pr1 == pr2) - return (1); - - /* - * No need to lock since the PR_IP4_USER flag can't be altered for - * existing prisons. - */ - while (pr1 != &prison0 && -#ifdef VIMAGE - !(pr1->pr_flags & PR_VNET) && -#endif - !(pr1->pr_flags & PR_IP4_USER)) - pr1 = pr1->pr_parent; - while (pr2 != &prison0 && -#ifdef VIMAGE - !(pr2->pr_flags & PR_VNET) && -#endif - !(pr2->pr_flags & PR_IP4_USER)) - pr2 = pr2->pr_parent; - return (pr1 == pr2); -} - -/* - * Make sure our (source) address is set to something meaningful to this - * jail. - * - * Returns 0 if jail doesn't restrict IPv4 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv4. Address passed in in NBO and returned in NBO. - */ -int -prison_local_ip4(struct ucred *cred, struct in_addr *ia) -{ - struct prison *pr; - struct in_addr ia0; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP4)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP4)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip4 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - ia0.s_addr = ntohl(ia->s_addr); - if (ia0.s_addr == INADDR_LOOPBACK) { - ia->s_addr = pr->pr_ip4[0].s_addr; - mtx_unlock(&pr->pr_mtx); - return (0); - } - - if (ia0.s_addr == INADDR_ANY) { - /* - * In case there is only 1 IPv4 address, bind directly. - */ - if (pr->pr_ip4s == 1) - ia->s_addr = pr->pr_ip4[0].s_addr; - mtx_unlock(&pr->pr_mtx); - return (0); - } - - error = _prison_check_ip4(pr, ia); - mtx_unlock(&pr->pr_mtx); - return (error); -} - -/* - * Rewrite destination address in case we will connect to loopback address. - * - * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv4. - * Address passed in in NBO and returned in NBO. - */ -int -prison_remote_ip4(struct ucred *cred, struct in_addr *ia) -{ - struct prison *pr; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP4)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP4)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip4 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - if (ntohl(ia->s_addr) == INADDR_LOOPBACK) { - ia->s_addr = pr->pr_ip4[0].s_addr; - mtx_unlock(&pr->pr_mtx); - return (0); - } - - /* - * Return success because nothing had to be changed. - */ - mtx_unlock(&pr->pr_mtx); - return (0); -} - -/* - * Check if given address belongs to the jail referenced by cred/prison. - * - * Returns 0 if jail doesn't restrict IPv4 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv4. Address passed in in NBO. - */ -static int -_prison_check_ip4(const struct prison *pr, const struct in_addr *ia) -{ - int i, a, z, d; - - /* - * Check the primary IP. - */ - if (pr->pr_ip4[0].s_addr == ia->s_addr) - return (0); - - /* - * All the other IPs are sorted so we can do a binary search. - */ - a = 0; - z = pr->pr_ip4s - 2; - while (a <= z) { - i = (a + z) / 2; - d = qcmp_v4(&pr->pr_ip4[i+1], ia); - if (d > 0) - z = i - 1; - else if (d < 0) - a = i + 1; - else - return (0); - } - - return (EADDRNOTAVAIL); -} - -int -prison_check_ip4(const struct ucred *cred, const struct in_addr *ia) -{ - struct prison *pr; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP4)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP4)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip4 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - error = _prison_check_ip4(pr, ia); - mtx_unlock(&pr->pr_mtx); - return (error); -} -#endif - -#ifdef INET6 -static int -prison_restrict_ip6(struct prison *pr, struct in6_addr *newip6) -{ - int ii, ij, used; - struct prison *ppr; - - ppr = pr->pr_parent; - if (!(pr->pr_flags & PR_IP6_USER)) { - /* This has no user settings, so just copy the parent's list. */ - if (pr->pr_ip6s < ppr->pr_ip6s) { - /* - * There's no room for the parent's list. Use the - * new list buffer, which is assumed to be big enough - * (if it was passed). If there's no buffer, try to - * allocate one. - */ - used = 1; - if (newip6 == NULL) { - newip6 = malloc(ppr->pr_ip6s * sizeof(*newip6), - M_PRISON, M_NOWAIT); - if (newip6 != NULL) - used = 0; - } - if (newip6 != NULL) { - bcopy(ppr->pr_ip6, newip6, - ppr->pr_ip6s * sizeof(*newip6)); - free(pr->pr_ip6, M_PRISON); - pr->pr_ip6 = newip6; - pr->pr_ip6s = ppr->pr_ip6s; - } - return (used); - } - pr->pr_ip6s = ppr->pr_ip6s; - if (pr->pr_ip6s > 0) - bcopy(ppr->pr_ip6, pr->pr_ip6, - pr->pr_ip6s * sizeof(*newip6)); - else if (pr->pr_ip6 != NULL) { - free(pr->pr_ip6, M_PRISON); - pr->pr_ip6 = NULL; - } - } else if (pr->pr_ip6s > 0) { - /* Remove addresses that aren't in the parent. */ - for (ij = 0; ij < ppr->pr_ip6s; ij++) - if (IN6_ARE_ADDR_EQUAL(&pr->pr_ip6[0], - &ppr->pr_ip6[ij])) - break; - if (ij < ppr->pr_ip6s) - ii = 1; - else { - bcopy(pr->pr_ip6 + 1, pr->pr_ip6, - --pr->pr_ip6s * sizeof(*pr->pr_ip6)); - ii = 0; - } - for (ij = 1; ii < pr->pr_ip6s; ) { - if (IN6_ARE_ADDR_EQUAL(&pr->pr_ip6[ii], - &ppr->pr_ip6[0])) { - ii++; - continue; - } - switch (ij >= ppr->pr_ip6s ? -1 : - qcmp_v6(&pr->pr_ip6[ii], &ppr->pr_ip6[ij])) { - case -1: - bcopy(pr->pr_ip6 + ii + 1, pr->pr_ip6 + ii, - (--pr->pr_ip6s - ii) * sizeof(*pr->pr_ip6)); - break; - case 0: - ii++; - ij++; - break; - case 1: - ij++; - break; - } - } - if (pr->pr_ip6s == 0) { - free(pr->pr_ip6, M_PRISON); - pr->pr_ip6 = NULL; - } - } - return 0; -} - -/* - * Pass back primary IPv6 address for this jail. - * - * If not restricted return success but do not alter the address. Caller has - * to make sure to initialize it correctly (e.g. IN6ADDR_ANY_INIT). - * - * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv6. - */ -int -prison_get_ip6(struct ucred *cred, struct in6_addr *ia6) -{ - struct prison *pr; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP6)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP6)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip6 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); - mtx_unlock(&pr->pr_mtx); - return (0); -} - -/* - * Return 1 if we should do proper source address selection or are not jailed. - * We will return 0 if we should bypass source address selection in favour - * of the primary jail IPv6 address. Only in this case *ia will be updated and - * returned in NBO. - * Return EAFNOSUPPORT, in case this jail does not allow IPv6. - */ -int -prison_saddrsel_ip6(struct ucred *cred, struct in6_addr *ia6) -{ - struct prison *pr; - struct in6_addr lia6; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); - - if (!jailed(cred)) - return (1); - - pr = cred->cr_prison; - if (pr->pr_flags & PR_IP6_SADDRSEL) - return (1); - - lia6 = in6addr_any; - error = prison_get_ip6(cred, &lia6); - if (error) - return (error); - if (IN6_IS_ADDR_UNSPECIFIED(&lia6)) - return (1); - - bcopy(&lia6, ia6, sizeof(struct in6_addr)); - return (0); -} - -/* - * Return true if pr1 and pr2 have the same IPv6 address restrictions. - */ -int -prison_equal_ip6(struct prison *pr1, struct prison *pr2) -{ - - if (pr1 == pr2) - return (1); - - while (pr1 != &prison0 && -#ifdef VIMAGE - !(pr1->pr_flags & PR_VNET) && -#endif - !(pr1->pr_flags & PR_IP6_USER)) - pr1 = pr1->pr_parent; - while (pr2 != &prison0 && -#ifdef VIMAGE - !(pr2->pr_flags & PR_VNET) && -#endif - !(pr2->pr_flags & PR_IP6_USER)) - pr2 = pr2->pr_parent; - return (pr1 == pr2); -} - -/* - * Make sure our (source) address is set to something meaningful to this jail. - * - * v6only should be set based on (inp->inp_flags & IN6P_IPV6_V6ONLY != 0) - * when needed while binding. - * - * Returns 0 if jail doesn't restrict IPv6 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv6. - */ -int -prison_local_ip6(struct ucred *cred, struct in6_addr *ia6, int v6only) -{ - struct prison *pr; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP6)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP6)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip6 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - if (IN6_IS_ADDR_LOOPBACK(ia6)) { - bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); - mtx_unlock(&pr->pr_mtx); - return (0); - } - - if (IN6_IS_ADDR_UNSPECIFIED(ia6)) { - /* - * In case there is only 1 IPv6 address, and v6only is true, - * then bind directly. - */ - if (v6only != 0 && pr->pr_ip6s == 1) - bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); - mtx_unlock(&pr->pr_mtx); - return (0); - } - - error = _prison_check_ip6(pr, ia6); - mtx_unlock(&pr->pr_mtx); - return (error); -} - -/* - * Rewrite destination address in case we will connect to loopback address. - * - * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv6. - */ -int -prison_remote_ip6(struct ucred *cred, struct in6_addr *ia6) -{ - struct prison *pr; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP6)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP6)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip6 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - if (IN6_IS_ADDR_LOOPBACK(ia6)) { - bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); - mtx_unlock(&pr->pr_mtx); - return (0); - } - - /* - * Return success because nothing had to be changed. - */ - mtx_unlock(&pr->pr_mtx); - return (0); -} - -/* - * Check if given address belongs to the jail referenced by cred/prison. - * - * Returns 0 if jail doesn't restrict IPv6 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv6. - */ -static int -_prison_check_ip6(struct prison *pr, struct in6_addr *ia6) -{ - int i, a, z, d; - - /* - * Check the primary IP. - */ - if (IN6_ARE_ADDR_EQUAL(&pr->pr_ip6[0], ia6)) - return (0); - - /* - * All the other IPs are sorted so we can do a binary search. - */ - a = 0; - z = pr->pr_ip6s - 2; - while (a <= z) { - i = (a + z) / 2; - d = qcmp_v6(&pr->pr_ip6[i+1], ia6); - if (d > 0) - z = i - 1; - else if (d < 0) - a = i + 1; - else - return (0); - } - - return (EADDRNOTAVAIL); -} - -int -prison_check_ip6(struct ucred *cred, struct in6_addr *ia6) -{ - struct prison *pr; - int error; - - KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); - KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); - - pr = cred->cr_prison; - if (!(pr->pr_flags & PR_IP6)) - return (0); - mtx_lock(&pr->pr_mtx); - if (!(pr->pr_flags & PR_IP6)) { - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (pr->pr_ip6 == NULL) { - mtx_unlock(&pr->pr_mtx); - return (EAFNOSUPPORT); - } - - error = _prison_check_ip6(pr, ia6); - mtx_unlock(&pr->pr_mtx); - return (error); -} -#endif - /* * Check if a jail supports the given address family. * Copied: stable/11/sys/netinet/in_jail.c (from r303863, head/sys/netinet/in_jail.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/netinet/in_jail.c Fri Apr 14 21:49:20 2017 (r316943, copy of r303863, head/sys/netinet/in_jail.c) @@ -0,0 +1,432 @@ +/*- + * Copyright (c) 1999 Poul-Henning Kamp. + * Copyright (c) 2008 Bjoern A. Zeeb. + * Copyright (c) 2009 James Gritton. + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" +#include "opt_ddb.h" +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +int +prison_qcmp_v4(const void *ip1, const void *ip2) +{ + in_addr_t iaa, iab; + + /* + * We need to compare in HBO here to get the list sorted as expected + * by the result of the code. Sorting NBO addresses gives you + * interesting results. If you do not understand, do not try. + */ + iaa = ntohl(((const struct in_addr *)ip1)->s_addr); + iab = ntohl(((const struct in_addr *)ip2)->s_addr); + + /* + * Do not simply return the difference of the two numbers, the int is + * not wide enough. + */ + if (iaa > iab) + return (1); + else if (iaa < iab) + return (-1); + else + return (0); +} + +/* + * Restrict a prison's IP address list with its parent's, possibly replacing + * it. Return true if the replacement buffer was used (or would have been). + */ +int +prison_restrict_ip4(struct prison *pr, struct in_addr *newip4) +{ + int ii, ij, used; + struct prison *ppr; + + ppr = pr->pr_parent; + if (!(pr->pr_flags & PR_IP4_USER)) { + /* This has no user settings, so just copy the parent's list. */ + if (pr->pr_ip4s < ppr->pr_ip4s) { + /* + * There's no room for the parent's list. Use the + * new list buffer, which is assumed to be big enough + * (if it was passed). If there's no buffer, try to + * allocate one. + */ + used = 1; + if (newip4 == NULL) { + newip4 = malloc(ppr->pr_ip4s * sizeof(*newip4), + M_PRISON, M_NOWAIT); + if (newip4 != NULL) + used = 0; + } + if (newip4 != NULL) { + bcopy(ppr->pr_ip4, newip4, + ppr->pr_ip4s * sizeof(*newip4)); + free(pr->pr_ip4, M_PRISON); + pr->pr_ip4 = newip4; + pr->pr_ip4s = ppr->pr_ip4s; + } + return (used); + } + pr->pr_ip4s = ppr->pr_ip4s; + if (pr->pr_ip4s > 0) + bcopy(ppr->pr_ip4, pr->pr_ip4, + pr->pr_ip4s * sizeof(*newip4)); + else if (pr->pr_ip4 != NULL) { + free(pr->pr_ip4, M_PRISON); + pr->pr_ip4 = NULL; + } + } else if (pr->pr_ip4s > 0) { + /* Remove addresses that aren't in the parent. */ + for (ij = 0; ij < ppr->pr_ip4s; ij++) + if (pr->pr_ip4[0].s_addr == ppr->pr_ip4[ij].s_addr) + break; + if (ij < ppr->pr_ip4s) + ii = 1; + else { + bcopy(pr->pr_ip4 + 1, pr->pr_ip4, + --pr->pr_ip4s * sizeof(*pr->pr_ip4)); + ii = 0; + } + for (ij = 1; ii < pr->pr_ip4s; ) { + if (pr->pr_ip4[ii].s_addr == ppr->pr_ip4[0].s_addr) { + ii++; + continue; + } + switch (ij >= ppr->pr_ip4s ? -1 : + prison_qcmp_v4(&pr->pr_ip4[ii], &ppr->pr_ip4[ij])) { + case -1: + bcopy(pr->pr_ip4 + ii + 1, pr->pr_ip4 + ii, + (--pr->pr_ip4s - ii) * sizeof(*pr->pr_ip4)); + break; + case 0: + ii++; + ij++; + break; + case 1: + ij++; + break; + } + } + if (pr->pr_ip4s == 0) { + free(pr->pr_ip4, M_PRISON); + pr->pr_ip4 = NULL; + } + } + return (0); +} + +/* + * Pass back primary IPv4 address of this jail. + * + * If not restricted return success but do not alter the address. Caller has + * to make sure to initialize it correctly (e.g. INADDR_ANY). *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 14 21:53:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36D7AD3C8C7; Fri, 14 Apr 2017 21:53:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB46CA6C; Fri, 14 Apr 2017 21:53:00 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id c198so16676760pfc.0; Fri, 14 Apr 2017 14:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=DouJjrZtawbv5aB7UicdReH5kJHRfbk0BzTXHYzGiOU=; b=I1NX1HCeyBgBTVmDs/fx/cw7KLnfNHxKTk8nmzEee28g2D1IW6Mi37Q86MsO8TwMKM j44LKstXTn3S4GG5dsVohtNOl7odJ/z9YOZ3D1+XjP+VL6w+eieNrGGSI4YWQhrIE6j5 0FGvjS9BLiw46WJ9/mBB8UMxWbpr+0Lbqr0z2e6txz0pbL2AH+d2jqwy3UJS0u4CsZGS Ouko6Z4+5ejFxEQK2G8J1TA9YUb80HUmyxyVMlsRrrWTEtrYa5cA8nQLdpOeOiBOe8u/ B8HfBV4cLMKFS6Qmk1jNi5B3TONCv2TbpMezrVp6gJMaw+H9+kym/ck4dj/gvs5YpG0X klUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=DouJjrZtawbv5aB7UicdReH5kJHRfbk0BzTXHYzGiOU=; b=niHfm/ODD03oHUlMmAl+gxWr6Ysmnn2iZcu1IEFtPmcg34xjXIg0q8qQoJeCbPE8xN f/u0s5m/wZYJD1MjWavp4jBdZMmapD59OR4pY3v87Jrg1g6NBfxCvsKt2bDrzfrjbgX/ dwcoiQkfJg7OhLJLTaHa0uHDCsokVcd9/Kv8hBcql9x9QbU1oBoaSXogexRuCjEsfPD7 BWKL06sRNd5abzqr/ZXgj4Fou5rEAV9p05UXIsvrBrgfuUcJloUQxRh2T5k1xDTb9kk7 WzP3HDViXk+y3fDv4n6V5lt1blfdCGxwiBWtMxcWcXmC6VMAhMpH1U3s/uw4ypcPVPRo f1Ig== X-Gm-Message-State: AN3rC/4narnkNHo+FJxiKLG5Pg7bd0kR6BnmV3VBmPsXCOWWBarK9glr cdKfA05YttwhXOpHrcI= X-Received: by 10.98.130.10 with SMTP id w10mr8784118pfd.12.1492206780327; Fri, 14 Apr 2017 14:53:00 -0700 (PDT) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q70sm4897380pgq.45.2017.04.14.14.52.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 14:52:58 -0700 (PDT) From: "Ngie Cooper (yaneurabeya)" Message-Id: <6B556967-35B0-4F4F-9F1E-C088F8D48C80@gmail.com> Content-Type: multipart/signed; boundary="Apple-Mail=_D8477057-EBD8-4E0F-93BC-4449869DD05B"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r316938 - head/sbin/savecore Date: Fri, 14 Apr 2017 14:52:56 -0700 In-Reply-To: <1940104.87G28XVdqf@ralph.baldwin.cx> Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: John Baldwin References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <1940104.87G28XVdqf@ralph.baldwin.cx> X-Mailer: Apple Mail (2.3273) X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 21:53:01 -0000 --Apple-Mail=_D8477057-EBD8-4E0F-93BC-4449869DD05B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Apr 14, 2017, at 2:40 PM, John Baldwin wrote: >=20 > On Friday, April 14, 2017 07:41:48 PM Ngie Cooper wrote: >> Author: ngie >> Date: Fri Apr 14 19:41:48 2017 >> New Revision: 316938 >> URL: https://svnweb.freebsd.org/changeset/base/316938 >>=20 >> Log: >> savecore: fix space calculation with respect to `minfree` in = check_space(..) >>=20 >> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >> representable data to INT_MAX. Check the values received from >> strtoll(3), trimming trailing whitespace off the end to maintain >> POLA. >> - Use `KiB` instead of `kB` when describing free space, total space, >> etc. I am now fully aware of `KiB` being the IEC standard for 1024 >> bytes and `kB` being the IEC standard for 1000 bytes. >=20 > I will just rant lightly that no one actually uses this in the real = world. >=20 > Good lucking finding a "16 GiB" DIMM on crucial.com = or a 4Kin drive. A > kilobyte is a power of 2. The End. >=20 > (Next up we'll have to rename 4k displays to > 4k) https://media0.giphy.com/media/7rj2ZgttvgomY/giphy.gif = :P. -Ngie --Apple-Mail=_D8477057-EBD8-4E0F-93BC-4449869DD05B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJY8US5AAoJEPWDqSZpMIYVCfUP/3wA5+5dTcBrRjYxgWZQ2o1X RRumpB5eNc12qs5dz64H3gpPdFYfaAqop0EGXWX/wJxS/8SpJVV5PEOMy2pBH7ag 8L33dfRJAh7UxeC1MM8ms0q7TsP7cIRXcYr+cAjL+n/R+1u5n8AkIiTJKX64bdBl HSo6CLpRT8UrkHTPXPSGYx014D3hU/YOY1TwuzOm70I1x4uqQl1oxv3hSCSeOlWW OBAaxuIRO8O2+6GYf/cPQZsfX2GDdlLWls/9nv47CRC7JD/AcksYaCVm2X8WA4nj czN1Dwtm60aPjFAltfChgi8m+yedJD36BvfT0WAm1eL1ZW7qYN6ATjS1HaWpuUnk Tcg1O/TMB8StpdamzI5TCXgANS2Xw45/IB9NAEHGrqohztxX6CHfudIrPpHWCOil 3gDt54YlNlPSeAFDu+6dA+/W3CqtIo75DufPVFutVAhmZFIOaS7IFswTqIWzM/d4 KXKle7ViKyT+KnGHuolHMpmA0+acf9HVFN0zQLNYVnCXwk9vWE5knKNymg7YkfJZ 5yJndqZQg+02RcH8rJoJjQ2DhflItAJQvfPI4c1QueOPHHMCCLrb9UkHkRSos8Np B8lgFHoXAxzybVAjweqr1R3nNIiJPH78niD9ZLhftDQHOI/izNvekT0Gb6ytFeYE iIslnKaBhFyHx6wog75J =eVXV -----END PGP SIGNATURE----- --Apple-Mail=_D8477057-EBD8-4E0F-93BC-4449869DD05B-- From owner-svn-src-all@freebsd.org Fri Apr 14 22:00:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FFD2D3C9CD; Fri, 14 Apr 2017 22:00:40 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 102F8C39; Fri, 14 Apr 2017 22:00:39 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id F3525400; Fri, 14 Apr 2017 15:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1492207239; bh=fXgRQ2q2E5wm0YvlJSJyZHDaHkg1bU4iLzzfqNnJBl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uuTDIqRdb5Zg+UYhdfGvz/CrR8Ttap/G8SWnmL9zDEC9qRKBYGDNO+rA03At4ddRx eCmoVUY9MvG0jeRPqFybOGmelj139MMZEMjtJebvW1cwjmz6kSpvrmTNL2kXjGHmNM 0/EMnHjLlwNi2XZ1WQnG1liR8vIm7l9uIaKI8ciU= From: Peter Wemm To: Maxim Sobolev Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Hiren Panchasara Subject: Re: svn commit: r316874 - head/sys/kern Date: Fri, 14 Apr 2017 15:00:34 -0700 Message-ID: <57394216.x4KIjm5Ndu@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <6942092.OsECkgAp13@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1570723.Szc7POMjpa"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 22:00:40 -0000 --nextPart1570723.Szc7POMjpa Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday, April 14, 2017 02:21:05 PM Maxim Sobolev wrote: > Peter, It is actually the other way around. If you take syslogd code = out of > 11-stable and earlier that would work just fine with or without r3168= 74. > But since r285910 syslogd in head had been refactored a lot and I thi= nk > that particular bug has introduced that has been masked by the shutdo= wn() > on datagram sockets becoming a NOP after r285910. Then r316874 restor= ed our > historical behavior for the shutdown(2) and bingo, bug in the new sys= logd > code is now causing it to spin when shutdown() !=3D NOP. Ok, this makes sense. Just to be sure I'm on the same page, I should apply the syslogd.diff f= rom a=20 few messages ago and restore the shutdown(2) kernel code and give it a = spin. =20 Correct? =2DPeter > -Max >=20 > On Fri, Apr 14, 2017 at 12:46 PM, Peter Wemm wrote: > > On Friday, April 14, 2017 12:41:52 PM Maxim Sobolev wrote: > > > Thanks, Peter. I will try to look into this asap. > >=20 > > I don't understand what is going on yet. Presumably there must be o= ther > > changes in play that affect udp/select sometime between the origina= l 2015 > > change and this. The syslogd -s code is Old(TM). I'm also wonderin= g > > whether > > the -s code even works at all since the 2015 / r285910 change... > >=20 > > > -Max > > >=20 > > > On Apr 14, 2017 12:32 PM, "Peter Wemm" wrote: > > > > On Friday, April 14, 2017 11:49:26 AM Peter Wemm wrote: > > > > > On Friday, April 14, 2017 05:23:28 PM Maxim Sobolev wrote: > > > > > > Author: sobomax > > > > > > Date: Fri Apr 14 17:23:28 2017 > > > > > > New Revision: 316874 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/316874 > > > > > >=20 > > > > > > Log: > > > > > > Restore ability to shutdown DGRAM sockets, still forcing > >=20 > > ENOTCONN to > >=20 > > > > be > > > >=20 > > > > > > returned by the shutdown(2) system call. This ability has b= een > >=20 > > lost as > >=20 > > > > > > part > > > > > > of the svn revision 285910. > > > > > >=20 > > > > > > Reviewed by: ed, rwatson, glebius, hiren > > > > > > MFC after: 2 weeks > > > > > > Differential Revision: https://reviews.freebsd.org/D10= 351 > > > > >=20 > > > > > This appears to have broken syslogd and had a major change in= > >=20 > > behavior > >=20 > > > > with > > > >=20 > > > > > regards to select(2). > > > > >=20 > > > > > If you run syslogd with the -s flag (which is default), it no= w spins > >=20 > > at > >=20 > > > > 100% > > > >=20 > > > > > cpu as all the shutdown sockets now return readable from sele= ct. > > > > >=20 > > > > > Old releases / jails also manifest this behavor. If it wasn'= t for > > > > > losing > > > > > the ability to run old branch binaries I'd suggest changing s= yslogd > > > > > instead, but we depend on this in the cluster and I expect ot= hers do > > > > > too. > > > > >=20 > > > > > I'm not 100% certain that this change is the culprit but a he= ads-up > > > > > can't > > > > > hurt. I'll try reverting it on the freebsd cluster next, afte= r > > > > > fixing > > > > > the > > > > > broken auditing changes. > > > > >=20 > > > > > -Peter > > > >=20 > > > > I can confirm that reverting r316874 fixes syslogd and backward= s > > > > compatability > > > > with old branches. > > > >=20 > > > > -- > > > > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc= .com; > > > > KI6FJV > > > > UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246= > >=20 > > -- > > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com= ; > > KI6FJV > > UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart1570723.Szc7POMjpa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAljxRoIACgkQNdaXCeyA ngREUQf8DY28PmkYhSKmWCSz4JA1TNcgiLCFr6ybdF9FSzjHQqXph7OOFa/Galwo G14G9x1QinloDPC8bERnnOwmkJoOAr6dH4SSMsmGva00o6N8L2QJ/cUHZsntS0a9 gOnz77N3VDoRcg9x29N9LwteovKNraXRddefG+fZopkfepiBs0Xy9NHamsdodlag fN/2lThxfYNjqs+A9KWnkhOgdHal7nnwC1zhwG05I7S/0vnJRnH9j6BG+DJvo9Yh MSpyZ5fb0h62Qw61eoUtGVsr5Wz6ln1/XO+6xkCUjZwSnoTZribUaXoEH9aLArRE Uz94Fy5Uy19VNcLIffN5Kb2ERKpuLA== =wok4 -----END PGP SIGNATURE----- --nextPart1570723.Szc7POMjpa-- From owner-svn-src-all@freebsd.org Fri Apr 14 22:02:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 440BAD3CBDD; Fri, 14 Apr 2017 22:02:10 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05290FC9; Fri, 14 Apr 2017 22:02:09 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EM296f059632; Fri, 14 Apr 2017 22:02:09 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EM28wG059629; Fri, 14 Apr 2017 22:02:08 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201704142202.v3EM28wG059629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 14 Apr 2017 22:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316944 - in stable/11: . sys/netinet sys/netinet6 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 22:02:10 -0000 Author: smh Date: Fri Apr 14 22:02:08 2017 New Revision: 316944 URL: https://svnweb.freebsd.org/changeset/base/316944 Log: MFC r316313, r316328: Allow explicitly assigned IPv4 & IPv6 loopback addresses to be used in jails. Relnotes: Yes Sponsored by: Multiplay Modified: stable/11/UPDATING stable/11/sys/netinet/in_jail.c stable/11/sys/netinet6/in6_jail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Fri Apr 14 21:49:20 2017 (r316943) +++ stable/11/UPDATING Fri Apr 14 22:02:08 2017 (r316944) @@ -16,6 +16,11 @@ from older versions of FreeBSD, try WITH the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20170414: + Binds and sends to the loopback addresses, IPv6 and IPv4, will now + use any explicitly assigned loopback address available in the jail + instead of using the first assigned address of the jail. + 20170402: Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 4.0.0. Please see the 20141231 entry below for information about prerequisites Modified: stable/11/sys/netinet/in_jail.c ============================================================================== --- stable/11/sys/netinet/in_jail.c Fri Apr 14 21:49:20 2017 (r316943) +++ stable/11/sys/netinet/in_jail.c Fri Apr 14 22:02:08 2017 (r316944) @@ -306,11 +306,6 @@ prison_local_ip4(struct ucred *cred, str } ia0.s_addr = ntohl(ia->s_addr); - if (ia0.s_addr == INADDR_LOOPBACK) { - ia->s_addr = pr->pr_ip4[0].s_addr; - mtx_unlock(&pr->pr_mtx); - return (0); - } if (ia0.s_addr == INADDR_ANY) { /* @@ -323,6 +318,11 @@ prison_local_ip4(struct ucred *cred, str } error = prison_check_ip4_locked(pr, ia); + if (error == EADDRNOTAVAIL && ia0.s_addr == INADDR_LOOPBACK) { + ia->s_addr = pr->pr_ip4[0].s_addr; + error = 0; + } + mtx_unlock(&pr->pr_mtx); return (error); } @@ -354,7 +354,8 @@ prison_remote_ip4(struct ucred *cred, st return (EAFNOSUPPORT); } - if (ntohl(ia->s_addr) == INADDR_LOOPBACK) { + if (ntohl(ia->s_addr) == INADDR_LOOPBACK && + prison_check_ip4_locked(pr, ia) == EADDRNOTAVAIL) { ia->s_addr = pr->pr_ip4[0].s_addr; mtx_unlock(&pr->pr_mtx); return (0); @@ -370,9 +371,8 @@ prison_remote_ip4(struct ucred *cred, st /* * Check if given address belongs to the jail referenced by cred/prison. * - * Returns 0 if jail doesn't restrict IPv4 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv4. Address passed in in NBO. + * Returns 0 if address belongs to jail, + * EADDRNOTAVAIL if the address doesn't belong to the jail. */ int prison_check_ip4_locked(const struct prison *pr, const struct in_addr *ia) Modified: stable/11/sys/netinet6/in6_jail.c ============================================================================== --- stable/11/sys/netinet6/in6_jail.c Fri Apr 14 21:49:20 2017 (r316943) +++ stable/11/sys/netinet6/in6_jail.c Fri Apr 14 22:02:08 2017 (r316944) @@ -293,12 +293,6 @@ prison_local_ip6(struct ucred *cred, str return (EAFNOSUPPORT); } - if (IN6_IS_ADDR_LOOPBACK(ia6)) { - bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (IN6_IS_ADDR_UNSPECIFIED(ia6)) { /* * In case there is only 1 IPv6 address, and v6only is true, @@ -311,6 +305,11 @@ prison_local_ip6(struct ucred *cred, str } error = prison_check_ip6_locked(pr, ia6); + if (error == EADDRNOTAVAIL && IN6_IS_ADDR_LOOPBACK(ia6)) { + bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); + error = 0; + } + mtx_unlock(&pr->pr_mtx); return (error); } @@ -341,7 +340,8 @@ prison_remote_ip6(struct ucred *cred, st return (EAFNOSUPPORT); } - if (IN6_IS_ADDR_LOOPBACK(ia6)) { + if (IN6_IS_ADDR_LOOPBACK(ia6) && + prison_check_ip6_locked(pr, ia6) == EADDRNOTAVAIL) { bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); mtx_unlock(&pr->pr_mtx); return (0); @@ -357,9 +357,8 @@ prison_remote_ip6(struct ucred *cred, st /* * Check if given address belongs to the jail referenced by cred/prison. * - * Returns 0 if jail doesn't restrict IPv6 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv6. + * Returns 0 if address belongs to jail, + * EADDRNOTAVAIL if the address doesn't belong to the jail. */ int prison_check_ip6_locked(const struct prison *pr, const struct in6_addr *ia6) From owner-svn-src-all@freebsd.org Fri Apr 14 22:05:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABB50D3CD77; Fri, 14 Apr 2017 22:05:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x235.google.com (mail-qt0-x235.google.com [IPv6:2607:f8b0:400d:c0d::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 627172C1; Fri, 14 Apr 2017 22:05:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x235.google.com with SMTP id c45so71856139qtb.1; Fri, 14 Apr 2017 15:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7gopmosH31OJwG+IolzNb79ufMc3IE6ZJvahzevUjHM=; b=Fy3+1q22QWwTSPhR1Egbd9JXHFQYcRvMZlL0VQCHPgmxS40yO/PBjb7Na2h4D3jCbY iA2/F24pbWu735ZOuZFGNW5QpNbgoPKAgYdF8Gx3YEvzZMuqxoD2NZivJBOYSFD3KZu6 hu6W0ZA4/zLd2Q1+yqJgYVVZbxn0HW6iK8/25A33I4zKQVJnxsFga3S4yOig4CJVv6PF lxH7OM3Fq8eAaXOZlo1ww4HSwFLt3Oz22YXrsYhfBFXnoAAjnOeNEe08F/+YMGBiourG ex6uOfn4c0UilhHSKCzJXtrHp4jyEEWgEbKPa3LB7Ni2apmcMEnojAyJdYWsPHdaneRa tMRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=7gopmosH31OJwG+IolzNb79ufMc3IE6ZJvahzevUjHM=; b=o5jQ39wIdNNfAXEdQlwDlX8Gy7XyVgPA+wm45MjPTKC0Hh2+YeTEgfisurKeB2GUB7 y4z7v6MbV0Vt8PQjPqibPCHKNussVTUCnjDx5PtuizKvSsDQbY4QhmFpAuCcDRpb9nRH vbKAbQfjTUSuubh4sEf+CmADdpjbaoxdYDmKREJGd+1ojVwniVPKPn8p3Rx2peKbT2XZ DSoCbO+96XpjNg7cX8O1g960zSCj7On/RfdE/CaMnczIGf50iVDkEvG4dlIJHrkEzd7m 0zjoCK9pB/9l9SytDghFvhObx6ziOie7E+7bfhimrhfLhhcG8nDMMJmdVXaGWHSxqOkE yqQg== X-Gm-Message-State: AN3rC/5laKizfZF37qatmzh/5azp4aQZDAhg02jkSAZRdbjLHTwUc3I6 ziXUHUZawm2Bgg== X-Received: by 10.237.36.212 with SMTP id u20mr9823403qtc.217.1492207546548; Fri, 14 Apr 2017 15:05:46 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id t22sm2023063qke.49.2017.04.14.15.05.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 15:05:45 -0700 (PDT) Sender: Mark Johnston Date: Fri, 14 Apr 2017 15:05:25 -0700 From: Mark Johnston To: Xin LI Cc: Alan Somers , Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170414220525.GF5039@wkstn-mjohnston.west.isilon.com> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 22:05:47 -0000 On Fri, Apr 14, 2017 at 02:28:57PM -0700, Xin LI wrote: > On Fri, Apr 14, 2017 at 1:29 PM, Mark Johnston wrote: > > - I'm not sure how encryption should compose with compression. It seems > > intuitively obvious that we should compress before encrypting if the > > compression is to be of any use, but I don't know enough to know > > whether the compression might somehow compromise the effectiveness of > > the encryption. > > I think the biggest concern is the added code involved in the dump > process (which happen when the kernel is already unhealthy), which can > jeopardize it and defeat the usefulness of having a crash dump being > set up in the first place. I agree in principle but this doesn't appear to cause problems in practice. zlib allocates memory only at initialization time, so its requirements in panic context are quite minimal. I wrote a little bit of zlib glue, used currently for compressed userland core dumps, which works properly in panic context as well. > And with textdumps available, the benefit > of having compression is limited because we can request for minidump > or full dumps only when the textdumps are not good enough for > diagnosing the kernel bug. Sure, but in this case the compression may be vital. > > I don't think security (e.g. leaking information because of the use of > compression) is a very big concern in this context because in order > for the potential attacker to read the raw material needs a > compromised system (unlike an attack from the network, where someone > who controls the network would have access to the raw material); the > dump is usually quite large, and measuring downtime would be hard at > that scale. Ok. > > By the way (not meant to bikeshed) if I was to do this I'd prefer > using lz4 or something that compresses faster than zlib. I agree, but I think the existing lz4 implementation in the kernel is not so well suited to running after a panic. It seems fixable, but compression speed also isn't hugely important here IMO. From owner-svn-src-all@freebsd.org Fri Apr 14 22:59:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5975AD3DBC8; Fri, 14 Apr 2017 22:59:16 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E265E05; Fri, 14 Apr 2017 22:59:16 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EMxFCq083237; Fri, 14 Apr 2017 22:59:15 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EMxEAa083233; Fri, 14 Apr 2017 22:59:14 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704142259.v3EMxEAa083233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 14 Apr 2017 22:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316945 - in head: etc/defaults etc/periodic/daily share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 22:59:16 -0000 Author: asomers Date: Fri Apr 14 22:59:14 2017 New Revision: 316945 URL: https://svnweb.freebsd.org/changeset/base/316945 Log: Add 410.status-mfi, a periodic script for mfi(4) arrays PR: 176049 Submitted by: doconnor@gsoft.com.au Reviewed by: scottl, Larry Rosenman MFC after: 3 weeks Relnotes: yes Added: head/etc/periodic/daily/410.status-mfi (contents, props changed) Modified: head/etc/defaults/periodic.conf head/etc/periodic/daily/Makefile head/share/man/man5/periodic.conf.5 Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Fri Apr 14 22:02:08 2017 (r316944) +++ head/etc/defaults/periodic.conf Fri Apr 14 22:59:14 2017 (r316945) @@ -112,6 +112,9 @@ daily_status_gstripe_enable="NO" # Che # 409.status-gconcat daily_status_gconcat_enable="NO" # Check gconcat(8) +# 410.status-mfi +daily_status_mfi_enable="NO" # Check mfiutil(8) + # 420.status-network daily_status_network_enable="YES" # Check network status daily_status_network_usedns="YES" # DNS lookups are ok Added: head/etc/periodic/daily/410.status-mfi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/periodic/daily/410.status-mfi Fri Apr 14 22:59:14 2017 (r316945) @@ -0,0 +1,33 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +case "$daily_status_mfi_enable" in + [Yy][Ee][Ss]) + echo + echo 'Checking status of mfi(4) devices:' + + if mfiutil show volumes; then + if mfiutil show volumes | grep -q DEGRADED; then + rc=3 + else + rc=0 + fi + else + rc=2 + fi + ;; + + *) rc=0;; +esac + +exit $rc Modified: head/etc/periodic/daily/Makefile ============================================================================== --- head/etc/periodic/daily/Makefile Fri Apr 14 22:02:08 2017 (r316944) +++ head/etc/periodic/daily/Makefile Fri Apr 14 22:59:14 2017 (r316945) @@ -13,6 +13,7 @@ FILES= 100.clean-disks \ 400.status-disks \ 401.status-graid \ 406.status-gmirror \ + 410.status-mfi \ 407.status-graid3 \ 408.status-gstripe \ 409.status-gconcat \ Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Fri Apr 14 22:02:08 2017 (r316944) +++ head/share/man/man5/periodic.conf.5 Fri Apr 14 22:59:14 2017 (r316945) @@ -399,6 +399,15 @@ if you want to run on your .Xr gconcat 8 devices. +.It Va daily_status_mfi_enable +.Pq Vt bool +Set to +.Dq Li YES +if you want to run +.Nm mfiutil Cm status +on your +.Xr mfi 4 +devices. .It Va daily_status_network_enable .Pq Vt bool Set to From owner-svn-src-all@freebsd.org Fri Apr 14 23:08:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC8C7D3E0EF; Fri, 14 Apr 2017 23:08:51 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D638A3E; Fri, 14 Apr 2017 23:08:51 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1czAKe-0001nR-51; Sat, 15 Apr 2017 01:08:48 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Stanislav Galabov" Subject: Re: svn commit: r313343 - head/sys/arm/arm References: <201702061458.v16EwOjU015633@repo.freebsd.org> Date: Sat, 15 Apr 2017 01:08:47 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201702061458.v16EwOjU015633@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: 3ced5df4177ef3a93a84b902ce7c160e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 23:08:51 -0000 With this change merged to 11-CURRENT my SHEEVAPLUG/arm displays different information in dmesg: messages:Apr 15 00:53:07 sheeva2 kernel: Little-endian DC enabled IC enabled WA disabled DC streaming enabled messages:Apr 15 00:53:07 sheeva2 kernel: WB enabled LABT branch prediction enabled messages.0.bz2:Apr 11 20:02:06 sheeva2 kernel: Little-endian DC enabled IC disabled WA disabled DC streaming enabled messages.0.bz2:Apr 11 20:02:06 sheeva2 kernel: WB enabled LABT branch prediction disabled IC changed from disabled to enabled and LABT branch prediction is displayed as enabled also. Is this only cosmetically? Or does it really change behaviour? Anybody willing to MFC this 11? Regards, Ronald. On Mon, 06 Feb 2017 15:58:24 +0100, Stanislav Galabov wrote: > Author: sgalabov > Date: Mon Feb 6 14:58:24 2017 > New Revision: 313343 > URL: https://svnweb.freebsd.org/changeset/base/313343 > > Log: > sys/arm/arm/identcpu-v4.c: fix identify_arm_cpu() > identify_arm_cpu() in sys/arm/arm/identcpu-v4.c incorrectly uses a > u_int8_t variable to store the result of cpu_get_control(). > It should really use a u_int variable, the same way as done for > cpu_ident() > in the same function, as both cpuid and control registers are 32-bit.. > This issue causes users of identcpu-v4 to incorrectly report things > such as > icache status (bit 12 in cpu control register) and basically anything > defined in bits above bit 7 :-) > Reviewed by: manu > Sponsored by: Smartcom - Bulgaria AD > Differential Revision: https://reviews.freebsd.org/D9460 > > Modified: > head/sys/arm/arm/identcpu-v4.c > > Modified: head/sys/arm/arm/identcpu-v4.c > ============================================================================== > --- head/sys/arm/arm/identcpu-v4.c Mon Feb 6 14:41:34 2017 (r313342) > +++ head/sys/arm/arm/identcpu-v4.c Mon Feb 6 14:58:24 2017 (r313343) > @@ -294,8 +294,7 @@ u_int cpu_pfr(int num) > void > identify_arm_cpu(void) > { > - u_int cpuid; > - u_int8_t ctrl; > + u_int cpuid, ctrl; > int i; > ctrl = cpu_get_control(); > _______________________________________________ > 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-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Fri Apr 14 23:11:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02D5FD3E293 for ; Fri, 14 Apr 2017 23:11:43 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-ua0-x22d.google.com (mail-ua0-x22d.google.com [IPv6:2607:f8b0:400c:c08::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEAE9C9E for ; Fri, 14 Apr 2017 23:11:42 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-ua0-x22d.google.com with SMTP id a1so52427164uaf.3 for ; Fri, 14 Apr 2017 16:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jWMSvyKxdaiuuUhvRIKfCzvv1JA9vhTsPTvetYEXbk0=; b=fRIssKpkcWHgsmVWV+yYAmi6sJgU3XtzImajapeqa+9XWL1G2V+QTAKLS7QOzb9v8/ gg/TMXc/tyQQi6j59nqjgznuBNfzt3GbRnIMKs7mt4F/bajjQz9QvXgsOBtE9eUEzCuf KCU48h+hYYMKoA5+JejBzyI6cbaX6+CbR3Ur/hlut67A758EK51jjJ/z2M5HtlcHEPh6 OCu6eFwCJ10ACbhmv7pTTQUSECHb/lRVf/jrTe4nVmKcrcyD2iDlcuuMtZlpjp+5KeTy mJaN+trHiZAsBc0Y30If5FQfau1oZ107xyveb142wFA/Ta23WHj91DqR7noJ/i4A845u YWig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jWMSvyKxdaiuuUhvRIKfCzvv1JA9vhTsPTvetYEXbk0=; b=oXe8CvE9df4zWTTfsancceHG2NDiYnHVgP+GKoriauKZGShi/UBrDx3R43T07LDOeO zuhqAeHuhSUZcfUr2xRoK+aqrY7fyKnJy5/CE1MSt1iN99v/gpuXX76dlNyFvC6OarHT tFNKkKtQR0+uY+SyLKAX61Noxe3kAp/oDlMPT8a5jXJL4rFAG05LK6GYIcZLTK4GGQFF d3dVKWZAexDStGZz5pieC2ftpFClkG3SCqBCBwu91AnypAg8U+dMsxVY+CmvOZmAb2dx b2nczHVu+V/QD0GvQMqmTs+o76JO0chigzrOlZuNgV8CB0kmML7ky13/WQKJEVtkK+A4 Nj8Q== X-Gm-Message-State: AN3rC/6rl0ep/71EgJMGe52sfe3tztZVKJk1rjJWPwRWO6I05vSHaD0N +ZwASGBU5wUaFwZZhc+x3FAaHtrz0qxM X-Received: by 10.176.91.8 with SMTP id u8mr5037084uae.150.1492211501769; Fri, 14 Apr 2017 16:11:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.0.79 with HTTP; Fri, 14 Apr 2017 16:11:41 -0700 (PDT) In-Reply-To: <201704142259.v3EMxEAa083233@repo.freebsd.org> References: <201704142259.v3EMxEAa083233@repo.freebsd.org> From: Oliver Pinter Date: Sat, 15 Apr 2017 01:11:41 +0200 Message-ID: Subject: Re: svn commit: r316945 - in head: etc/defaults etc/periodic/daily share/man/man5 To: Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 23:11:43 -0000 On Saturday, April 15, 2017, Alan Somers wrote: > Author: asomers > Date: Fri Apr 14 22:59:14 2017 > New Revision: 316945 > URL: https://svnweb.freebsd.org/changeset/base/316945 > > Log: > Add 410.status-mfi, a periodic script for mfi(4) arrays > > PR: 176049 > Submitted by: doconnor@gsoft.com.au > Reviewed by: scottl, Larry Rosenman > > MFC after: 3 weeks > Relnotes: yes > > Added: > head/etc/periodic/daily/410.status-mfi (contents, props changed) > Modified: > head/etc/defaults/periodic.conf > head/etc/periodic/daily/Makefile > head/share/man/man5/periodic.conf.5 > > Modified: head/etc/defaults/periodic.conf > ============================================================ > ================== > --- head/etc/defaults/periodic.conf Fri Apr 14 22:02:08 2017 > (r316944) > +++ head/etc/defaults/periodic.conf Fri Apr 14 22:59:14 2017 > (r316945) > @@ -112,6 +112,9 @@ daily_status_gstripe_enable="NO" # > Che > # 409.status-gconcat > daily_status_gconcat_enable="NO" # Check gconcat(8) > > +# 410.status-mfi > +daily_status_mfi_enable="NO" # Check mfiutil(8) > + > # 420.status-network > daily_status_network_enable="YES" # Check network > status > daily_status_network_usedns="YES" # DNS lookups are > ok > > Added: head/etc/periodic/daily/410.status-mfi > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/periodic/daily/410.status-mfi Fri Apr 14 22:59:14 2017 > (r316945) > @@ -0,0 +1,33 @@ > +#!/bin/sh > +# > +# $FreeBSD$ > +# > + > +# If there is a global system configuration file, suck it in. > +# > +if [ -r /etc/defaults/periodic.conf ] > +then > + . /etc/defaults/periodic.conf > + source_periodic_confs > +fi > + > +case "$daily_status_mfi_enable" in > + [Yy][Ee][Ss]) > + echo > + echo 'Checking status of mfi(4) devices:' > + > + if mfiutil show volumes; then > + if mfiutil show volumes | grep -q DEGRADED; then > + rc=3 > + else > + rc=0 > + fi > + else > + rc=2 > + fi > + ;; > + > + *) rc=0;; > +esac > + > +exit $rc > > Modified: head/etc/periodic/daily/Makefile > ============================================================ > ================== > --- head/etc/periodic/daily/Makefile Fri Apr 14 22:02:08 2017 > (r316944) > +++ head/etc/periodic/daily/Makefile Fri Apr 14 22:59:14 2017 > (r316945) > @@ -13,6 +13,7 @@ FILES= 100.clean-disks \ > 400.status-disks \ > 401.status-graid \ > 406.status-gmirror \ > + 410.status-mfi \ This should be in different place, this list is ordered, as I see from this context. > 407.status-graid3 \ > 408.status-gstripe \ > 409.status-gconcat \ > > Modified: head/share/man/man5/periodic.conf.5 > ============================================================ > ================== > --- head/share/man/man5/periodic.conf.5 Fri Apr 14 22:02:08 2017 > (r316944) > +++ head/share/man/man5/periodic.conf.5 Fri Apr 14 22:59:14 2017 > (r316945) > @@ -399,6 +399,15 @@ if you want to run > on your > .Xr gconcat 8 > devices. > +.It Va daily_status_mfi_enable > +.Pq Vt bool > +Set to > +.Dq Li YES > +if you want to run > +.Nm mfiutil Cm status > +on your > +.Xr mfi 4 > +devices. > .It Va daily_status_network_enable > .Pq Vt bool > Set to > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org > " > From owner-svn-src-all@freebsd.org Fri Apr 14 23:29:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 934CBD3E563; Fri, 14 Apr 2017 23:29:29 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76A2066B; Fri, 14 Apr 2017 23:29:28 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 1B4E344A; Fri, 14 Apr 2017 16:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1492212568; bh=cMcMeJoAYRoCXlg7oUSdKI58oKccAOyLqdzRHi3f+Uw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=p4+fnF8e9p/ARQRzq7V01xxzIaKjlGcjYfJQ1PZLgejrCNlegGAr0k+D/xwM1ggJW WR8tlDksw0pClcG9JJgZTZAXPvDrqI55QOCgOKHCX56m/+XucTq0MjpHegDJtpiApl oWFdhxlf8BHq0qu/wacp8w5LTvWM5W6EDXj3NYew= From: Peter Wemm To: Maxim Sobolev Cc: "Ngie Cooper (yaneurabeya)" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Hiren Panchasara Subject: Re: svn commit: r316874 - head/sys/kern Date: Fri, 14 Apr 2017 16:29:23 -0700 Message-ID: <3928506.Yjk9xjcQnh@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <513B1846-02E3-49E0-BAA2-CA923EDC5DFF@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart9883833.pL1s3BkVMp"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 23:29:29 -0000 --nextPart9883833.pL1s3BkVMp Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Friday, April 14, 2017 02:10:56 PM Maxim Sobolev wrote: > Peter, Ngie, >=20 > Looks like out of that refactoring came a logical bug that is present= in > the head, which causes syslod to first to shutdown the socket for rea= ding > and then try to select/recv on it (which is somewhat stupid). And tha= t > issue has been masked by shutdown() on datagram socket becoming effec= tively > a NOP in 11 & head 20 months ago. It only affects head though, 11-sta= ble > still has the old code which does not include that half-closed socket= into > the select list. Attached patch is expected to fix head, Peter, it wo= uld be > nice if you can give it a try (restoring latest changes into > uipc_sockets.c) and let me know if it helps. Confirmed - resting uipc_socket.c to HEAD and applying the patch to sys= logd=20 does solve the problem we encountered. Thanks! > Thanks! >=20 > On Fri, Apr 14, 2017 at 12:48 PM, Ngie Cooper (yaneurabeya) < >=20 > yaneurabeya@gmail.com> wrote: > > > On Apr 14, 2017, at 12:46, Peter Wemm wrote: > > >=20 > > > On Friday, April 14, 2017 12:41:52 PM Maxim Sobolev wrote: > > >> Thanks, Peter. I will try to look into this asap. > > >=20 > > > I don't understand what is going on yet. Presumably there must be= other > > > changes in play that affect udp/select sometime between the origi= nal > > > 2015 > > > change and this. The syslogd -s code is Old(TM). I'm also wonder= ing > >=20 > > whether > >=20 > > > the -s code even works at all since the 2015 / r285910 change... > >=20 > > syslogd has been refactored a lot on ^/head. I don=E2=80=99t think = it=E2=80=99s safe to > > say that the ^/head and ^/stable/11 and earlier copies will functio= n the > > same. > > Thanks, > > -Ngie =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart9883833.pL1s3BkVMp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAljxW1MACgkQNdaXCeyA ngTWkQf+O4ofbVLIQ6jlydSdqRO5AgThl07dr4cjRUMzZzldtqkjj/Zk5/SvvvwS 82aYqorZfxapvJIz13Vw0QXIJPeZbWII805+6KACbmWMkqYk9bNC/FhO0NKbfDeq wH/138PvFA6iyDhTmqknvLVyjvJFElanVJB6bLbBpcTAVqSqjyhJ5EyKYlZotscO ciP3yRxHRDKmhfsOsgG3PSIw48e1PR/KJmuYrnFb1UigEXFV35yonMxebPZbHIHQ oLWbk1re3oxGYoQYn7ZMk93O2wqohCR7HjOKOILIKNOCI5mhmz7JiKrPADUqr98e hfWEIR7+2IWPj0c9RMmbnUuIk1ZDkQ== =VKpE -----END PGP SIGNATURE----- --nextPart9883833.pL1s3BkVMp-- From owner-svn-src-all@freebsd.org Sat Apr 15 00:39:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FC45D3D6E7; Sat, 15 Apr 2017 00:39:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7C11831; Sat, 15 Apr 2017 00:39:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F0djgi023690; Sat, 15 Apr 2017 00:39:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F0djY2023689; Sat, 15 Apr 2017 00:39:45 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704150039.v3F0djY2023689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 15 Apr 2017 00:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316946 - head/etc/periodic/daily X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 00:39:47 -0000 Author: asomers Date: Sat Apr 15 00:39:45 2017 New Revision: 316946 URL: https://svnweb.freebsd.org/changeset/base/316946 Log: Reorder Makefile entries from r316945 PR: 176049 Reported by: Oliver Pinter MFC after: 3 weeks X-MFC-With: 316945 Modified: head/etc/periodic/daily/Makefile Modified: head/etc/periodic/daily/Makefile ============================================================================== --- head/etc/periodic/daily/Makefile Fri Apr 14 22:59:14 2017 (r316945) +++ head/etc/periodic/daily/Makefile Sat Apr 15 00:39:45 2017 (r316946) @@ -13,10 +13,10 @@ FILES= 100.clean-disks \ 400.status-disks \ 401.status-graid \ 406.status-gmirror \ - 410.status-mfi \ 407.status-graid3 \ 408.status-gstripe \ 409.status-gconcat \ + 410.status-mfi \ 420.status-network \ 430.status-uptime \ 450.status-security \ From owner-svn-src-all@freebsd.org Sat Apr 15 00:51:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 791E1D3DF36; Sat, 15 Apr 2017 00:51:21 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 430EA8A; Sat, 15 Apr 2017 00:51:21 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F0pKX0033592; Sat, 15 Apr 2017 00:51:20 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F0pJJ1033578; Sat, 15 Apr 2017 00:51:19 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201704150051.v3F0pJJ1033578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 15 Apr 2017 00:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316947 - in vendor/NetBSD/bmake/dist: . mk unit-tests X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 00:51:21 -0000 Author: sjg Date: Sat Apr 15 00:51:18 2017 New Revision: 316947 URL: https://svnweb.freebsd.org/changeset/base/316947 Log: Import bmake-20170413 Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/auto.obj.mk vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/meta.stage.mk vendor/NetBSD/bmake/dist/mk/meta2deps.py vendor/NetBSD/bmake/dist/mk/mkopt.sh vendor/NetBSD/bmake/dist/str.c vendor/NetBSD/bmake/dist/unit-tests/modmatch.exp vendor/NetBSD/bmake/dist/unit-tests/modmatch.mk Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/ChangeLog Sat Apr 15 00:51:18 2017 (r316947) @@ -1,8 +1,35 @@ +2017-04-13 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170413 + Merge with NetBSD make, pick up + o main.c: when setting .OBJDIR ignore '$' in paths. + + * job.c: use MALLOC_OPTIONS to set malloc_options. + +2017-04-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170411 + Merge with NetBSD make, pick up + o str.c: Str_Match: allow [^a-z] to behave as expected. + +2017-03-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170326 + Merge with NetBSD make, pick up + o main.c: purge relative paths from realpath cache when .OBJDIR + is changed. + +2017-03-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170311 + Merge with NetBSD make, pick up + o main.c: only use -C arg "as is" if it starts with '/'. + 2017-03-01 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20170301 Merge with NetBSD make, pick up - o main.c: use -C arg as is rather than getcwd() + o main.c: use -C arg "as is" rather than getcwd() if they identify the same directory. o parse.c: ensure loadfile buffer is \n terminated in non-mmap case Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/Makefile Sat Apr 15 00:51:18 2017 (r316947) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.81 2017/03/01 17:01:23 sjg Exp $ +# $Id: Makefile,v 1.85 2017/04/13 16:29:40 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20170301 +_MAKE_VERSION= 20170413 PROG= bmake Modified: vendor/NetBSD/bmake/dist/job.c ============================================================================== --- vendor/NetBSD/bmake/dist/job.c Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/job.c Sat Apr 15 00:51:18 2017 (r316947) @@ -373,7 +373,10 @@ static void JobSigLock(sigset_t *); static void JobSigUnlock(sigset_t *); static void JobSigReset(void); -const char *malloc_options="A"; +#if !defined(MALLOC_OPTIONS) +# define MALLOC_OPTIONS "A" +#endif +const char *malloc_options= MALLOC_OPTIONS; static void job_table_dump(const char *where) Modified: vendor/NetBSD/bmake/dist/main.c ============================================================================== --- vendor/NetBSD/bmake/dist/main.c Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/main.c Sat Apr 15 00:51:18 2017 (r316947) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.257 2017/02/08 17:47:36 christos Exp $ */ +/* $NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.257 2017/02/08 17:47:36 christos Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.257 2017/02/08 17:47:36 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $"); #endif #endif /* not lint */ #endif @@ -458,7 +458,8 @@ rearg: (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno)); exit(2); } - if (stat(argvalue, &sa) != -1 && + if (argvalue[0] == '/' && + stat(argvalue, &sa) != -1 && stat(curdir, &sb) != -1 && sa.st_ino == sb.st_ino && sa.st_dev == sb.st_dev) @@ -721,22 +722,15 @@ Boolean Main_SetObjdir(const char *fmt, ...) { struct stat sb; - char *p, *path; - char buf[MAXPATHLEN + 1], pbuf[MAXPATHLEN + 1]; + char *path; + char buf[MAXPATHLEN + 1]; Boolean rc = FALSE; va_list ap; va_start(ap, fmt); - vsnprintf(path = pbuf, MAXPATHLEN, fmt, ap); + vsnprintf(path = buf, MAXPATHLEN, fmt, ap); va_end(ap); - /* expand variable substitutions */ - if (strchr(path, '$') != 0) { - snprintf(buf, MAXPATHLEN, "%s", path); - path = p = Var_Subst(NULL, buf, VAR_GLOBAL, VARF_WANTRES); - } else - p = NULL; - if (path[0] != '/') { snprintf(buf, MAXPATHLEN, "%s/%s", curdir, path); path = buf; @@ -752,25 +746,35 @@ Main_SetObjdir(const char *fmt, ...) Var_Set(".OBJDIR", objdir, VAR_GLOBAL, 0); setenv("PWD", objdir, 1); Dir_InitDot(); + cached_realpath(".OBJDIR", NULL); /* purge */ rc = TRUE; if (enterFlag && strcmp(objdir, curdir) != 0) enterFlagObj = TRUE; } } - free(p); return rc; } static Boolean Main_SetVarObjdir(const char *var, const char *suffix) { - char *p1, *path; - if ((path = Var_Value(var, VAR_CMD, &p1)) == NULL) + char *p, *path, *xpath; + + if ((path = Var_Value(var, VAR_CMD, &p)) == NULL) return FALSE; - (void)Main_SetObjdir("%s%s", path, suffix); - free(p1); + /* expand variable substitutions */ + if (strchr(path, '$') != 0) + xpath = Var_Subst(NULL, path, VAR_GLOBAL, VARF_WANTRES); + else + xpath = path; + + (void)Main_SetObjdir("%s%s", xpath, suffix); + + if (xpath != path) + free(xpath); + free(p); return TRUE; } @@ -1922,7 +1926,23 @@ cached_realpath(const char *pathname, ch cache->flags = INTERNAL; #endif } - + if (resolved == NULL && strcmp(pathname, ".OBJDIR") == 0) { + /* purge any relative paths */ + Hash_Entry *he, *nhe; + Hash_Search hs; + + he = Hash_EnumFirst(&cache->context, &hs); + while (he) { + nhe = Hash_EnumNext(&hs); + if (he->name[0] != '/') { + if (DEBUG(DIR)) + fprintf(stderr, "cached_realpath: purging %s\n", he->name); + Hash_DeleteEntry(&cache->context, he); + } + he = nhe; + } + return NULL; + } if ((rp = Var_Value(pathname, cache, &cp)) != NULL) { /* a hit */ strlcpy(resolved, rp, MAXPATHLEN); Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Sat Apr 15 00:51:18 2017 (r316947) @@ -1,3 +1,24 @@ +2017-04-01 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170401 + + * meta2deps.py: add is_src so we can check if obj dependency + is also a src dependency. + +2017-03-26 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170326 + + * meta.stage.mk: do nothing if NO_STAGING is defined. + +2017-03-24 Simon J. Gerraty + + * auto.obj.mk: handle the case of __objdir=obj or obj.${MACHINE} etc. + +2017-03-18 Simon J. Gerraty + + * mkopt.sh: treat WITH_*=NO like no; ie. WITHOUT_* + 2017-03-01 Simon J. Gerraty * install-mk (MK_VERSION): 20170301 Modified: vendor/NetBSD/bmake/dist/mk/auto.obj.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/auto.obj.mk Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/mk/auto.obj.mk Sat Apr 15 00:51:18 2017 (r316947) @@ -1,4 +1,4 @@ -# $Id: auto.obj.mk,v 1.12 2015/12/16 01:57:06 sjg Exp $ +# $Id: auto.obj.mk,v 1.13 2017/03/24 20:53:22 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -57,7 +57,10 @@ __objdir_made != echo ${__objdir}/; umas # This causes make to use the specified directory as .OBJDIR .OBJDIR: ${__objdir} .if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != "" +# watch out for __objdir being relative path +.if !(${__objdir:M/*} == "" && ${.OBJDIR:tA} == ${${.CURDIR}/${__objdir}:L:tA}) .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif .endif .endif +.endif Modified: vendor/NetBSD/bmake/dist/mk/dirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dirdeps.mk Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/mk/dirdeps.mk Sat Apr 15 00:51:18 2017 (r316947) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.86 2017/03/01 20:26:51 sjg Exp $ +# $Id: dirdeps.mk,v 1.87 2017/03/07 01:49:03 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -57,7 +57,7 @@ # distinguish them from others. # # Before each Makefile.depend file is read, we set -# DEP_RELDIR to be the the RELDIR (path relative to SRCTOP) for +# DEP_RELDIR to be the RELDIR (path relative to SRCTOP) for # its directory, and DEP_MACHINE etc according to the . # represented by the suffix of the corresponding target. # Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/mk/install-mk Sat Apr 15 00:51:18 2017 (r316947) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.138 2017/03/01 20:26:51 sjg Exp $ +# $Id: install-mk,v 1.140 2017/04/03 21:04:09 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20170301 +MK_VERSION=20170401 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/mk/meta.stage.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.stage.mk Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/mk/meta.stage.mk Sat Apr 15 00:51:18 2017 (r316947) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.48 2017/03/01 22:48:07 sjg Exp $ +# $Id: meta.stage.mk,v 1.49 2017/04/01 02:10:34 sjg Exp $ # # @(#) Copyright (c) 2011-2017, Simon J. Gerraty # @@ -13,6 +13,8 @@ # sjg@crufty.net # +.ifndef NO_STAGING + .if !target(__${.PARSEFILE}__) # the guard target is defined later @@ -324,3 +326,4 @@ stale_staged: staging .NOMETA .endif .endif .endif +.endif Modified: vendor/NetBSD/bmake/dist/mk/meta2deps.py ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta2deps.py Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/mk/meta2deps.py Sat Apr 15 00:51:18 2017 (r316947) @@ -37,7 +37,7 @@ We only pay attention to a subset of the """ RCSid: - $Id: meta2deps.py,v 1.24 2017/02/08 22:17:10 sjg Exp $ + $Id: meta2deps.py,v 1.25 2017/04/03 21:04:09 sjg Exp $ Copyright (c) 2011-2013, Juniper Networks, Inc. All rights reserved. @@ -491,6 +491,21 @@ class MetaFile: if not file: f.close() + def is_src(self, base, dir, rdir): + """is base in srctop""" + for dir in [dir,rdir]: + if not dir: + continue + path = '/'.join([dir,base]) + srctop = self.find_top(path, self.srctops) + if srctop: + if self.dpdeps: + self.add(self.file_deps, path.replace(srctop,''), 'file') + self.add(self.src_deps, dir.replace(srctop,''), 'src') + self.seenit(dir) + return True + return False + def parse_path(self, path, cwd, op=None, w=[]): """look at a path for the op specified""" @@ -519,10 +534,9 @@ class MetaFile: # to the src dir, we may need to add dependencies for each rdir = dir dir = abspath(dir, cwd, self.last_dir, self.debug, self.debug_out) - if rdir == dir or rdir.find('./') > 0: - rdir = None - if os.path.islink(dir): rdir = os.path.realpath(dir) + if rdir == dir: + rdir = None # now put path back together path = '/'.join([dir,base]) if self.debug > 1: @@ -543,17 +557,9 @@ class MetaFile: # finally, we get down to it if dir == self.cwd or dir == self.curdir: return - srctop = self.find_top(path, self.srctops) - if srctop: - if self.dpdeps: - self.add(self.file_deps, path.replace(srctop,''), 'file') - self.add(self.src_deps, dir.replace(srctop,''), 'src') + if self.is_src(base, dir, rdir): self.seenit(w[2]) - self.seenit(dir) - if rdir and not rdir.startswith(srctop): - dir = rdir # for below - rdir = None - else: + if not rdir: return objroot = None Modified: vendor/NetBSD/bmake/dist/mk/mkopt.sh ============================================================================== --- vendor/NetBSD/bmake/dist/mk/mkopt.sh Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/mk/mkopt.sh Sat Apr 15 00:51:18 2017 (r316947) @@ -1,5 +1,5 @@ : -# $Id: mkopt.sh,v 1.10 2015/06/07 17:29:08 sjg Exp $ +# $Id: mkopt.sh,v 1.11 2017/03/18 21:36:42 sjg Exp $ # # @(#) Copyright (c) 2014, Simon J. Gerraty # @@ -40,7 +40,7 @@ _mk_opt() { eval "_mov=\$$_mo _wov=\$$_wo _wiv=\$$_wi" case "$_wiv" in - no) _wov=no;; + [Nn][Oo]) _wov=no;; esac _v=${_mov:-${_wov:+no}} _v=${_v:-${_wiv:+yes}} Modified: vendor/NetBSD/bmake/dist/str.c ============================================================================== --- vendor/NetBSD/bmake/dist/str.c Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/str.c Sat Apr 15 00:51:18 2017 (r316947) @@ -1,4 +1,4 @@ -/* $NetBSD: str.c,v 1.36 2016/04/06 09:57:00 gson Exp $ */ +/* $NetBSD: str.c,v 1.37 2017/04/11 17:30:13 sjg Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: str.c,v 1.36 2016/04/06 09:57:00 gson Exp $"; +static char rcsid[] = "$NetBSD: str.c,v 1.37 2017/04/11 17:30:13 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; #else -__RCSID("$NetBSD: str.c,v 1.36 2016/04/06 09:57:00 gson Exp $"); +__RCSID("$NetBSD: str.c,v 1.37 2017/04/11 17:30:13 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -373,16 +373,23 @@ Str_Match(const char *string, const char * by a range (two characters separated by "-"). */ if (*pattern == '[') { + int nomatch; + ++pattern; + if (*pattern == '^') { + ++pattern; + nomatch = 1; + } else + nomatch = 0; for (;;) { if ((*pattern == ']') || (*pattern == 0)) - return(0); + return(nomatch); if (*pattern == *string) break; if (pattern[1] == '-') { c2 = pattern[2]; if (c2 == 0) - return(0); + return(nomatch); if ((*pattern <= *string) && (c2 >= *string)) break; @@ -393,6 +400,8 @@ Str_Match(const char *string, const char } ++pattern; } + if (nomatch) + return 0; while ((*pattern != ']') && (*pattern != 0)) ++pattern; goto thisCharOK; Modified: vendor/NetBSD/bmake/dist/unit-tests/modmatch.exp ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/modmatch.exp Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/unit-tests/modmatch.exp Sat Apr 15 00:51:18 2017 (r316947) @@ -14,4 +14,6 @@ LIB=e X_LIBS:M${LIB${LIB:tu}} is "/tmp/l LIB=e X_LIBS:M*/lib${LIB}.a is "/tmp/libe.a" LIB=e X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBE.A" Mscanner=OK +Upper=One Two Three Four +Lower=five six seven exit status 0 Modified: vendor/NetBSD/bmake/dist/unit-tests/modmatch.mk ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/modmatch.mk Sat Apr 15 00:39:45 2017 (r316946) +++ vendor/NetBSD/bmake/dist/unit-tests/modmatch.mk Sat Apr 15 00:51:18 2017 (r316947) @@ -15,7 +15,9 @@ res = no res = OK .endif -all: +all: show-libs check-cclass + +show-libs: @for x in $X; do ${.MAKE} -f ${MAKEFILE} show LIB=$$x; done @echo "Mscanner=${res}" @@ -23,3 +25,9 @@ show: @echo 'LIB=${LIB} X_LIBS:M$${LIB$${LIB:tu}} is "${X_LIBS:M${LIB${LIB:tu}}}"' @echo 'LIB=${LIB} X_LIBS:M*/lib$${LIB}.a is "${X_LIBS:M*/lib${LIB}.a}"' @echo 'LIB=${LIB} X_LIBS:M*/lib$${LIB}.a:tu is "${X_LIBS:M*/lib${LIB}.a:tu}"' + +LIST= One Two Three Four five six seven + +check-cclass: + @echo Upper=${LIST:M[A-Z]*} + @echo Lower=${LIST:M[^A-Z]*} From owner-svn-src-all@freebsd.org Sat Apr 15 00:51:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B8FD3DFFD; Sat, 15 Apr 2017 00:51:37 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19EC118A; Sat, 15 Apr 2017 00:51:36 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F0paUk033646; Sat, 15 Apr 2017 00:51:36 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F0pawI033645; Sat, 15 Apr 2017 00:51:36 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201704150051.v3F0pawI033645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 15 Apr 2017 00:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316948 - vendor/NetBSD/bmake/20170413 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 00:51:37 -0000 Author: sjg Date: Sat Apr 15 00:51:35 2017 New Revision: 316948 URL: https://svnweb.freebsd.org/changeset/base/316948 Log: tag bmake-20170413 Added: vendor/NetBSD/bmake/20170413/ - copied from r316947, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@freebsd.org Sat Apr 15 01:15:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95DC7D3E7E1; Sat, 15 Apr 2017 01:15:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73B80FF9; Sat, 15 Apr 2017 01:15:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F1FBTn009133; Fri, 14 Apr 2017 18:15:11 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F1FAbU009132; Fri, 14 Apr 2017 18:15:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150115.v3F1FAbU009132@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316936 - head/sys/dev/cxgbe/iw_cxgbe In-Reply-To: <201704141915.v3EJFVMX093441@repo.freebsd.org> To: Navdeep Parhar Date: Fri, 14 Apr 2017 18:15:10 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 01:15:20 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: np > Date: Fri Apr 14 19:15:31 2017 > New Revision: 316936 > URL: https://svnweb.freebsd.org/changeset/base/316936 > > Log: > cxgbe/iw_cxgbe: hw supports 64K (not 32K) Protection Domains. > > MFC after: 3 days > Sponsored by: Chelsio Communications > > Modified: > head/sys/dev/cxgbe/iw_cxgbe/t4.h > > Modified: head/sys/dev/cxgbe/iw_cxgbe/t4.h > ============================================================================== > --- head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 18:56:00 2017 (r316935) > +++ head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 19:15:31 2017 (r316936) > @@ -61,7 +61,7 @@ > > #define T4_MAX_NUM_QP (1<<16) > #define T4_MAX_NUM_CQ (1<<15) > -#define T4_MAX_NUM_PD (1<<15) > +#define T4_MAX_NUM_PD 65536 Why the change in methods of expressing powers of 2 here? This, imho, would better match the near by code as #define T4_MAX_NUM_PD (1<<16) > #define T4_EQ_STATUS_ENTRIES (L1_CACHE_BYTES > 64 ? 2 : 1) > #define T4_MAX_EQ_SIZE (65520 - T4_EQ_STATUS_ENTRIES) > #define T4_MAX_IQ_SIZE (65520 - 1) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 01:30:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EC36D3D1BB; Sat, 15 Apr 2017 01:30:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 681ACA27; Sat, 15 Apr 2017 01:30:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F1UHg1009182; Fri, 14 Apr 2017 18:30:17 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F1UHpR009181; Fri, 14 Apr 2017 18:30:17 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150130.v3F1UHpR009181@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> To: Mark Johnston Date: Fri, 14 Apr 2017 18:30:17 -0700 (PDT) CC: Alan Somers , Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 01:30:19 -0000 > On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: > > On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: > > > Author: ngie > > > Date: Fri Apr 14 19:41:48 2017 > > > New Revision: 316938 > > > URL: https://svnweb.freebsd.org/changeset/base/316938 > > > > > > Log: > > > savecore: fix space calculation with respect to `minfree` in check_space(..) > > > > > > - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > > > representable data to INT_MAX. Check the values received from > > > strtoll(3), trimming trailing whitespace off the end to maintain > > > POLA. > > > - Use `KiB` instead of `kB` when describing free space, total space, > > > etc. I am now fully aware of `KiB` being the IEC standard for 1024 > > > bytes and `kB` being the IEC standard for 1000 bytes. > > > - Store available number of KiB in `available` so it can be more > > > easily queried and compared to ensure that there are enough KiB to > > > store the dump image on disk. > > > - Print out the reserved space on disk, per `minfree`, so end-users > > > can troubleshoot why check_space(..) is reporting that there isn't > > > enough free space. > > > > > > MFC after: 7 weeks > > > Reviewed by: Anton Rang (earlier diff), cem (earlier diff) > > > Tested with: positive/negative cases (see review); make tinderbox > > > Sponsored by: Dell EMC Isilon > > > Differential Revision: D10379 > > > > The free space calculation is still uselessly conservative, because it > > doesn't account for the fact that core dumps will always be either > > spare or compressed. The result is that savecore will frequently > > refuse to save corefiles even when there's plenty of space. I > > proposed removing the space check altogether in > > https://reviews.freebsd.org/D2587. However, I agreed to wait until > > after the compressed core dump feature was merged, because then mostly > > accurate space checks will be possible. AFAIK the compressed core > > dump feature still hasn't been finished. > > I had held off on it for a while because it was going to conflict with > the work to add encrypted dump support, which of course has finished. > > The patch to add compression support is here and should largely still > work: > https://people.freebsd.org/~markj/patches/core-compression/20141110-kern_dump.diff > > I've been hesitant about pushing it forward: > - The dump_write* APIs need some simplification after the addition of > encrypted dump support and support for dumping to 4Kn drives. > - I'm not sure how encryption should compose with compression. It seems > intuitively obvious that we should compress before encrypting if the > compression is to be of any use, but I don't know enough to know > whether the compression might somehow compromise the effectiveness of > the encryption. > > If anyone has some insight on the second of these two points, I'd > appreciate hearing it. I have a large amount of reworking and modulization of the dump code incuding intergration of your (markj) compressed dumps. Layer isnt implemented but is in the plan. I should not of held off on the net dump code as it got smashed by encrypted dumps, then again by the libif'ing for all the Intel drives that had been netdump modified. Basically now starting over :-( Minidump is an lkm for me, and main dump is almost an lkm for me too. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 01:35:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A58D4D3D3D9 for ; Sat, 15 Apr 2017 01:35:26 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7320DE34; Sat, 15 Apr 2017 01:35:26 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F1ZEc7009212; Fri, 14 Apr 2017 18:35:14 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F1ZD2S009211; Fri, 14 Apr 2017 18:35:13 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150135.v3F1ZD2S009211@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: To: Larry Rosenman Date: Fri, 14 Apr 2017 18:35:13 -0700 (PDT) CC: "Ngie Cooper (yaneurabeya)" , "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ngie Cooper Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 01:35:26 -0000 > On 4/14/17, 3:39 PM, "Ngie Cooper (yaneurabeya)" wrote: > > > > On Apr 14, 2017, at 13:37, Larry Rosenman wrote: > > > > On 4/14/17, 3:33 PM, "Ngie Cooper (yaneurabeya)" wrote: > > > >> On Apr 14, 2017, at 13:26, Larry Rosenman wrote: > >> > >> On 4/14/17, 3:19 PM, "Ngie Cooper (yaneurabeya)" wrote: > >> > >>> On Apr 14, 2017, at 13:14, Slawa Olhovchenkov wrote: > >>> > >>> On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: > >>> > >>>> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: > >>>>> Author: ngie > >>>>> Date: Fri Apr 14 19:41:48 2017 > >>>>> New Revision: 316938 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/316938 > >>>>> > >>>>> Log: > >>>>> savecore: fix space calculation with respect to `minfree` in check_space(..) > >>>>> > >>>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > >>>>> representable data to INT_MAX. Check the values received from > >>>>> strtoll(3), trimming trailing whitespace off the end to maintain > >>>>> POLA. > >>>>> - Use `KiB` instead of `kB` when describing free space, total space, > >>>>> etc. I am now fully aware of `KiB` being the IEC standard for 1024 > >>>>> bytes and `kB` being the IEC standard for 1000 bytes. > >>>>> - Store available number of KiB in `available` so it can be more > >>>>> easily queried and compared to ensure that there are enough KiB to > >>>>> store the dump image on disk. > >>>>> - Print out the reserved space on disk, per `minfree`, so end-users > >>>>> can troubleshoot why check_space(..) is reporting that there isn't > >>>>> enough free space. > >>>>> > >>>>> MFC after: 7 weeks > >>>>> Reviewed by: Anton Rang (earlier diff), cem (earlier diff) > >>>>> Tested with: positive/negative cases (see review); make tinderbox > >>>>> Sponsored by: Dell EMC Isilon > >>>>> Differential Revision: D10379 > >>>> > >>>> The free space calculation is still uselessly conservative, because it > >>>> doesn't account for the fact that core dumps will always be either > >>>> spare or compressed. The result is that savecore will frequently > >>>> refuse to save corefiles even when there's plenty of space. I > >>>> proposed removing the space check altogether in > >>>> https://reviews.freebsd.org/D2587. However, I agreed to wait until > >>>> after the compressed core dump feature was merged, because then mostly > >>>> accurate space checks will be possible. AFAIK the compressed core > >>>> dump feature still hasn't been finished. > >>> > >>> Is posible (in the future) to use multiple swaps (on multiple disks) > >>> for save core dumps? > >> > >> Multiple swap devices is already handled by savecore(8), if one uses fstab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on individual devices. > >> > >> As far as saving to multiple disks is concerned, I would hope that one is using a redundancy capable filesystem (zfs) or RAID-like technology (gmirror, graid, LSI Fusion?s RAID product line) to stripe and/or mirror the data across multiple disks. > > > > ? > > > >> How do I use multiple devices to have the system dump on all of my swap? I got a message about not enough space, but there (I think) was enough between multiple drives?. > > > > Something like: > > > > - Create a zpool > > - Mount zpool to /crashdumps > > - Change dumpdir in /etc/rc.conf to be /crashdumps, e.g., echo ?dumpdir=/crashdumps? > > > > ? > > HTH, > > -Ngie > > > > PS The issue with lack of space might be the issue that Alan brought up earlier with compressed dumps and overly conservative free space checks, or it might be the fact that dumpdir (default: /var/crash) is full. > > > > > > I was talking about the actual crashdump to swap by the system. /var/crash has 10T of space (my root pool). > > If your memory is bigger than your swap, you?re unfortunately not able to save the mini dump if the size of the saved pages exceed the space on swap. I think this is where markj?s compressed dumps feature will come in handy. > Thanks! > -Ngie > > > Yeah, I have the following: > borg.lerctr.org /home/ler $ swapctl -l > Device: 1024-blocks Used: > /dev/mfid0p3 8388608 0 > /dev/mfid1p3 8388608 0 > /dev/mfid2p3 8388608 0 > /dev/mfid3p3 8388608 0 > /dev/mfid4p3 8388608 0 > /dev/mfid5p3 8388608 0 > borg.lerctr.org /home/ler $ sysctl hw.physmem > hw.physmem: 137368682496 > borg.lerctr.org /home/ler $ > > SO 6 8G partitions (48G), but the dump is larger than 8G. Larry, This is a very good concern and point given todays more common huge memory foot prints and lots of spindles. I'll keep this in they back of my mind as I tromp around in the dump code. I have another solution that may work for you and that is to use Netdump rather than swapdump. This basically eliminates the trip to swap space and you end up going to savecore style output on the netdump server. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 01:37:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73792D3D498; Sat, 15 Apr 2017 01:37:33 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F02EFB8; Sat, 15 Apr 2017 01:37:33 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-transfer-encoding:Content-type:Mime-version:In-Reply-To: References:Message-ID:CC:To:From:Subject:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=oW5nAUe6ldn1gksap39WnQpWmW1MjwvAJ/nAu+p571g=; b=rTZQWbgWvA1CeeaPnLAzD2XOM7 TyuK53k7LJ5zU/C/3c+ab7D3yQoo7LTCYNSFcVP2LBxNuH5kQhcA09HtHZ26/9oqbtgELnMalb5BE BlUi3YmioFkF7oDwCyIH8KkfR/oAmd2MUI7iI/DXzB3r0wtp7SQdjB+ovaKQn302NqUA=; Received: from [47.220.164.50] (port=57864 helo=[192.168.200.198]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1czCea-0001Nl-3F; Fri, 14 Apr 2017 20:37:32 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Fri, 14 Apr 2017 20:37:30 -0500 Subject: Re: svn commit: r316938 - head/sbin/savecore From: Larry Rosenman To: CC: "Ngie Cooper (yaneurabeya)" , "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ngie Cooper Message-ID: Thread-Topic: svn commit: r316938 - head/sbin/savecore References: <201704150135.v3F1ZD2S009211@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201704150135.v3F1ZD2S009211@pdx.rh.CN85.dnsmgr.net> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 01:37:33 -0000 On 4/14/17, 8:35 PM, "Rodney W. Grimes" wr= ote: > Yeah, I have the following: > borg.lerctr.org /home/ler $ swapctl -l > Device: 1024-blocks Used: > /dev/mfid0p3 8388608 0 > /dev/mfid1p3 8388608 0 > /dev/mfid2p3 8388608 0 > /dev/mfid3p3 8388608 0 > /dev/mfid4p3 8388608 0 > /dev/mfid5p3 8388608 0 > borg.lerctr.org /home/ler $ sysctl hw.physmem > hw.physmem: 137368682496 > borg.lerctr.org /home/ler $ >=20 > SO 6 8G partitions (48G), but the dump is larger than 8G.=20 =20 Larry, This is a very good concern and point given todays more common huge memory foot prints and lots of spindles. I'll keep this in they back of my mind as I tromp around in the dump code. I have another solution that may work for you and that is to use Netdump rather than swapdump. This basically eliminates the trip to swap space and you end up going to savecore style output on the netdump server. =20 --=20 Rod Grimes rgrimes@free= bsd.org =20 What does it take for NetDump to work to a FreeNAS (9.10 nightly) server si= nce that=E2=80=99s what is =E2=80=9Cnext to=E2=80=9D this server? =20 From owner-svn-src-all@freebsd.org Sat Apr 15 01:41:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF16FD3D573; Sat, 15 Apr 2017 01:41:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFF19396; Sat, 15 Apr 2017 01:41:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F1fWxW009237; Fri, 14 Apr 2017 18:41:32 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F1fWn1009236; Fri, 14 Apr 2017 18:41:32 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150141.v3F1fWn1009236@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <20170414204642.GC70430@zxy.spb.ru> To: Slawa Olhovchenkov Date: Fri, 14 Apr 2017 18:41:32 -0700 (PDT) CC: "Ngie Cooper (yaneurabeya)" , Larry Rosenman , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 01:41:42 -0000 [ Charset UTF-8 unsupported, converting... ] > On Fri, Apr 14, 2017 at 01:45:22PM -0700, Ngie Cooper (yaneurabeya) wrote: > > > > > > On Apr 14, 2017, at 13:42, Slawa Olhovchenkov wrote: > > > > ? > > > > > No, something like: > > > % swapinfo > > > Device 1K-blocks Used Avail Capacity > > > /dev/ada0p2 33554432 0 33554432 0% > > > /dev/ada1p2 33554432 0 33554432 0% > > > Total 67108864 0 67108864 0% > > > > Striping dumps across multiple swap devices isn?t supported. Sorry. > > What about support in the future? Added to my project list at people.freebsd.org/~rgrimes. No promises, but I'll look at it while I am doing the other work. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 01:44:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D61BCD3D74E; Sat, 15 Apr 2017 01:44:47 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0B2A82F; Sat, 15 Apr 2017 01:44:47 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F1ikRh054096; Sat, 15 Apr 2017 01:44:46 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F1ijKm054081; Sat, 15 Apr 2017 01:44:45 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201704150144.v3F1ijKm054081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 15 Apr 2017 01:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316949 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 01:44:47 -0000 Author: sjg Date: Sat Apr 15 01:44:45 2017 New Revision: 316949 URL: https://svnweb.freebsd.org/changeset/base/316949 Log: Update to bmake 20170413 Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile head/contrib/bmake/job.c head/contrib/bmake/main.c head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/auto.obj.mk head/contrib/bmake/mk/dirdeps.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/meta.stage.mk head/contrib/bmake/mk/meta2deps.py head/contrib/bmake/mk/mkopt.sh head/contrib/bmake/str.c head/contrib/bmake/unit-tests/modmatch.exp head/contrib/bmake/unit-tests/modmatch.mk head/usr.bin/bmake/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/ChangeLog Sat Apr 15 01:44:45 2017 (r316949) @@ -1,8 +1,35 @@ +2017-04-13 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170413 + Merge with NetBSD make, pick up + o main.c: when setting .OBJDIR ignore '$' in paths. + + * job.c: use MALLOC_OPTIONS to set malloc_options. + +2017-04-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170411 + Merge with NetBSD make, pick up + o str.c: Str_Match: allow [^a-z] to behave as expected. + +2017-03-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170326 + Merge with NetBSD make, pick up + o main.c: purge relative paths from realpath cache when .OBJDIR + is changed. + +2017-03-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170311 + Merge with NetBSD make, pick up + o main.c: only use -C arg "as is" if it starts with '/'. + 2017-03-01 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20170301 Merge with NetBSD make, pick up - o main.c: use -C arg as is rather than getcwd() + o main.c: use -C arg "as is" rather than getcwd() if they identify the same directory. o parse.c: ensure loadfile buffer is \n terminated in non-mmap case Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/Makefile Sat Apr 15 01:44:45 2017 (r316949) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.81 2017/03/01 17:01:23 sjg Exp $ +# $Id: Makefile,v 1.85 2017/04/13 16:29:40 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20170301 +_MAKE_VERSION= 20170413 PROG= bmake Modified: head/contrib/bmake/job.c ============================================================================== --- head/contrib/bmake/job.c Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/job.c Sat Apr 15 01:44:45 2017 (r316949) @@ -389,7 +389,10 @@ static void JobSigLock(sigset_t *); static void JobSigUnlock(sigset_t *); static void JobSigReset(void); -const char *malloc_options="A"; +#if !defined(MALLOC_OPTIONS) +# define MALLOC_OPTIONS "A" +#endif +const char *malloc_options= MALLOC_OPTIONS; static void job_table_dump(const char *where) Modified: head/contrib/bmake/main.c ============================================================================== --- head/contrib/bmake/main.c Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/main.c Sat Apr 15 01:44:45 2017 (r316949) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.257 2017/02/08 17:47:36 christos Exp $ */ +/* $NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.257 2017/02/08 17:47:36 christos Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.257 2017/02/08 17:47:36 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $"); #endif #endif /* not lint */ #endif @@ -722,22 +722,15 @@ Boolean Main_SetObjdir(const char *fmt, ...) { struct stat sb; - char *p, *path; - char buf[MAXPATHLEN + 1], pbuf[MAXPATHLEN + 1]; + char *path; + char buf[MAXPATHLEN + 1]; Boolean rc = FALSE; va_list ap; va_start(ap, fmt); - vsnprintf(path = pbuf, MAXPATHLEN, fmt, ap); + vsnprintf(path = buf, MAXPATHLEN, fmt, ap); va_end(ap); - /* expand variable substitutions */ - if (strchr(path, '$') != 0) { - snprintf(buf, MAXPATHLEN, "%s", path); - path = p = Var_Subst(NULL, buf, VAR_GLOBAL, VARF_WANTRES); - } else - p = NULL; - if (path[0] != '/') { snprintf(buf, MAXPATHLEN, "%s/%s", curdir, path); path = buf; @@ -753,25 +746,35 @@ Main_SetObjdir(const char *fmt, ...) Var_Set(".OBJDIR", objdir, VAR_GLOBAL, 0); setenv("PWD", objdir, 1); Dir_InitDot(); + cached_realpath(".OBJDIR", NULL); /* purge */ rc = TRUE; if (enterFlag && strcmp(objdir, curdir) != 0) enterFlagObj = TRUE; } } - free(p); return rc; } static Boolean Main_SetVarObjdir(const char *var, const char *suffix) { - char *p1, *path; - if ((path = Var_Value(var, VAR_CMD, &p1)) == NULL) + char *p, *path, *xpath; + + if ((path = Var_Value(var, VAR_CMD, &p)) == NULL) return FALSE; - (void)Main_SetObjdir("%s%s", path, suffix); - free(p1); + /* expand variable substitutions */ + if (strchr(path, '$') != 0) + xpath = Var_Subst(NULL, path, VAR_GLOBAL, VARF_WANTRES); + else + xpath = path; + + (void)Main_SetObjdir("%s%s", xpath, suffix); + + if (xpath != path) + free(xpath); + free(p); return TRUE; } @@ -1923,7 +1926,23 @@ cached_realpath(const char *pathname, ch cache->flags = INTERNAL; #endif } - + if (resolved == NULL && strcmp(pathname, ".OBJDIR") == 0) { + /* purge any relative paths */ + Hash_Entry *he, *nhe; + Hash_Search hs; + + he = Hash_EnumFirst(&cache->context, &hs); + while (he) { + nhe = Hash_EnumNext(&hs); + if (he->name[0] != '/') { + if (DEBUG(DIR)) + fprintf(stderr, "cached_realpath: purging %s\n", he->name); + Hash_DeleteEntry(&cache->context, he); + } + he = nhe; + } + return NULL; + } if ((rp = Var_Value(pathname, cache, &cp)) != NULL) { /* a hit */ strlcpy(resolved, rp, MAXPATHLEN); Modified: head/contrib/bmake/mk/ChangeLog ============================================================================== --- head/contrib/bmake/mk/ChangeLog Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/mk/ChangeLog Sat Apr 15 01:44:45 2017 (r316949) @@ -1,3 +1,24 @@ +2017-04-01 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170401 + + * meta2deps.py: add is_src so we can check if obj dependency + is also a src dependency. + +2017-03-26 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170326 + + * meta.stage.mk: do nothing if NO_STAGING is defined. + +2017-03-24 Simon J. Gerraty + + * auto.obj.mk: handle the case of __objdir=obj or obj.${MACHINE} etc. + +2017-03-18 Simon J. Gerraty + + * mkopt.sh: treat WITH_*=NO like no; ie. WITHOUT_* + 2017-03-01 Simon J. Gerraty * install-mk (MK_VERSION): 20170301 Modified: head/contrib/bmake/mk/auto.obj.mk ============================================================================== --- head/contrib/bmake/mk/auto.obj.mk Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/mk/auto.obj.mk Sat Apr 15 01:44:45 2017 (r316949) @@ -1,4 +1,4 @@ -# $Id: auto.obj.mk,v 1.12 2015/12/16 01:57:06 sjg Exp $ +# $Id: auto.obj.mk,v 1.13 2017/03/24 20:53:22 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -57,7 +57,10 @@ __objdir_made != echo ${__objdir}/; umas # This causes make to use the specified directory as .OBJDIR .OBJDIR: ${__objdir} .if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != "" +# watch out for __objdir being relative path +.if !(${__objdir:M/*} == "" && ${.OBJDIR:tA} == ${${.CURDIR}/${__objdir}:L:tA}) .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif .endif .endif +.endif Modified: head/contrib/bmake/mk/dirdeps.mk ============================================================================== --- head/contrib/bmake/mk/dirdeps.mk Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/mk/dirdeps.mk Sat Apr 15 01:44:45 2017 (r316949) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.86 2017/03/01 20:26:51 sjg Exp $ +# $Id: dirdeps.mk,v 1.87 2017/03/07 01:49:03 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -57,7 +57,7 @@ # distinguish them from others. # # Before each Makefile.depend file is read, we set -# DEP_RELDIR to be the the RELDIR (path relative to SRCTOP) for +# DEP_RELDIR to be the RELDIR (path relative to SRCTOP) for # its directory, and DEP_MACHINE etc according to the . # represented by the suffix of the corresponding target. # Modified: head/contrib/bmake/mk/install-mk ============================================================================== --- head/contrib/bmake/mk/install-mk Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/mk/install-mk Sat Apr 15 01:44:45 2017 (r316949) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.138 2017/03/01 20:26:51 sjg Exp $ +# $Id: install-mk,v 1.140 2017/04/03 21:04:09 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20170301 +MK_VERSION=20170401 OWNER= GROUP= MODE=444 Modified: head/contrib/bmake/mk/meta.stage.mk ============================================================================== --- head/contrib/bmake/mk/meta.stage.mk Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/mk/meta.stage.mk Sat Apr 15 01:44:45 2017 (r316949) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.48 2017/03/01 22:48:07 sjg Exp $ +# $Id: meta.stage.mk,v 1.49 2017/04/01 02:10:34 sjg Exp $ # # @(#) Copyright (c) 2011-2017, Simon J. Gerraty # @@ -13,6 +13,8 @@ # sjg@crufty.net # +.ifndef NO_STAGING + .if !target(__${.PARSEFILE}__) # the guard target is defined later @@ -324,3 +326,4 @@ stale_staged: staging .NOMETA .endif .endif .endif +.endif Modified: head/contrib/bmake/mk/meta2deps.py ============================================================================== --- head/contrib/bmake/mk/meta2deps.py Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/mk/meta2deps.py Sat Apr 15 01:44:45 2017 (r316949) @@ -37,7 +37,7 @@ We only pay attention to a subset of the """ RCSid: - $Id: meta2deps.py,v 1.24 2017/02/08 22:17:10 sjg Exp $ + $Id: meta2deps.py,v 1.25 2017/04/03 21:04:09 sjg Exp $ Copyright (c) 2011-2013, Juniper Networks, Inc. All rights reserved. @@ -491,6 +491,21 @@ class MetaFile: if not file: f.close() + def is_src(self, base, dir, rdir): + """is base in srctop""" + for dir in [dir,rdir]: + if not dir: + continue + path = '/'.join([dir,base]) + srctop = self.find_top(path, self.srctops) + if srctop: + if self.dpdeps: + self.add(self.file_deps, path.replace(srctop,''), 'file') + self.add(self.src_deps, dir.replace(srctop,''), 'src') + self.seenit(dir) + return True + return False + def parse_path(self, path, cwd, op=None, w=[]): """look at a path for the op specified""" @@ -519,10 +534,9 @@ class MetaFile: # to the src dir, we may need to add dependencies for each rdir = dir dir = abspath(dir, cwd, self.last_dir, self.debug, self.debug_out) - if rdir == dir or rdir.find('./') > 0: - rdir = None - if os.path.islink(dir): rdir = os.path.realpath(dir) + if rdir == dir: + rdir = None # now put path back together path = '/'.join([dir,base]) if self.debug > 1: @@ -543,17 +557,9 @@ class MetaFile: # finally, we get down to it if dir == self.cwd or dir == self.curdir: return - srctop = self.find_top(path, self.srctops) - if srctop: - if self.dpdeps: - self.add(self.file_deps, path.replace(srctop,''), 'file') - self.add(self.src_deps, dir.replace(srctop,''), 'src') + if self.is_src(base, dir, rdir): self.seenit(w[2]) - self.seenit(dir) - if rdir and not rdir.startswith(srctop): - dir = rdir # for below - rdir = None - else: + if not rdir: return objroot = None Modified: head/contrib/bmake/mk/mkopt.sh ============================================================================== --- head/contrib/bmake/mk/mkopt.sh Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/mk/mkopt.sh Sat Apr 15 01:44:45 2017 (r316949) @@ -1,5 +1,5 @@ : -# $Id: mkopt.sh,v 1.10 2015/06/07 17:29:08 sjg Exp $ +# $Id: mkopt.sh,v 1.11 2017/03/18 21:36:42 sjg Exp $ # # @(#) Copyright (c) 2014, Simon J. Gerraty # @@ -40,7 +40,7 @@ _mk_opt() { eval "_mov=\$$_mo _wov=\$$_wo _wiv=\$$_wi" case "$_wiv" in - no) _wov=no;; + [Nn][Oo]) _wov=no;; esac _v=${_mov:-${_wov:+no}} _v=${_v:-${_wiv:+yes}} Modified: head/contrib/bmake/str.c ============================================================================== --- head/contrib/bmake/str.c Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/str.c Sat Apr 15 01:44:45 2017 (r316949) @@ -1,4 +1,4 @@ -/* $NetBSD: str.c,v 1.36 2016/04/06 09:57:00 gson Exp $ */ +/* $NetBSD: str.c,v 1.37 2017/04/11 17:30:13 sjg Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: str.c,v 1.36 2016/04/06 09:57:00 gson Exp $"; +static char rcsid[] = "$NetBSD: str.c,v 1.37 2017/04/11 17:30:13 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; #else -__RCSID("$NetBSD: str.c,v 1.36 2016/04/06 09:57:00 gson Exp $"); +__RCSID("$NetBSD: str.c,v 1.37 2017/04/11 17:30:13 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -373,16 +373,23 @@ Str_Match(const char *string, const char * by a range (two characters separated by "-"). */ if (*pattern == '[') { + int nomatch; + ++pattern; + if (*pattern == '^') { + ++pattern; + nomatch = 1; + } else + nomatch = 0; for (;;) { if ((*pattern == ']') || (*pattern == 0)) - return(0); + return(nomatch); if (*pattern == *string) break; if (pattern[1] == '-') { c2 = pattern[2]; if (c2 == 0) - return(0); + return(nomatch); if ((*pattern <= *string) && (c2 >= *string)) break; @@ -393,6 +400,8 @@ Str_Match(const char *string, const char } ++pattern; } + if (nomatch) + return 0; while ((*pattern != ']') && (*pattern != 0)) ++pattern; goto thisCharOK; Modified: head/contrib/bmake/unit-tests/modmatch.exp ============================================================================== --- head/contrib/bmake/unit-tests/modmatch.exp Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/unit-tests/modmatch.exp Sat Apr 15 01:44:45 2017 (r316949) @@ -14,4 +14,6 @@ LIB=e X_LIBS:M${LIB${LIB:tu}} is "/tmp/l LIB=e X_LIBS:M*/lib${LIB}.a is "/tmp/libe.a" LIB=e X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBE.A" Mscanner=OK +Upper=One Two Three Four +Lower=five six seven exit status 0 Modified: head/contrib/bmake/unit-tests/modmatch.mk ============================================================================== --- head/contrib/bmake/unit-tests/modmatch.mk Sat Apr 15 00:51:35 2017 (r316948) +++ head/contrib/bmake/unit-tests/modmatch.mk Sat Apr 15 01:44:45 2017 (r316949) @@ -15,7 +15,9 @@ res = no res = OK .endif -all: +all: show-libs check-cclass + +show-libs: @for x in $X; do ${.MAKE} -f ${MAKEFILE} show LIB=$$x; done @echo "Mscanner=${res}" @@ -23,3 +25,9 @@ show: @echo 'LIB=${LIB} X_LIBS:M$${LIB$${LIB:tu}} is "${X_LIBS:M${LIB${LIB:tu}}}"' @echo 'LIB=${LIB} X_LIBS:M*/lib$${LIB}.a is "${X_LIBS:M*/lib${LIB}.a}"' @echo 'LIB=${LIB} X_LIBS:M*/lib$${LIB}.a:tu is "${X_LIBS:M*/lib${LIB}.a:tu}"' + +LIST= One Two Three Four five six seven + +check-cclass: + @echo Upper=${LIST:M[A-Z]*} + @echo Lower=${LIST:M[^A-Z]*} Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Sat Apr 15 00:51:35 2017 (r316948) +++ head/usr.bin/bmake/Makefile Sat Apr 15 01:44:45 2017 (r316949) @@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR} CLEANDIRS+= FreeBSD CLEANFILES+= bootstrap -# $Id: Makefile,v 1.81 2017/03/01 17:01:23 sjg Exp $ +# $Id: Makefile,v 1.85 2017/04/13 16:29:40 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20170301 +_MAKE_VERSION= 20170413 PROG?= ${.CURDIR:T} From owner-svn-src-all@freebsd.org Sat Apr 15 01:49:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 124B2D3D836; Sat, 15 Apr 2017 01:49:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E387C9AA; Sat, 15 Apr 2017 01:49:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F1nuD5009275; Fri, 14 Apr 2017 18:49:56 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F1nu0D009274; Fri, 14 Apr 2017 18:49:56 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150149.v3F1nu0D009274@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <1940104.87G28XVdqf@ralph.baldwin.cx> To: John Baldwin Date: Fri, 14 Apr 2017 18:49:56 -0700 (PDT) CC: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 01:49:57 -0000 > On Friday, April 14, 2017 07:41:48 PM Ngie Cooper wrote: > > Author: ngie > > Date: Fri Apr 14 19:41:48 2017 > > New Revision: 316938 > > URL: https://svnweb.freebsd.org/changeset/base/316938 > > > > Log: > > savecore: fix space calculation with respect to `minfree` in check_space(..) > > > > - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > > representable data to INT_MAX. Check the values received from > > strtoll(3), trimming trailing whitespace off the end to maintain > > POLA. > > - Use `KiB` instead of `kB` when describing free space, total space, > > etc. I am now fully aware of `KiB` being the IEC standard for 1024 > > bytes and `kB` being the IEC standard for 1000 bytes. > > I will just rant lightly that no one actually uses this in the real world. > > Good lucking finding a "16 GiB" DIMM on crucial.com or a 4Kin drive. A > kilobyte is a power of 2. The End. > > (Next up we'll have to rename 4k displays to > 4k) Do we use KiB, MiB, GiB,... any place else in the system? I cant think of a place we do this, so please, lets not start doing this here? Yes, these are newer standards, perhaps some day we should make a global switch to them, but lets not start mixing and matching things. > -- > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 01:52:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9C33D3DA46; Sat, 15 Apr 2017 01:52:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8FA7D7F; Sat, 15 Apr 2017 01:52:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F1qnYm057933; Sat, 15 Apr 2017 01:52:49 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F1qnk4057932; Sat, 15 Apr 2017 01:52:49 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201704150152.v3F1qnk4057932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 15 Apr 2017 01:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316950 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 01:52:51 -0000 Author: sjg Date: Sat Apr 15 01:52:49 2017 New Revision: 316950 URL: https://svnweb.freebsd.org/changeset/base/316950 Log: Update to latest, handle case of __objdir=obj Modified: head/share/mk/auto.obj.mk Modified: head/share/mk/auto.obj.mk ============================================================================== --- head/share/mk/auto.obj.mk Sat Apr 15 01:44:45 2017 (r316949) +++ head/share/mk/auto.obj.mk Sat Apr 15 01:52:49 2017 (r316950) @@ -58,7 +58,10 @@ __objdir_made != echo ${__objdir}/; umas # This causes make to use the specified directory as .OBJDIR .OBJDIR: ${__objdir} .if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != "" +# watch out for __objdir being relative path +.if !(${__objdir:M/*} == "" && ${.OBJDIR:tA} == ${${.CURDIR}/${__objdir}:L:tA}) .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif .endif .endif +.endif From owner-svn-src-all@freebsd.org Sat Apr 15 01:55:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65EFAD3DB3F; Sat, 15 Apr 2017 01:55:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 508B9F94; Sat, 15 Apr 2017 01:55:41 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F1temm009310; Fri, 14 Apr 2017 18:55:40 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F1teNW009309; Fri, 14 Apr 2017 18:55:40 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150155.v3F1teNW009309@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316945 - in head: etc/defaults etc/periodic/daily share/man/man5 In-Reply-To: <201704142259.v3EMxEAa083233@repo.freebsd.org> To: Alan Somers Date: Fri, 14 Apr 2017 18:55:40 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 01:55:42 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: asomers > Date: Fri Apr 14 22:59:14 2017 > New Revision: 316945 > URL: https://svnweb.freebsd.org/changeset/base/316945 > > Log: > Add 410.status-mfi, a periodic script for mfi(4) arrays > > PR: 176049 > Submitted by: doconnor@gsoft.com.au > Reviewed by: scottl, Larry Rosenman > MFC after: 3 weeks > Relnotes: yes > > Added: > head/etc/periodic/daily/410.status-mfi (contents, props changed) > Modified: > head/etc/defaults/periodic.conf > head/etc/periodic/daily/Makefile > head/share/man/man5/periodic.conf.5 > > Modified: head/etc/defaults/periodic.conf > ============================================================================== > --- head/etc/defaults/periodic.conf Fri Apr 14 22:02:08 2017 (r316944) > +++ head/etc/defaults/periodic.conf Fri Apr 14 22:59:14 2017 (r316945) > @@ -112,6 +112,9 @@ daily_status_gstripe_enable="NO" # Che > # 409.status-gconcat > daily_status_gconcat_enable="NO" # Check gconcat(8) > > +# 410.status-mfi > +daily_status_mfi_enable="NO" # Check mfiutil(8) > + > # 420.status-network > daily_status_network_enable="YES" # Check network status > daily_status_network_usedns="YES" # DNS lookups are ok > > Added: head/etc/periodic/daily/410.status-mfi > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/periodic/daily/410.status-mfi Fri Apr 14 22:59:14 2017 (r316945) > @@ -0,0 +1,33 @@ > +#!/bin/sh > +# > +# $FreeBSD$ > +# > + > +# If there is a global system configuration file, suck it in. > +# > +if [ -r /etc/defaults/periodic.conf ] > +then > + . /etc/defaults/periodic.conf > + source_periodic_confs > +fi > + > +case "$daily_status_mfi_enable" in > + [Yy][Ee][Ss]) > + echo > + echo 'Checking status of mfi(4) devices:' > + > + if mfiutil show volumes; then > + if mfiutil show volumes | grep -q DEGRADED; then > + rc=3 > + else > + rc=0 > + fi > + else > + rc=2 > + fi > + ;; > + > + *) rc=0;; > +esac > + > +exit $rc > > Modified: head/etc/periodic/daily/Makefile > ============================================================================== > --- head/etc/periodic/daily/Makefile Fri Apr 14 22:02:08 2017 (r316944) > +++ head/etc/periodic/daily/Makefile Fri Apr 14 22:59:14 2017 (r316945) > @@ -13,6 +13,7 @@ FILES= 100.clean-disks \ > 400.status-disks \ > 401.status-graid \ > 406.status-gmirror \ > + 410.status-mfi \ > 407.status-graid3 \ > 408.status-gstripe \ > 409.status-gconcat \ Insered into the middle of a number sorted list? > > Modified: head/share/man/man5/periodic.conf.5 > ============================================================================== > --- head/share/man/man5/periodic.conf.5 Fri Apr 14 22:02:08 2017 (r316944) > +++ head/share/man/man5/periodic.conf.5 Fri Apr 14 22:59:14 2017 (r316945) > @@ -399,6 +399,15 @@ if you want to run > on your > .Xr gconcat 8 > devices. > +.It Va daily_status_mfi_enable > +.Pq Vt bool > +Set to > +.Dq Li YES > +if you want to run > +.Nm mfiutil Cm status > +on your > +.Xr mfi 4 > +devices. > .It Va daily_status_network_enable > .Pq Vt bool > Set to > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 01:59:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F2B1D3DBF4 for ; Sat, 15 Apr 2017 01:59:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E5C715A; Sat, 15 Apr 2017 01:59:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F1xd5k009326; Fri, 14 Apr 2017 18:59:39 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F1xd0q009325; Fri, 14 Apr 2017 18:59:39 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150159.v3F1xd0q009325@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: To: Larry Rosenman Date: Fri, 14 Apr 2017 18:59:39 -0700 (PDT) CC: rgrimes@freebsd.org, "Ngie Cooper (yaneurabeya)" , "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ngie Cooper Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 01:59:50 -0000 > On 4/14/17, 8:35 PM, "Rodney W. Grimes" wrote: > > > Yeah, I have the following: > > borg.lerctr.org /home/ler $ swapctl -l > > Device: 1024-blocks Used: > > /dev/mfid0p3 8388608 0 > > /dev/mfid1p3 8388608 0 > > /dev/mfid2p3 8388608 0 > > /dev/mfid3p3 8388608 0 > > /dev/mfid4p3 8388608 0 > > /dev/mfid5p3 8388608 0 > > borg.lerctr.org /home/ler $ sysctl hw.physmem > > hw.physmem: 137368682496 > > borg.lerctr.org /home/ler $ > > > > SO 6 8G partitions (48G), but the dump is larger than 8G. > > Larry, > This is a very good concern and point given todays more > common huge memory foot prints and lots of spindles. I'll > keep this in they back of my mind as I tromp around in the > dump code. I have another solution that may work for you > and that is to use Netdump rather than swapdump. This > basically eliminates the trip to swap space and you end > up going to savecore style output on the netdump server. > > -- > Rod Grimes rgrimes@freebsd.org > > What does it take for NetDump to work to a FreeNAS (9.10 nightly) server since that?s what is ?next to? this server? As a netdump server FreeNAS would be fairly trivial to compile the netdump client code for. I should have running 11.0 and 10.2 code around some place. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 02:00:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45C59D3DD07; Sat, 15 Apr 2017 02:00:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6C0C32C; Sat, 15 Apr 2017 02:00:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f52.google.com with SMTP id y18so2967620wmh.0; Fri, 14 Apr 2017 19:00:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=2t/rMT2428TW1GPxzTB7NyVngexKkxSCH6edOxr82/E=; b=dg3QOPleFI3Ln6glsthEkhrn3rOuXB+T1n1LywZVjqdy+jP71uHVsJEoxV5B+JMuHL 0Gr8AYSgNG3ldEOKPe8//ytyY3GQpjf6BdoQiQqBmr3oaNuAPTxeqMpK3nreVZP/HvRa qKkdglaOSJXQSWw1ko+gPR3aFCU++LC2MSt1Q78FVqiQ5uwKiFRfO0ts/0BavryvK5GO KmfhvDjjxhdPeEZWSADhzHEYdVn5SpARFVPjb/oL+DzmP9KtxPZcndryXBs9vs3EQ+Yi iOZ7U8B4TPuGO7kFZX5jE3CVmLCB/XNyTR8e5hDXH2CjONiNJ4BBKIcvcEYrB/Si4Wqc 1a0Q== X-Gm-Message-State: AN3rC/6/Zvs75QUYdLvMtCvl8eV2OI9zl2LV+/lGT7ufP8gKqJNbp35a riow2YQgXXE91c4nfquaww== X-Received: by 10.28.55.138 with SMTP id e132mr866602wma.6.1492221637685; Fri, 14 Apr 2017 19:00:37 -0700 (PDT) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com. [74.125.82.52]) by smtp.gmail.com with ESMTPSA id c53sm4499301wra.16.2017.04.14.19.00.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 19:00:37 -0700 (PDT) Received: by mail-wm0-f52.google.com with SMTP id y18so2967612wmh.0; Fri, 14 Apr 2017 19:00:37 -0700 (PDT) X-Received: by 10.28.130.210 with SMTP id e201mr849620wmd.128.1492221637431; Fri, 14 Apr 2017 19:00:37 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Fri, 14 Apr 2017 19:00:36 -0700 (PDT) In-Reply-To: References: <201704150135.v3F1ZD2S009211@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Fri, 14 Apr 2017 19:00:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316938 - head/sbin/savecore To: Larry Rosenman Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Ngie Cooper Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:00:46 -0000 Larry, You just need to run netdumpd on the nearby server. It could be a port (although I'm not aware that it is ported yet). Best, Conrad On Fri, Apr 14, 2017 at 6:37 PM, Larry Rosenman wrote: > On 4/14/17, 8:35 PM, "Rodney W. Grimes" = wrote: > >> Yeah, I have the following: > > borg.lerctr.org /home/ler $ swapctl -l > > Device: 1024-blocks Used: > > /dev/mfid0p3 8388608 0 > > /dev/mfid1p3 8388608 0 > > /dev/mfid2p3 8388608 0 > > /dev/mfid3p3 8388608 0 > > /dev/mfid4p3 8388608 0 > > /dev/mfid5p3 8388608 0 > > borg.lerctr.org /home/ler $ sysctl hw.physmem > > hw.physmem: 137368682496 > > borg.lerctr.org /home/ler $ > > > > SO 6 8G partitions (48G), but the dump is larger than 8G. > > Larry, > This is a very good concern and point given todays more > common huge memory foot prints and lots of spindles. I'll > keep this in they back of my mind as I tromp around in the > dump code. I have another solution that may work for you > and that is to use Netdump rather than swapdump. This > basically eliminates the trip to swap space and you end > up going to savecore style output on the netdump server. > > -- > Rod Grimes rgrimes@fr= eebsd.org > > What does it take for NetDump to work to a FreeNAS (9.10 nightly) server = since that=E2=80=99s what is =E2=80=9Cnext to=E2=80=9D this server? > > > From owner-svn-src-all@freebsd.org Sat Apr 15 02:01:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 169E3D3DEAC; Sat, 15 Apr 2017 02:01:25 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E69887DA; Sat, 15 Apr 2017 02:01:24 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-transfer-encoding:Content-type:Mime-version:In-Reply-To: References:Message-ID:CC:To:From:Subject:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=IgKwWs3WbrGru2Zbg7jp+axhpaw1ZDg3hn9ZKvUvhyI=; b=SzcqLUPlRlo+RlG4JxFrau1y6U eH7SKzi8HjbsMRPxrnptf+VQW8hYetj3VRKMsIQlthCCtzg7s1X59uD+gtKcuaGtFGRaFjTfcpsso VZG5rk/HbYfjH5rE9ogbfXYG+PqrkmUUGvLdTHym8zG7TuZ6wDTK00jSPdM9LGna5sDM=; Received: from [47.220.164.50] (port=12168 helo=[192.168.200.198]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1czD1f-0002Dn-UQ; Fri, 14 Apr 2017 21:01:24 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Fri, 14 Apr 2017 21:01:22 -0500 Subject: Re: svn commit: r316938 - head/sbin/savecore From: Larry Rosenman To: CC: "Ngie Cooper (yaneurabeya)" , "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ngie Cooper Message-ID: <1920E973-DAB4-447D-B578-274288C251FF@lerctr.org> Thread-Topic: svn commit: r316938 - head/sbin/savecore References: <201704150159.v3F1xd0q009325@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201704150159.v3F1xd0q009325@pdx.rh.CN85.dnsmgr.net> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:01:25 -0000 On 4/14/17, 8:59 PM, "Rodney W. Grimes" wr= ote: > On 4/14/17, 8:35 PM, "Rodney W. Grimes" wrote: >=20 > > Yeah, I have the following: > > borg.lerctr.org /home/ler $ swapctl -l > > Device: 1024-blocks Used: > > /dev/mfid0p3 8388608 0 > > /dev/mfid1p3 8388608 0 > > /dev/mfid2p3 8388608 0 > > /dev/mfid3p3 8388608 0 > > /dev/mfid4p3 8388608 0 > > /dev/mfid5p3 8388608 0 > > borg.lerctr.org /home/ler $ sysctl hw.physmem > > hw.physmem: 137368682496 > > borg.lerctr.org /home/ler $ > >=20 > > SO 6 8G partitions (48G), but the dump is larger than 8G.=20 > =20 > Larry, > This is a very good concern and point given todays more > common huge memory foot prints and lots of spindles. I'll > keep this in they back of my mind as I tromp around in the > dump code. I have another solution that may work for you > and that is to use Netdump rather than swapdump. This > basically eliminates the trip to swap space and you end > up going to savecore style output on the netdump server. > =20 > --=20 > Rod Grimes rgrime= s@freebsd.org > =20 > What does it take for NetDump to work to a FreeNAS (9.10 nightly) ser= ver since that?s what is ?next to? this server? =20 =20 As a netdump server FreeNAS would be fairly trivial to compile the netd= ump client code for. I should have running 11.0 and 10.2 code around some place. =20 --=20 Rod Grimes rgrimes@free= bsd.org =20 I=E2=80=99m also running: borg.lerctr.org /home/ler $ uname -a FreeBSD borg.lerctr.org 12.0-CURRENT FreeBSD 12.0-CURRENT #23 r316945: Fri = Apr 14 18:37:13 CDT 2017 root@borg.lerctr.org:/usr/obj/usr/src/sys/VT-LE= R amd64 borg.lerctr.org /home/ler $ From owner-svn-src-all@freebsd.org Sat Apr 15 02:02:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DD0BD3E0FC; Sat, 15 Apr 2017 02:02:06 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1453AB0; Sat, 15 Apr 2017 02:02:06 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-transfer-encoding:Content-type:Mime-version:In-Reply-To: References:Message-ID:CC:To:From:Subject:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=yY/+NQmGvceB/o+TcZiQAnA9wHZtoFo5rJaLwKZ2acA=; b=Sp81T0cEwxfC3E7kM5bLo4S+eG CzAWT4Oc7N2u2QbtRKbL8/D1I2L40zjA4vSKpCx0twmAliV+u+HJvoAE4mVF7up/iSX6TCJfNrbRy 16P5uuHLnRwmYkclO++bWjeJyrRrj5gGfL08HmmjkhOGkEbHsFr1YsZAYLHmO0hM8UQo=; Received: from [47.220.164.50] (port=12168 helo=[192.168.200.198]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1czD2L-0002Dn-UZ; Fri, 14 Apr 2017 21:02:06 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Fri, 14 Apr 2017 21:02:05 -0500 Subject: Re: svn commit: r316938 - head/sbin/savecore From: Larry Rosenman To: CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Ngie Cooper Message-ID: <263DC438-1846-47D8-BB10-AC2E46FD4D56@lerctr.org> Thread-Topic: svn commit: r316938 - head/sbin/savecore References: <201704150135.v3F1ZD2S009211@pdx.rh.CN85.dnsmgr.net> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:02:07 -0000 It looked like the netdump code might need some stuff for current =E2=80=93CURREN= T.=20 --=20 Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281 =20 =20 On 4/14/17, 9:00 PM, "Conrad Meyer" wrote: Larry, =20 You just need to run netdumpd on the nearby server. It could be a port (although I'm not aware that it is ported yet). =20 Best, Conrad =20 On Fri, Apr 14, 2017 at 6:37 PM, Larry Rosenman wrote: > On 4/14/17, 8:35 PM, "Rodney W. Grimes" wrote: > >> Yeah, I have the following: > > borg.lerctr.org /home/ler $ swapctl -l > > Device: 1024-blocks Used: > > /dev/mfid0p3 8388608 0 > > /dev/mfid1p3 8388608 0 > > /dev/mfid2p3 8388608 0 > > /dev/mfid3p3 8388608 0 > > /dev/mfid4p3 8388608 0 > > /dev/mfid5p3 8388608 0 > > borg.lerctr.org /home/ler $ sysctl hw.physmem > > hw.physmem: 137368682496 > > borg.lerctr.org /home/ler $ > > > > SO 6 8G partitions (48G), but the dump is larger than 8G. > > Larry, > This is a very good concern and point given todays more > common huge memory foot prints and lots of spindles. I'll > keep this in they back of my mind as I tromp around in the > dump code. I have another solution that may work for you > and that is to use Netdump rather than swapdump. This > basically eliminates the trip to swap space and you end > up going to savecore style output on the netdump server. > > -- > Rod Grimes rgrime= s@freebsd.org > > What does it take for NetDump to work to a FreeNAS (9.10 nightly) ser= ver since that=E2=80=99s what is =E2=80=9Cnext to=E2=80=9D this server? > > > =20 From owner-svn-src-all@freebsd.org Sat Apr 15 02:05:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF276D3E1E9; Sat, 15 Apr 2017 02:05:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A74F4CA4; Sat, 15 Apr 2017 02:05:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F251t7009389; Fri, 14 Apr 2017 19:05:01 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F251PX009388; Fri, 14 Apr 2017 19:05:01 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150205.v3F251PX009388@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <201704150159.v3F1xd0q009325@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Fri, 14 Apr 2017 19:05:01 -0700 (PDT) CC: Larry Rosenman , "Ngie Cooper (yaneurabeya)" , "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ngie Cooper Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:05:07 -0000 > > On 4/14/17, 8:35 PM, "Rodney W. Grimes" wrote: > > > > > Yeah, I have the following: > > > borg.lerctr.org /home/ler $ swapctl -l > > > Device: 1024-blocks Used: > > > /dev/mfid0p3 8388608 0 > > > /dev/mfid1p3 8388608 0 > > > /dev/mfid2p3 8388608 0 > > > /dev/mfid3p3 8388608 0 > > > /dev/mfid4p3 8388608 0 > > > /dev/mfid5p3 8388608 0 > > > borg.lerctr.org /home/ler $ sysctl hw.physmem > > > hw.physmem: 137368682496 > > > borg.lerctr.org /home/ler $ > > > > > > SO 6 8G partitions (48G), but the dump is larger than 8G. > > > > Larry, > > This is a very good concern and point given todays more > > common huge memory foot prints and lots of spindles. I'll > > keep this in they back of my mind as I tromp around in the > > dump code. I have another solution that may work for you > > and that is to use Netdump rather than swapdump. This > > basically eliminates the trip to swap space and you end > > up going to savecore style output on the netdump server. > > > > -- > > Rod Grimes rgrimes@freebsd.org > > > > What does it take for NetDump to work to a FreeNAS (9.10 nightly) server since that?s what is ?next to? this server? > > As a netdump server FreeNAS would be fairly trivial to compile the netdump > client code for. I should have running 11.0 and 10.2 code around > some place. You know, maybe we should get the client side code pushed in, that has been stable and not stomped on by other changes and is usable for those of us who have kernels that can do netdump. It is a fairly simple daemon that listens on a socket and stores the dumps. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 02:16:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06EA5D3E4EF; Sat, 15 Apr 2017 02:16:16 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92CD9279; Sat, 15 Apr 2017 02:16:15 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f51.google.com with SMTP id o81so3764983wmb.1; Fri, 14 Apr 2017 19:16:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=mjPqNTvtFsKYZEqjZMOx+i3hywXCIHlEwZT0swO21fU=; b=rhRq6RIt4aM/P4LsXvaICTyC530jTK9Tqd2+RFQOuk/dLKe4YpP/Bt2jLMRrqxYT1U dTXmXyaOuHFHpGEBsi42z9Z3bK55PoKr4+HAHReHOPFZ48GX7MjKxxcOZ1QkVPdHK78o z0MET4E4wf6mKeT79THLXFSFGqIy9wxt90RbPRo3L5nkzVcFueNGmO7LzoSBG9sCBkGO z5396unxTaxh4R2fvDSIzzZp/A8Pu+Ung6ZRjL2Z3LDPybUGB8fX1PXw3VyLr15ZyMd0 S6FlV3eoxSP36hHa3WblLyv9nvasvAdZfpjj2kF2Fc6+98bcM9Bcac6/fRl3L5UivRKD nV2g== X-Gm-Message-State: AN3rC/5Z0fGOVLYgwl1OA8JnWeunDXqAA1ug4zvidCwbAJXGuoYDOvWz 9g02RgqVh1JmzulN2W8V/Q== X-Received: by 10.28.10.70 with SMTP id 67mr904228wmk.131.1492222572960; Fri, 14 Apr 2017 19:16:12 -0700 (PDT) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com. [74.125.82.44]) by smtp.gmail.com with ESMTPSA id 13sm709634wmt.22.2017.04.14.19.16.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 19:16:12 -0700 (PDT) Received: by mail-wm0-f44.google.com with SMTP id u2so3586746wmu.0; Fri, 14 Apr 2017 19:16:12 -0700 (PDT) X-Received: by 10.28.111.134 with SMTP id c6mr890207wmi.128.1492222572740; Fri, 14 Apr 2017 19:16:12 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Fri, 14 Apr 2017 19:16:11 -0700 (PDT) In-Reply-To: <263DC438-1846-47D8-BB10-AC2E46FD4D56@lerctr.org> References: <201704150135.v3F1ZD2S009211@pdx.rh.CN85.dnsmgr.net> <263DC438-1846-47D8-BB10-AC2E46FD4D56@lerctr.org> From: Conrad Meyer Date: Fri, 14 Apr 2017 19:16:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316938 - head/sbin/savecore To: Larry Rosenman Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Ngie Cooper Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:16:16 -0000 On Fri, Apr 14, 2017 at 7:02 PM, Larry Rosenman wrote: > It looked like the netdump code might need some stuff for current =E2=80= =93CURRENT. Not for the server (netdumpd) =E2=80=94 it's just a simple UDP daemon that writes incoming UDP streams to disk. Best, Conrad From owner-svn-src-all@freebsd.org Sat Apr 15 02:17:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35EF6D3E55F; Sat, 15 Apr 2017 02:17:14 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 123475FB; Sat, 15 Apr 2017 02:17:14 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-transfer-encoding:Content-type:Mime-version:In-Reply-To: References:Message-ID:CC:To:From:Subject:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WJFQVbDZVf+KQH8uKj/pbR2SLYvvu0nWSe4jyCW/1WA=; b=EoEwVXxf3ncl/nl/wnF6UGopyG 4ki4cbAhSqJy6jKreOiPVyhXcFNGRO7I8Xpjx5N1K0fP9cpqp4CVg3afWiEKsj11zKziX9LmXl2fL iQkhx2sLfrTw/BiR5y1vfaxkAdXFz8AqcW9F1jzS1fLkioz/FGStoJlbEkY4sYkyXSvs=; Received: from [47.220.164.50] (port=36695 helo=[192.168.200.198]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1czDGz-0002cy-Du; Fri, 14 Apr 2017 21:17:13 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Fri, 14 Apr 2017 21:17:13 -0500 Subject: Re: svn commit: r316938 - head/sbin/savecore From: Larry Rosenman To: CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Ngie Cooper Message-ID: <5E527867-0C83-4CA5-8228-23A72B914F10@lerctr.org> Thread-Topic: svn commit: r316938 - head/sbin/savecore References: <201704150135.v3F1ZD2S009211@pdx.rh.CN85.dnsmgr.net> <263DC438-1846-47D8-BB10-AC2E46FD4D56@lerctr.org> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:17:14 -0000 On 4/14/17, 9:16 PM, "Conrad Meyer" wrote: On Fri, Apr 14, 2017 at 7:02 PM, Larry Rosenman wrote: > It looked like the netdump code might need some stuff for current =E2=80=93= CURRENT. =20 Not for the server (netdumpd) =E2=80=94 it's just a simple UDP daemon that writes incoming UDP streams to disk. =20 Best, Conrad =20 I was referring to the code to actually dump to netdumpd. From owner-svn-src-all@freebsd.org Sat Apr 15 02:21:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21830D3E6A9; Sat, 15 Apr 2017 02:21:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B18BD958; Sat, 15 Apr 2017 02:21:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f52.google.com with SMTP id w64so3814577wma.0; Fri, 14 Apr 2017 19:21:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=jcu6uWzM5KSUxLK24bczoDNuf1ay1cNkkc5NmebYBOo=; b=Mt9va6yNqRgf3YUk8Ge41FgSWY7Rj8x8oHKKs6xd0OPPXuqYzOVZY6MhsQmssimAfa BkywmyTONPhfN4+PpsbnyddhLWr5jANuChNhGQjwpLv9yAc4JvEjRI+J0igU6Sh5kfWM YaXa495fhpnCJcsc1fZl30ziFTrQ9QZXx5QUkboy13gaMhPUGbJKav3hSPNRTZ6l2Div 185SVgLzEn7tuxs9UrWeLT5lZIYXEy0xxxp4pIKEOgSGUE4nImeKSOTP9LsawbMxFxnA 32ic3Kqdh+G9y4B8hez7gMC8rlqNTirK2HKUyij6e7mtaJZAT0cUdiwmN0GBRamACuMP GgbA== X-Gm-Message-State: AN3rC/6cbXi2V+3aelX3r4tLCKo1VKXlRDm1ruYewh0LqkWbbpbJ7hOH GlIRu/kzzSlUODgJwkhV2Q== X-Received: by 10.28.178.17 with SMTP id b17mr892226wmf.23.1492222905137; Fri, 14 Apr 2017 19:21:45 -0700 (PDT) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com. [74.125.82.51]) by smtp.gmail.com with ESMTPSA id l19sm4512417wre.2.2017.04.14.19.21.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 19:21:45 -0700 (PDT) Received: by mail-wm0-f51.google.com with SMTP id o81so3801060wmb.1; Fri, 14 Apr 2017 19:21:44 -0700 (PDT) X-Received: by 10.28.211.73 with SMTP id k70mr917338wmg.0.1492222904846; Fri, 14 Apr 2017 19:21:44 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Fri, 14 Apr 2017 19:21:44 -0700 (PDT) In-Reply-To: <5E527867-0C83-4CA5-8228-23A72B914F10@lerctr.org> References: <201704150135.v3F1ZD2S009211@pdx.rh.CN85.dnsmgr.net> <263DC438-1846-47D8-BB10-AC2E46FD4D56@lerctr.org> <5E527867-0C83-4CA5-8228-23A72B914F10@lerctr.org> From: Conrad Meyer Date: Fri, 14 Apr 2017 19:21:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316938 - head/sbin/savecore To: Larry Rosenman Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Ngie Cooper Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:21:48 -0000 That has not actually been committed yet. Mark Johnston has a patch for it= . On Fri, Apr 14, 2017 at 7:17 PM, Larry Rosenman wrote: > > On 4/14/17, 9:16 PM, "Conrad Meyer" wrote: > > On Fri, Apr 14, 2017 at 7:02 PM, Larry Rosenman wrot= e: > > It looked like the netdump code might need some stuff for current = =E2=80=93CURRENT. > > Not for the server (netdumpd) =E2=80=94 it's just a simple UDP daemon= that > writes incoming UDP streams to disk. > > Best, > Conrad > > > I was referring to the code to actually dump to netdumpd. > > > From owner-svn-src-all@freebsd.org Sat Apr 15 02:24:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7770D3E894; Sat, 15 Apr 2017 02:24:23 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80B85C55; Sat, 15 Apr 2017 02:24:23 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F2OMV9070093; Sat, 15 Apr 2017 02:24:22 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F2OMQq070092; Sat, 15 Apr 2017 02:24:22 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201704150224.v3F2OMQq070092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 15 Apr 2017 02:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316951 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:24:23 -0000 Author: sobomax Date: Sat Apr 15 02:24:22 2017 New Revision: 316951 URL: https://svnweb.freebsd.org/changeset/base/316951 Log: Since shutdown(2) on datagram socket is no longer a NOP after rev 316874 don't bother to select/recv on that socket. This prevents syslogd(8) from spinning endlessly when started with the -s option (default). Reported by: peter Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Apr 15 01:52:49 2017 (r316950) +++ head/usr.sbin/syslogd/syslogd.c Sat Apr 15 02:24:22 2017 (r316951) @@ -702,7 +702,7 @@ main(int argc, char *argv[]) sizeof(fd_mask)); STAILQ_FOREACH(sl, &shead, next) { - if (sl->sl_socket != -1) + if (sl->sl_socket != -1 && sl->sl_recv != NULL) FD_SET(sl->sl_socket, fdsr); } i = select(fdsrmax + 1, fdsr, NULL, NULL, @@ -2877,6 +2877,7 @@ socksetup(struct peer *pe) struct addrinfo hints, *res, *res0; int error; char *cp; + int (*sl_recv)(struct socklist *); /* * We have to handle this case for backwards compatibility: * If there are two (or more) colons but no '[' and ']', @@ -3003,6 +3004,7 @@ socksetup(struct peer *pe) } dprintf("new socket fd is %d\n", s); listen(s, 5); + sl_recv = socklist_recv_sock; dprintf("shutdown\n"); if (SecureMode || res->ai_family == AF_LOCAL) { /* Forbid communication in secure mode. */ @@ -3013,13 +3015,14 @@ socksetup(struct peer *pe) die(0); } dprintf("listening on socket\n"); + sl_recv = NULL; } else dprintf("sending on socket\n"); addsock(res->ai_addr, res->ai_addrlen, &(struct socklist){ .sl_socket = s, .sl_peer = pe, - .sl_recv = socklist_recv_sock + .sl_recv = sl_recv }); } freeaddrinfo(res0); From owner-svn-src-all@freebsd.org Sat Apr 15 02:25:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF28AD3E912; Sat, 15 Apr 2017 02:25:19 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yw0-x241.google.com (mail-yw0-x241.google.com [IPv6:2607:f8b0:4002:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D8E5DAE; Sat, 15 Apr 2017 02:25:19 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yw0-x241.google.com with SMTP id 203so6904738ywk.3; Fri, 14 Apr 2017 19:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=svkWcF/LSWA6FNC6mkNgSpF8aW1CiUQJFzayvdkdE1s=; b=Y/lhJbNRlNNTsvUoTOg3RiazXW1XL3kf2KhlwsrjmAoGZvCpwK9GiJnFFc1N7cUi58 j8aL/20oS4AB//e+MA5CpNDx4BWEjnVtiYQd+Oij7qLyQfURR2zc6iMTQBSrd8m5Xlhi wF5q8Re3R/S8yPhup9uPecJ6R2iB5VuJ9nDNOtNL2OLwK/3+NgWmOyYOg2RWWeWvV/yh hPa9gUKP+T5kEeKiktaFDdRf19OGS2qE8sAVWGMWGT4+qM74U7KUcLOjexAdR4FIdSW8 q1y8kn/BJJRsieusK/cMoOTj4eZ7zyjEGiHhz7h66+CGRclD9DZ55t251dWSvWwx2Do3 3z8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=svkWcF/LSWA6FNC6mkNgSpF8aW1CiUQJFzayvdkdE1s=; b=AqVoq3MCye3Z/auKMc7ggYvxypUq81WhKoJyHroPbFfi/Je4Drywk8aJpQ1/RuVPEQ sVhmw2kCKJpw6nVirLZSDkEopLCn17pdP6cCwaMN2eZvhngsB7Vg6mpI4sL2YJb+8ntp vfnkWk76G1+6Z1sSmcdudIO2n6H3LZeKVp9K+ne48rMl1TVK/cEUSyxfrnooM+btkzKS kQN1Mipj0wMRz6RP2r6ilF1XFkNJze/RSVkBqiteeEBZZnm0hgdS2uo1kWW0qw72uFmN r1wrSmegHoUQY8VJ3a1Dfd8hgzP/AzoFeOi5JxPts634hWyBPMD0UlQB9WjFOlKCgl87 XpAQ== X-Gm-Message-State: AN3rC/5xSaio2cdMHNauJlPPIb9DwBA5F7P4Y51MtJhyYUBBJ0ZkDscH eA94vCK2R1NHu2fRshGoVMJMFQpIoCoJpy0= X-Received: by 10.13.223.134 with SMTP id i128mr8029213ywe.117.1492223118479; Fri, 14 Apr 2017 19:25:18 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.20.214 with HTTP; Fri, 14 Apr 2017 19:25:18 -0700 (PDT) In-Reply-To: <201704150155.v3F1teNW009309@pdx.rh.CN85.dnsmgr.net> References: <201704142259.v3EMxEAa083233@repo.freebsd.org> <201704150155.v3F1teNW009309@pdx.rh.CN85.dnsmgr.net> From: Alan Somers Date: Fri, 14 Apr 2017 20:25:18 -0600 X-Google-Sender-Auth: n9fFYu7UOWSlL-HaZiOmk-ogngI Message-ID: Subject: Re: svn commit: r316945 - in head: etc/defaults etc/periodic/daily share/man/man5 To: rgrimes@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:25:19 -0000 On Fri, Apr 14, 2017 at 7:55 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: asomers >> Date: Fri Apr 14 22:59:14 2017 >> New Revision: 316945 >> URL: https://svnweb.freebsd.org/changeset/base/316945 >> >> Log: >> Add 410.status-mfi, a periodic script for mfi(4) arrays >> >> PR: 176049 >> Submitted by: doconnor@gsoft.com.au >> Reviewed by: scottl, Larry Rosenman >> MFC after: 3 weeks >> Relnotes: yes >> >> Added: >> head/etc/periodic/daily/410.status-mfi (contents, props changed) >> Modified: >> head/etc/defaults/periodic.conf >> head/etc/periodic/daily/Makefile >> head/share/man/man5/periodic.conf.5 >> >> Modified: head/etc/periodic/daily/Makefile >> ============================================================================== >> --- head/etc/periodic/daily/Makefile Fri Apr 14 22:02:08 2017 (r316944) >> +++ head/etc/periodic/daily/Makefile Fri Apr 14 22:59:14 2017 (r316945) >> @@ -13,6 +13,7 @@ FILES= 100.clean-disks \ >> 400.status-disks \ >> 401.status-graid \ >> 406.status-gmirror \ >> + 410.status-mfi \ >> 407.status-graid3 \ >> 408.status-gstripe \ >> 409.status-gconcat \ > > Insered into the middle of a number sorted list? Mea culpa. Already fixed in r316946. > Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 02:32:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E73B8D3EB14; Sat, 15 Apr 2017 02:32:38 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C90ED1F5; Sat, 15 Apr 2017 02:32:38 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 52AA14E1; Fri, 14 Apr 2017 19:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1492223558; bh=+oGZTFoQn2TkAKJP/d4Kr4khMczEO+XEnmZQb8Q/WWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WrDEOdybLm4i1tJ7+JYBFallGREa/0MiYHQv8symN+0X1XN7SPkc1Vvg5jO7V9nLx fmsGhZciFd2JuLjwwO+uMbeM9+hOA6+1QDSs8bBb2mVE7ghpnIyIuKpTa8X3wXQBs9 WC5NO0valg/3/PP6WriK+RCGT+Sg0Znk34ZuW4fg= From: Peter Wemm To: Maxim Sobolev Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Hiren Panchasara Subject: Re: svn commit: r316874 - head/sys/kern Date: Fri, 14 Apr 2017 19:32:33 -0700 Message-ID: <6546471.KH0i3bg3hj@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <6942092.OsECkgAp13@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2010007.ntouo2SN7c"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:32:39 -0000 --nextPart2010007.ntouo2SN7c Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday, April 14, 2017 02:21:05 PM Maxim Sobolev wrote: > Peter, It is actually the other way around. If you take syslogd code = out of > 11-stable and earlier that would work just fine with or without r3168= 74. > But since r285910 syslogd in head had been refactored a lot and I thi= nk > that particular bug has introduced that has been masked by the shutdo= wn() > on datagram sockets becoming a NOP after r285910. Then r316874 restor= ed our > historical behavior for the shutdown(2) and bingo, bug in the new sys= logd > code is now causing it to spin when shutdown() !=3D NOP. >=20 > -Max Hmm, there's a new problem: 45104 auditd CALL socket(PF_LOCAL,0x10000002,0) 45104 auditd RET socket 3 45104 auditd CALL connect(0x3,0x7fffffffdbd8,0x6a) 45104 auditd STRU struct sockaddr { AF_LOCAL, /var/run/logpriv } 45104 auditd NAMI "/var/run/logpriv" 45104 auditd RET connect 0 45104 auditd CALL sendto(0x3,0x7fffffffe130,0x2f,0,0,0) 45104 auditd RET sendto -1 errno 55 No buffer space available 45104 auditd CALL open(0x800da5c67,0x100005) 45104 auditd NAMI "/dev/console" 45104 auditd RET open 4 .. and it all goes to /dev/console instead. On restarting syslogd: Apr 15 02:17:43 repoman2 syslogd: exiting on signal 15 sonewconn: pcb 0xfffff80051e72680: Listen queue overflow: 16 already in= queue=20 already Umm.. did the patch forget to listen to incoming connections or somethi= ng? I haven't seen this before anywhere except when syslogd is wedged. >=20 > On Fri, Apr 14, 2017 at 12:46 PM, Peter Wemm wrote: > > On Friday, April 14, 2017 12:41:52 PM Maxim Sobolev wrote: > > > Thanks, Peter. I will try to look into this asap. > >=20 > > I don't understand what is going on yet. Presumably there must be o= ther > > changes in play that affect udp/select sometime between the origina= l 2015 > > change and this. The syslogd -s code is Old(TM). I'm also wonderin= g > > whether > > the -s code even works at all since the 2015 / r285910 change... > >=20 > > > -Max > > >=20 > > > On Apr 14, 2017 12:32 PM, "Peter Wemm" wrote: > > > > On Friday, April 14, 2017 11:49:26 AM Peter Wemm wrote: > > > > > On Friday, April 14, 2017 05:23:28 PM Maxim Sobolev wrote: > > > > > > Author: sobomax > > > > > > Date: Fri Apr 14 17:23:28 2017 > > > > > > New Revision: 316874 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/316874 > > > > > >=20 > > > > > > Log: > > > > > > Restore ability to shutdown DGRAM sockets, still forcing > >=20 > > ENOTCONN to > >=20 > > > > be > > > >=20 > > > > > > returned by the shutdown(2) system call. This ability has b= een > >=20 > > lost as > >=20 > > > > > > part > > > > > > of the svn revision 285910. > > > > > >=20 > > > > > > Reviewed by: ed, rwatson, glebius, hiren > > > > > > MFC after: 2 weeks > > > > > > Differential Revision: https://reviews.freebsd.org/D10= 351 > > > > >=20 > > > > > This appears to have broken syslogd and had a major change in= > >=20 > > behavior > >=20 > > > > with > > > >=20 > > > > > regards to select(2). > > > > >=20 > > > > > If you run syslogd with the -s flag (which is default), it no= w spins > >=20 > > at > >=20 > > > > 100% > > > >=20 > > > > > cpu as all the shutdown sockets now return readable from sele= ct. > > > > >=20 > > > > > Old releases / jails also manifest this behavor. If it wasn'= t for > > > > > losing > > > > > the ability to run old branch binaries I'd suggest changing s= yslogd > > > > > instead, but we depend on this in the cluster and I expect ot= hers do > > > > > too. > > > > >=20 > > > > > I'm not 100% certain that this change is the culprit but a he= ads-up > > > > > can't > > > > > hurt. I'll try reverting it on the freebsd cluster next, afte= r > > > > > fixing > > > > > the > > > > > broken auditing changes. > > > > >=20 > > > > > -Peter > > > >=20 > > > > I can confirm that reverting r316874 fixes syslogd and backward= s > > > > compatability > > > > with old branches. > > > >=20 > > > > -- > > > > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc= .com; > > > > KI6FJV > > > > UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246= > >=20 > > -- > > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com= ; > > KI6FJV > > UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart2010007.ntouo2SN7c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAljxhkEACgkQNdaXCeyA ngSYuwgAiYaKQFKr1C2yjuahP9uc782BCIvuvn7w+Eb+WzfU966Jh87jQlmzswxT ukf1hVk96LPALs55NqX6Z1ZfZ2oa0YN92dZ1px0+AryrAx+CPpgYYe+2Yrf3vYHu i84Z6ZgZjPb0Uf5Nmk7l8ypWHNxvCHZoyJDvFzwFbMECVrur1r6gYY76M3YCR2UK xQsKIrypebjc8j0Qe+GPLCOpaibYXRSA0Vl63pyp05aEf9KVN5PWjwmlnRHFNSh3 DH6O5vucb5IugU88FVNoxBJX8LmoRy6JI/ewyuDphKgquu45gRxFffaTAsO9wG/Y fNr5yzkas9EbmwLaTjOiOsh6/u4Jyg== =KM3L -----END PGP SIGNATURE----- --nextPart2010007.ntouo2SN7c-- From owner-svn-src-all@freebsd.org Sat Apr 15 02:36:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 985DED3EBBB; Sat, 15 Apr 2017 02:36:55 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81FE63B0; Sat, 15 Apr 2017 02:36:55 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 4B8B94E7; Fri, 14 Apr 2017 19:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1492223815; bh=5h1T8H24HJ5mooEhKY2+WJVm9aCJPa9mIJnSn3W+RZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tzmIBOOzOLLPn8Bw6HAzR871jTUyb+7IGjpykGhuJ71E87inF6DkPsO9OJi/lw/KE tsG7jicKQT0/SUqf9XFxqkaM1bytkaQF55Q8ahKNf8OGFm5snLhVKaSXmEetQycAQY NDuSdyjIfeyXXLfczeKsE63soqDVfbRDLSEy1Wms= From: Peter Wemm To: "Ngie Cooper (yaneurabeya)" Cc: Maxim Sobolev , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Hiren Panchasara , Hiroki Sato Subject: Re: svn commit: r316874 - head/sys/kern Date: Fri, 14 Apr 2017 19:36:55 -0700 Message-ID: <13691757.t3s7Qik7v1@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201704141723.v3EHNS3B043902@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3238559.iu6D6HdEu8"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:36:55 -0000 --nextPart3238559.iu6D6HdEu8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday, April 14, 2017 02:14:16 PM Ngie Cooper wrote: > > On Apr 14, 2017, at 14:10, Maxim Sobolev wr= ote: > >=20 > > Peter, Ngie, > >=20 > > Looks like out of that refactoring came a logical bug that is prese= nt in > > the head, which causes syslod to first to shutdown the socket for r= eading > > and then try to select/recv on it (which is somewhat stupid). And t= hat > > issue has been masked by shutdown() on datagram socket becoming > > effectively a NOP in 11 & head 20 months ago. It only affects head > > though, 11-stable still has the old code which does not include tha= t > > half-closed socket into the select list. Attached patch is expected= to > > fix head, Peter, it would be nice if you can give it a try (restori= ng > > latest changes into uipc_sockets.c) and let me know if it helps. > >=20 > > Thanks! >=20 > CCing hrs@ for input as he did the refactoring. > Thanks! > -Ngie >=20 > PS LGTM with the change. Will wait for feedback from wemm@. This is definitely not working. I get ENOSPC and listen queue overflo= ws on=20 /var/run/logpriv now. Grabbing an old 10.3 /usr/sbin/syslogd and placing it on the top of the= 12.x=20 one worked fine, aside from the include statements. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart3238559.iu6D6HdEu8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAljxh0cACgkQNdaXCeyA ngTMEAf/ZfGz2aGu0L9XPstos2TSqePLeyPsBf0RNANU3vhgbFcKQzLtIV0GXaKs rpadYtXEpunawlbe/vzz//BQU14Acf5v65YmMxjMS78ZEI2atalwAyZLLVKs2uRg ehTlq3mH0DaPi2E7Fd5BxdzNX3QsO6WC8cJ6QVKD4THNlCvYbyHANtBY31FUrKf1 a6UfWauFO1V0AVwhV6Ooj1SjRmGLpENSxFhs/dfieb6khE40V/aSnY7ngaGEBq8B eZZk/8p6K8gS4L1cBN/0BmVSCOkQvtD0jAdAJmbts2Qbk2hVGTjAsr+dr47jMPjG huf95KmoT3toCJvWLcQP3Iid/q/BmA== =HNXh -----END PGP SIGNATURE----- --nextPart3238559.iu6D6HdEu8-- From owner-svn-src-all@freebsd.org Sat Apr 15 02:41:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D80ED3EE73; Sat, 15 Apr 2017 02:41:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A177823; Sat, 15 Apr 2017 02:41:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 34so15700330pgx.3; Fri, 14 Apr 2017 19:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=3clz1G6XAVVc2KHWDeHsqLNVtbyTMXGvGcXRpKw45xs=; b=ZIARgD/laQ9kb+hL3UmmanIOaZ1nQzGSuurNnrO1dE6n100s44TzbawjrtXCyJSaNz 3zuTs+f0t6rnk4eE0jETwxnEzAnkv6SOzSDmQMzwDWoppSAVoH55orL82FZPvPoJ3Nqw NTtixr39n/o044QC9wm7fV+iKAQTxysu+KtlfTrEGUhdi5bWOxMEiQkML71a/FLBAYMi XYS/hhw2obpIA9fp3hrUKi5I7qDycpBDqjWZoOCquO6kyuaBeLhk/Fq8P8QA9CZYsoYx IP69gB55WtzySUoPLvEHfYAr0jfAal7mAgftebMsc/oItw2XBai9k0ABTHw9DcoBaIn0 czxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=3clz1G6XAVVc2KHWDeHsqLNVtbyTMXGvGcXRpKw45xs=; b=gFQ+tMEG8W6OVIlgINvtWJHrZWXvT9XUKwitRXNMG31dV+oSrB2jVqqtk+YXcus7vU hfeoisvul0br7tjJ7BbvcWK1CWv17I8Ng4lZsact/Zvw1jnDvLmlmW6VTcxKhHrIAC0M Nb3v9utbzkuRvpCgnT11G4tYqLWcUChvlBQTiHSUAxptS3Rb+EaRbpTlcT0LHk0ntIGO dnbZfwC3OA03PkxTLI5vPknnjKut1sjooGHdIsnZD7y88ldLFL4o+qWICzAisdskiKvb suUIvUrUI+TEJKQcVG+50DHdclzy5XGQw1jFF+4ZXU2poQBQJ9n1npopzBCeRbTFVflo QO3A== X-Gm-Message-State: AN3rC/7EavRjONcrFUeq05YBIyyK+Udm8/1sB39jK6MysBmo4aI4bFyS 2tGCQJpToate8ACm0Wo= X-Received: by 10.98.52.193 with SMTP id b184mr645132pfa.82.1492224060279; Fri, 14 Apr 2017 19:41:00 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id d82sm5369610pfl.124.2017.04.14.19.40.58 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 19:40:58 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_D704F685-4935-47FC-9D53-C6152B6B9F90"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201704150149.v3F1nu0D009274@pdx.rh.CN85.dnsmgr.net> Date: Fri, 14 Apr 2017 19:40:57 -0700 Cc: John Baldwin , Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <4CBF25DF-F407-4F50-8724-B73F64734E19@gmail.com> References: <201704150149.v3F1nu0D009274@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:41:01 -0000 --Apple-Mail=_D704F685-4935-47FC-9D53-C6152B6B9F90 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 18:49, Rodney W. Grimes = wrote: >=20 >> On Friday, April 14, 2017 07:41:48 PM Ngie Cooper wrote: >>> Author: ngie >>> Date: Fri Apr 14 19:41:48 2017 >>> New Revision: 316938 >>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>=20 >>> Log: >>> savecore: fix space calculation with respect to `minfree` in = check_space(..) >>>=20 >>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>> representable data to INT_MAX. Check the values received from >>> strtoll(3), trimming trailing whitespace off the end to maintain >>> POLA. >>> - Use `KiB` instead of `kB` when describing free space, total = space, >>> etc. I am now fully aware of `KiB` being the IEC standard for = 1024 >>> bytes and `kB` being the IEC standard for 1000 bytes. >>=20 >> I will just rant lightly that no one actually uses this in the real = world. >>=20 >> Good lucking finding a "16 GiB" DIMM on crucial.com or a 4Kin drive. = A >> kilobyte is a power of 2. The End. >>=20 >> (Next up we'll have to rename 4k displays to >> 4k) >=20 > Do we use KiB, MiB, GiB,... any place else in the system? I cant = think of > a place we do this, so please, lets not start doing this here? humanize_number(3) from libutil uses IEC units. > Yes, these are newer standards, perhaps some day we should make a = global > switch to them, but lets not start mixing and matching things. I understand and agree. I=E2=80=99m not 100% sold on that one way or = another, but since I was going to redo the number representation in save = core with humanize_number(3), because reading `KiB` is = not ideal usability wise, and I don=E2=80=99t want to reinvent the wheel = normalizing numbers and printing out the unit. Perhaps there should be a flag baked into humanize_number, etc for = parsing IEC vs non-IEC unit values? Thanks for the input :)! -Ngie --Apple-Mail=_D704F685-4935-47FC-9D53-C6152B6B9F90 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8Yg5AAoJEPWDqSZpMIYVGtkP/RkTXwoej2EaIuPE/hJDOKk1 aKqIsNETeXbzHEeLnIxGMIdEjdxPLSQ7blIMsju67lFBRi0CDnYOHNa2Qy6cltUC ZclqMH+1wkvenu8j5H13KMeqjclXLHnmZJ8HzZfTTjhAUE9k/tYFl/UCEigDFe7w vhwfa2l06D+jPXQuM/pb3TqFrwPKv4x1EB/EYhnhSzgexgXZ5sxxBeHM9+uFfeC4 +62M60IpJWDotj1quAicYtWHqrtGtpVl62LRcRFJ664kfcqch1/5YhB7u4Ow4d1g g1BJYcgS1WAsCqBT0tACACWnJMEk1GR0vxCDFqYbEabnGJ1BQPSp9ctd+7PHjvQq vCHe0kYE+jiYgkvo8E+wBanuVM9bjWeuRqijiwr9jQ+cE4LXr61A7wnWdJpsE6O7 LghVkG/keWkv0Mev5TdsOg73TlW8yDauo/GlIczeB2U7EIDe6h8MYFF5FvtNuUpd 40BIjwEw5gidp4luiWDmk4aVKMNYqBmV9t4RcNZ2uh496bFtW+cCLjl108xkxuf6 Ue/BLDzWE7kn93F/wBG3qfkQ5LQGrVaUE7vTxP5LeVks5fvxsqn1YYt4E+pkm8ZN 4BaqBrd7mobgGJgB3i+X9AD9R2iOlyprVSfBDhl1xhR+/z+MhflWIp8JwGQppnjL v3QKHADSxxOA2QhmXztk =q2LA -----END PGP SIGNATURE----- --Apple-Mail=_D704F685-4935-47FC-9D53-C6152B6B9F90-- From owner-svn-src-all@freebsd.org Sat Apr 15 02:49:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFBEDD3EFA0; Sat, 15 Apr 2017 02:49:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADFD7C06; Sat, 15 Apr 2017 02:49:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id c198so17213818pfc.0; Fri, 14 Apr 2017 19:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=p3uIRJNIMPh8x9A/tfe7L9yK2ok5amYDkfg7ABq5Oj0=; b=BA43LuDtg+iIVTkF7cVP9pot0Dc2nK0o7sfxPl/vky6OoGXRqyS8snyRRBee0j4Uqy gWi9pUpfQCW4Ru0imL5fPKJP23xarVNONtYrtQbeVD83XyE8N/pSOWnj28466K/if3sF MHqyBgC/+06Dr6n0xiBJ0O+J2nBcSWaIf1JVTuYGAomD5l6Qi5Yz2m/tN2ZM/YRsorww Nxx6eyFGXcWmjmupYCOBI2xhBYI39MJysufpB2KvlH9vNP0IEieFhrLNDs2G1F4Q1nHc LJH4t+jbbiCvqgVEKg6ERxjcGpm6RxTA4pFQNnHSOp0Y/ViFomqplqLspQWy73rA+Y3C PdjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=p3uIRJNIMPh8x9A/tfe7L9yK2ok5amYDkfg7ABq5Oj0=; b=uKiTuVcbd1fu2G99pvntk0cpLEViMaTrj/cMxyfw73AXS3jpZnit5iN+0dBfNaaU16 cfCIHFEQW2gHqYqj/RcO0mbsSSzTiepaF25J16zwSKpHIS2cCQJc45kuDKkSXRCEie/r 3KVe84nwcljDYlHbr/aQLLgdvVqiNt028zZ0or6KjI63Dos0V6TOmFLgA145aWk2OTll tkocJuMGh6YDnyJNxJoUa6OjWhaYMvKNIeFuR553vme2kQrfQX2aEduHbjnW1HzNOz4A G8ksPf41+ki4Mg3J5IlV7WDB3XbQAnrrpt8VdBFZWerQIT2Mm9sCRQpap0jmCDXZUeZH B+Bw== X-Gm-Message-State: AN3rC/6UYHY7rFTzmmnGSwR+G01225qbFCGZerxR0nIDHTgxVeS/Dmd9 +fZRgqQLU/sdSRqta9c= X-Received: by 10.99.104.69 with SMTP id d66mr668400pgc.93.1492224562051; Fri, 14 Apr 2017 19:49:22 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id e76sm5396308pfk.75.2017.04.14.19.49.21 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 19:49:21 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_7EEE690C-291E-4F6A-BEAF-F17DAD12193F"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <4CBF25DF-F407-4F50-8724-B73F64734E19@gmail.com> Date: Fri, 14 Apr 2017 19:49:20 -0700 Cc: John Baldwin , Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <62071184-0DDD-4996-867E-866BF1F8DC25@gmail.com> References: <201704150149.v3F1nu0D009274@pdx.rh.CN85.dnsmgr.net> <4CBF25DF-F407-4F50-8724-B73F64734E19@gmail.com> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 02:49:23 -0000 --Apple-Mail=_7EEE690C-291E-4F6A-BEAF-F17DAD12193F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 19:40, Ngie Cooper (yaneurabeya) = wrote: >=20 >>=20 >> On Apr 14, 2017, at 18:49, Rodney W. Grimes = wrote: >>=20 >>> On Friday, April 14, 2017 07:41:48 PM Ngie Cooper wrote: >>>> Author: ngie >>>> Date: Fri Apr 14 19:41:48 2017 >>>> New Revision: 316938 >>>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>>=20 >>>> Log: >>>> savecore: fix space calculation with respect to `minfree` in = check_space(..) >>>>=20 >>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>>> representable data to INT_MAX. Check the values received from >>>> strtoll(3), trimming trailing whitespace off the end to maintain >>>> POLA. >>>> - Use `KiB` instead of `kB` when describing free space, total = space, >>>> etc. I am now fully aware of `KiB` being the IEC standard for = 1024 >>>> bytes and `kB` being the IEC standard for 1000 bytes. >>>=20 >>> I will just rant lightly that no one actually uses this in the real = world. >>>=20 >>> Good lucking finding a "16 GiB" DIMM on crucial.com or a 4Kin drive. = A >>> kilobyte is a power of 2. The End. >>>=20 >>> (Next up we'll have to rename 4k displays to >>> 4k) >>=20 >> Do we use KiB, MiB, GiB,... any place else in the system? I cant = think of >> a place we do this, so please, lets not start doing this here? >=20 > humanize_number(3) from libutil uses IEC units. >=20 >> Yes, these are newer standards, perhaps some day we should make a = global >> switch to them, but lets not start mixing and matching things. >=20 > I understand and agree. I=E2=80=99m not 100% sold on that one way or = another, but since I was going to redo the number representation in save = core with humanize_number(3), because reading `KiB` is = not ideal usability wise, and I don=E2=80=99t want to reinvent the wheel = normalizing numbers and printing out the unit. *unit. =E2=80=94> *unit, KiB seemed like a logical next step after = discussing it at long length in the CR. -Ngie --Apple-Mail=_7EEE690C-291E-4F6A-BEAF-F17DAD12193F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8YowAAoJEPWDqSZpMIYVdU0QAMtoqa/sNeFe4pWmE4zMlH7C phHTNmNrYYGi7Uy0y0FoD7QsXW50JnBMK/EzpaEsZ5qZcJVHUwgGbzQChfcYtYNg lb57F8ma3RG/bQbXfgoNS5vhVUQeqJXUW/6S3/eRJxpnHck7okncs850ON0zyX+s jXEEbV2n6MiqwPkfpWE61h7H6IbNao1rxa4qfZtuIkne+ZmGZ85VR3F0ufAnu8ab g0b0Jf7+LtZCf6f50242kUa/g4y2u9J/3l8fqlA+jxj5kgmwwdSw6x35J9cqtgmV SpOz5SxBhLwIV2xKBwB544KDivL4u6HsO3vVLWVZxzX2xRDN7U574GlUlOeoON2p me3KON4lkKi+mv+2S2K6tYnSQHg61SSlMpF1yI/ncG2s1UW8Cq1H7sX/icQ1Gw9B Lu717C1gKVPN2liKVudUzpWOdnvPlnliyiE2FT6THtuwQtpnlHHavTkKaUfnoldX zaiq+yGt/XqmTN2Uaga1GJiPpGJML8bAZW8lGr1x2yis/8yXfXQDLb8BzR2yfQ4D 1BGWl0VB9MdXPKttELz4J+Y2sI4goO0LKZcg7W8Nf0ygrVl6iP3n6ZUI5GWXJ8LH 4SCWreJ3ieEq/sTwA/MmX3nXNAJafJL8gSalvMPoj0w033QIyMqwvkIUu3YNq0G1 wBTKgZ0kqId6hDlZJJu1 =qfu7 -----END PGP SIGNATURE----- --Apple-Mail=_7EEE690C-291E-4F6A-BEAF-F17DAD12193F-- From owner-svn-src-all@freebsd.org Sat Apr 15 03:05:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFD6BD3E8AA; Sat, 15 Apr 2017 03:05:55 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84CCE90; Sat, 15 Apr 2017 03:05:55 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F35reH009781; Fri, 14 Apr 2017 20:05:53 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F35rNJ009780; Fri, 14 Apr 2017 20:05:53 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150305.v3F35rNJ009780@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <4CBF25DF-F407-4F50-8724-B73F64734E19@gmail.com> To: "Ngie Cooper (yaneurabeya)" Date: Fri, 14 Apr 2017 20:05:53 -0700 (PDT) CC: rgrimes@freebsd.org, John Baldwin , Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 03:05:55 -0000 > > > On Apr 14, 2017, at 18:49, Rodney W. Grimes wrote: > > > >> On Friday, April 14, 2017 07:41:48 PM Ngie Cooper wrote: > >>> Author: ngie > >>> Date: Fri Apr 14 19:41:48 2017 > >>> New Revision: 316938 > >>> URL: https://svnweb.freebsd.org/changeset/base/316938 > >>> > >>> Log: > >>> savecore: fix space calculation with respect to `minfree` in check_space(..) > >>> > >>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > >>> representable data to INT_MAX. Check the values received from > >>> strtoll(3), trimming trailing whitespace off the end to maintain > >>> POLA. > >>> - Use `KiB` instead of `kB` when describing free space, total space, > >>> etc. I am now fully aware of `KiB` being the IEC standard for 1024 > >>> bytes and `kB` being the IEC standard for 1000 bytes. > >> > >> I will just rant lightly that no one actually uses this in the real world. > >> > >> Good lucking finding a "16 GiB" DIMM on crucial.com or a 4Kin drive. A > >> kilobyte is a power of 2. The End. > >> > >> (Next up we'll have to rename 4k displays to > >> 4k) > > > > Do we use KiB, MiB, GiB,... any place else in the system? I cant think of > > a place we do this, so please, lets not start doing this here? > > humanize_number(3) from libutil uses IEC units. And how many things bother to use this library function? Do the ones that do call it produce the traditional output that has been around for 40 years? > > Yes, these are newer standards, perhaps some day we should make a global > > switch to them, but lets not start mixing and matching things. > > I understand and agree. I?m not 100% sold on that one way or another, but > since I was going to redo the number representation in save core with > humanize_number(3), because reading `KiB` is not ideal ^^^ I hope we are not already reading KiB anyplace.... > usability wise, and I don?t want to reinvent the wheel normalizing numbers > and printing out the unit. > > Perhaps there should be a flag baked into humanize_number, etc for parsing IEC vs non-IEC unit values? I dont think it parses anything, but as far as producing strings from values it already has an IEC flag: HN_IEC_PREFIXES, please lets not use this flag, and if we are using it anyplace lets see if we can remove that use. Also be careful, this function only accepts signed int 64, which means we are not gona be able to use this in all places that probably need this, so perhaps a larger can of paint for a bigger bike shead is needed? > Thanks for the input :)! input++; -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 03:12:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B9AED3ED85; Sat, 15 Apr 2017 03:12:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45738ABC; Sat, 15 Apr 2017 03:12:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id i5so17183045pfc.3; Fri, 14 Apr 2017 20:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=cFwOynXpsrq9KFOMYOXHT4+jWPP4juCGRefHRuAIkAM=; b=rcLlGrU8UxD1Pr82NK+qcxUqedfZ5TRllnZfxGeOnEj0txN0cZm3NzERl4sKFvp1BE i9PKHK+S/nbCs4XYF6Rdf090X2LJaDr8ekPIddcgUjogBhCCknfESVoPKzKptw72yQw0 oPMH+Xw8pmppHTLeSfpmdyt2ARRReetidmbZjC5suAe3a1Nhrg8FFd/ET300TTiiY2E9 ynhMzKQBw4YNMRKJrCEj7XjanGPfGgV1wcQfDzIJtMeIj0JwdR0zSmIMMpgmMFzGRk5y SoyfSDNY/HA+vuZqExP+vr3mIa1Vp9GvD8ppYtW6QsJhYLq5+hmUolRUTaGqhRMo3pp4 6//g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=cFwOynXpsrq9KFOMYOXHT4+jWPP4juCGRefHRuAIkAM=; b=Iq0i1uRycEw0RzDd+KjHH6lmn8FF4Xj+OGnyowHJ/FAVc+WGFa2D4J8U7XtiWvdZsk /lZNqk7k4L4PtLKzBRIfFY/Jt2hbojBKSt0amTFlB/1eROx8qGWxI6Mb0kuaiyKnfpxj RLeD7C6Ii1T4lHpUrs3JtY4WpoynpadQSTcpCzwmT6ZkD1z0yyRxnfEzCizAdoG9ervh 37Nc/DXogN8NMDp0yxMmpXBTt3HrYimPIfvDn04/VMtX/VWxaJ5uahfnwnpr7/cV66U6 tIAzLbMgaesBD5lCwbDV4M4eNfqOac9ES0ETrfs5EyaNxAIqcmTJq7pmGfB01gCl7p9R aohA== X-Gm-Message-State: AN3rC/7xJbLSTzGKS0EVbORNp2vDypGEQwF1hsa1qJy57WU9nnO0EnJ/ fsAACf8USWBDAur+89o= X-Received: by 10.99.223.70 with SMTP id h6mr764210pgj.50.1492225937633; Fri, 14 Apr 2017 20:12:17 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c3sm5462476pfg.46.2017.04.14.20.12.16 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 20:12:16 -0700 (PDT) Subject: Re: svn commit: r316938 - head/sbin/savecore Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_9A2FC2C8-030A-456C-B117-169918E25B68"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201704150305.v3F35rNJ009780@pdx.rh.CN85.dnsmgr.net> Date: Fri, 14 Apr 2017 20:12:15 -0700 Cc: John Baldwin , Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <1DC7F131-3EC6-4C59-8941-DC3EE77764C2@gmail.com> References: <201704150305.v3F35rNJ009780@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 03:12:18 -0000 --Apple-Mail=_9A2FC2C8-030A-456C-B117-169918E25B68 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2017, at 20:05, Rodney W. Grimes = wrote: >=20 >>>=20 >>> On Apr 14, 2017, at 18:49, Rodney W. Grimes = wrote: >>>=20 >>>> On Friday, April 14, 2017 07:41:48 PM Ngie Cooper wrote: >>>>> Author: ngie >>>>> Date: Fri Apr 14 19:41:48 2017 >>>>> New Revision: 316938 >>>>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>>>>=20 >>>>> Log: >>>>> savecore: fix space calculation with respect to `minfree` in = check_space(..) >>>>>=20 >>>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>>>> representable data to INT_MAX. Check the values received from >>>>> strtoll(3), trimming trailing whitespace off the end to maintain >>>>> POLA. >>>>> - Use `KiB` instead of `kB` when describing free space, total = space, >>>>> etc. I am now fully aware of `KiB` being the IEC standard for = 1024 >>>>> bytes and `kB` being the IEC standard for 1000 bytes. >>>>=20 >>>> I will just rant lightly that no one actually uses this in the real = world. >>>>=20 >>>> Good lucking finding a "16 GiB" DIMM on crucial.com or a 4Kin = drive. A >>>> kilobyte is a power of 2. The End. >>>>=20 >>>> (Next up we'll have to rename 4k displays to >>>> 4k) >>>=20 >>> Do we use KiB, MiB, GiB,... any place else in the system? I cant = think of >>> a place we do this, so please, lets not start doing this here? >>=20 >> humanize_number(3) from libutil uses IEC units. >=20 > And how many things bother to use this library function? Do the > ones that do call it produce the traditional output that has been > around for 40 years? >=20 >>> Yes, these are newer standards, perhaps some day we should make a = global >>> switch to them, but lets not start mixing and matching things. >>=20 >> I understand and agree. I?m not 100% sold on that one way or another, = but >> since I was going to redo the number representation in save core with >> humanize_number(3), because reading `KiB` is not = ideal > ^^^ > I hope we are not already reading KiB anyplace=E2=80=A6. I meant it=E2=80=99s a lot harder for humans to read = `KiB` instead of = ``. >> usability wise, and I don?t want to reinvent the wheel normalizing = numbers >> and printing out the unit. >>=20 >> Perhaps there should be a flag baked into humanize_number, etc for = parsing IEC vs non-IEC unit values? >=20 > I dont think it parses anything, but as far as producing strings from = values > it already has an IEC flag: HN_IEC_PREFIXES, please lets not use this = flag, > and if we are using it anyplace lets see if we can remove that use. I don=E2=80=99t see it used anywhere in the tree, based on a quick grep. > Also be careful, this function only accepts signed int 64, which means > we are not gona be able to use this in all places that probably need > this, so perhaps a larger can of paint for a bigger bike shead is = needed? I don=E2=80=99t necessarily follow the above statement 100%. Are you = warning against mass-conversion to libutil (if so, I agree=E2=80=A6 this = was just a case where it really helps readability in savecore(8))? Thanks! -Ngie --Apple-Mail=_9A2FC2C8-030A-456C-B117-169918E25B68 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8Y+QAAoJEPWDqSZpMIYVX5kP/A0O7rb3xexdwfkxcWpizQG2 LqVrwCJfslZsuleUKtxWlaf1DH+uOBihXhlFYv5wjDBFkdw+fkzrQf9XdREElceF 35L7XOWZVvzriL2sBLH2VkK+xa9W2k60zJIRKefRtij1GDxvzq7EmoOFHZB6qUhk LAswQb2qrxdEhKJ8fHbKLBTTcYFm7/IQzUX61+lZiOtcsZ08iDCzW/NP6XBNoy26 VHwKGWUHcAp/fY4le80ie2NeLL96Av2TpSkDmTAKwI2qdGSV6eLkpgzf7AN8Y9HV A1YNuq1eC5LOAUnU7DuyT4Qaj96eDhpkRSMeFQ66OWIxCnxqby0HXPn2bvAN8TaM wPyC7GnvGZSTVUBtGumYMrWbdvz/zxRJGXwTKcoHpci+PPI6RlDUGmsE2dUZcLgo Xg+oh1wvp14JGl2woNmjmF7dlCZy7UjWjIT4bxw0EkKx20Vg0pIe1KDgUGSdAGDF lafih0LxFWO57hO3aa+bE/U5s0SeTN0uRmLQy3xQjD5Dx63INpJcOCMq2F6wqb3u E3vfiIuF1nhU2SYu67cL61R+haiG7rgUOZRFsWaOHIDrEbEYBG/pnevJNu+1DzeU tzomNMV1J2nK1aMc97Y28eiEe9soFiQOP5lq0HHSbU4G+B+OI8tp1hm8Q/D4MlPb 59fBblARl1BM9i6qsIHC =QKDO -----END PGP SIGNATURE----- --Apple-Mail=_9A2FC2C8-030A-456C-B117-169918E25B68-- From owner-svn-src-all@freebsd.org Sat Apr 15 03:12:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F3ED3EDEA; Sat, 15 Apr 2017 03:12:25 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E4F5B99; Sat, 15 Apr 2017 03:12:25 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 25D5F524; Fri, 14 Apr 2017 20:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1492225945; bh=oLc7AKggZ+nsnGgz0Uv1Kg3/D/Q+fRPdahbZVaLJCpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NjMwmT+4slYYNB0YlSYdjn9yRyOoQ5kREToRrXiN7zgr+w/nMmJeWhh+UIBv9z0BC 1kkiber7CZV9JkMxY3xyjmQjK9FRQ95rgWsrgbZAHksF/It0EaFYAn0i4qsFVMjQdK K5YjtvrQhrFBDqWohq/34o7f9yNPTK9/CcVP2IbI= From: Peter Wemm To: svn-src-all@freebsd.org Cc: "Ngie Cooper (yaneurabeya)" , src-committers , Hiroki Sato , Hiren Panchasara , svn-src-head@freebsd.org, Maxim Sobolev Subject: Re: svn commit: r316874 - head/sys/kern Date: Fri, 14 Apr 2017 20:12:20 -0700 Message-ID: <2109294.KVn8xeR1jZ@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: <13691757.t3s7Qik7v1@overcee.wemm.org> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <13691757.t3s7Qik7v1@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1786590.cuBigVQMDk"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 03:12:25 -0000 --nextPart1786590.cuBigVQMDk Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday, April 14, 2017 07:36:55 PM Peter Wemm wrote: > On Friday, April 14, 2017 02:14:16 PM Ngie Cooper wrote: > > > On Apr 14, 2017, at 14:10, Maxim Sobolev = wrote: > > >=20 > > > Peter, Ngie, > > >=20 > > > Looks like out of that refactoring came a logical bug that is pre= sent in > > > the head, which causes syslod to first to shutdown the socket for= > > > reading > > > and then try to select/recv on it (which is somewhat stupid). And= that > > > issue has been masked by shutdown() on datagram socket becoming > > > effectively a NOP in 11 & head 20 months ago. It only affects hea= d > > > though, 11-stable still has the old code which does not include t= hat > > > half-closed socket into the select list. Attached patch is expect= ed to > > > fix head, Peter, it would be nice if you can give it a try (resto= ring > > > latest changes into uipc_sockets.c) and let me know if it helps. > > >=20 > > > Thanks! > >=20 > > CCing hrs@ for input as he did the refactoring. > > Thanks! > > -Ngie > >=20 > > PS LGTM with the change. Will wait for feedback from wemm@. >=20 > This is definitely not working. I get ENOSPC and listen queue overf= lows on > /var/run/logpriv now. >=20 > Grabbing an old 10.3 /usr/sbin/syslogd and placing it on the top of t= he 12.x > one worked fine, aside from the include statements. This can't be right: if (SecureMode || res->ai_family =3D=3D AF_LOCAL) { /* Forbid communication in secure mode. */ if (shutdown(s, SHUT_RD) < 0 && errno !=3D ENOTCONN) { logerror("shutdown"); if (!Debug) die(0); } dprintf("listening on socket\n"); sl_recv =3D NULL; } This appears to disable unix domain sockets like /var/run/log and=20 /var/run/logpriv. =2D- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart1786590.cuBigVQMDk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAljxj5UACgkQNdaXCeyA ngQ3sQf/cDAHTNNMDmJHh7PtKclwVJGRNNWkRZ5dEfS5ES6eLB9+QZta48WStxby 9/0dTRJ2HjBctbVw+LpjCxVt0rEljCI3MNmYm+6mCOWSzeGhswGvfFjaHFASxXCT Im0MNV47FEhupGvYbC1m+Lq1nB8v/91E4Rb0R/pr1eSVjlsidUOj60VL7J31p3Ge OuuPn65pIT9AJLaMm17pvvujy5Y3lnvz1fRPFmNSiwRqK+v8UULRS08NttFebU+Q 1L1RlWJjc/voemKCslc14ET5x6Wz8MOorHKABFxgSrTksPkWbE0bwN0bVu/yO6tI QGb1a5oESB2F4TpqB7bJ8Vyp7KCtMg== =ErrD -----END PGP SIGNATURE----- --nextPart1786590.cuBigVQMDk-- From owner-svn-src-all@freebsd.org Sat Apr 15 03:13:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89926D3EEF5; Sat, 15 Apr 2017 03:13:55 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54ABEE36; Sat, 15 Apr 2017 03:13:55 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id i5so17186069pfc.3; Fri, 14 Apr 2017 20:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=N1qYd7azVucW/WZoUC0Jix+IlO+4w9+U7IHv4bXb51o=; b=h9Oj303ooOeT7kLluXXoet7KTajwTbnB4wyMwClQMmLVcS4wncpA1CB+11IUJto0rG ZCyrWPwOMqEVIWd879a4EGKWuWWQHNa8LFaoDH6pktKBkw/P9rOxH1XK5gEE8UD2aDvY T4gVY5KnWL8va+zvnc7AsoAdwXZlyVTnWh1Lbi3i/Bd2Sl4xt2eLF+oGMeLMnPACRFE8 uHWta8pAQSogEaRJG/EcEYKORZ0jhpRrYkYOfU+KeGl1ryTfzzE5MYeoJEa9YTqN1bJs pktFUYJiiKA7Vb0KtohBvIKPxNaIqBQ0n6roJE1UNFpAi8c8I+hkuCN93Na69PRmPKPo riwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=N1qYd7azVucW/WZoUC0Jix+IlO+4w9+U7IHv4bXb51o=; b=XOxUALkZC6+VacKfFPoMBZgvucEbuangk3H5ronVMEVYChyUl+DfxiUIbZsXDFZwlM tSm9q9fBtrzT+RjKqnD+Uc15rYa89Szzlik0Q/FRErwH4+v6ZvdV5jjaksqhO/bo9egD pJp7nFCQYM+0sleLBMsull/OhQFcZe6ayWh95BKtKJXZMHurL0M/+TSnnXlkNWXmIAyQ MA6nIqQ8OWTATto/XQvlqDz16CboRRN4RpZjRWQz34MUI9WovpqbwhyQdpojySvCmWf4 LHBl083GWszm4UB0TYY68+VsUDoPeLufPzD5enoAMB4S5NU5PSQIU9i9hsRO/oXro6ox MKUQ== X-Gm-Message-State: AN3rC/6/4GN2CL4Q4mwOvXKTfbf+idrjuvmzw8CHIVsglW8Qy3gLcyS9 +Pj4IMW87eP/jUBaeVk= X-Received: by 10.98.210.2 with SMTP id c2mr746191pfg.83.1492226034957; Fri, 14 Apr 2017 20:13:54 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c64sm5458569pfa.110.2017.04.14.20.13.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 20:13:53 -0700 (PDT) Subject: Re: svn commit: r316874 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_79513F97-9C0D-417F-A76A-8914AC4F4E2A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <2109294.KVn8xeR1jZ@overcee.wemm.org> Date: Fri, 14 Apr 2017 20:13:52 -0700 Cc: svn-src-all@freebsd.org, src-committers , Hiroki Sato , Hiren Panchasara , svn-src-head@freebsd.org, Maxim Sobolev Message-Id: References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <13691757.t3s7Qik7v1@overcee.wemm.org> <2109294.KVn8xeR1jZ@overcee.wemm.org> To: Peter Wemm X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 03:13:55 -0000 --Apple-Mail=_79513F97-9C0D-417F-A76A-8914AC4F4E2A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Apr 14, 2017, at 20:12, Peter Wemm wrote: >=20 > On Friday, April 14, 2017 07:36:55 PM Peter Wemm wrote: >> On Friday, April 14, 2017 02:14:16 PM Ngie Cooper wrote: >>>> On Apr 14, 2017, at 14:10, Maxim Sobolev = wrote: >>>>=20 >>>> Peter, Ngie, >>>>=20 >>>> Looks like out of that refactoring came a logical bug that is = present in >>>> the head, which causes syslod to first to shutdown the socket for >>>> reading >>>> and then try to select/recv on it (which is somewhat stupid). And = that >>>> issue has been masked by shutdown() on datagram socket becoming >>>> effectively a NOP in 11 & head 20 months ago. It only affects head >>>> though, 11-stable still has the old code which does not include = that >>>> half-closed socket into the select list. Attached patch is expected = to >>>> fix head, Peter, it would be nice if you can give it a try = (restoring >>>> latest changes into uipc_sockets.c) and let me know if it helps. >>>>=20 >>>> Thanks! >>>=20 >>> CCing hrs@ for input as he did the refactoring. >>> Thanks! >>> -Ngie >>>=20 >>> PS LGTM with the change. Will wait for feedback from wemm@. >>=20 >> This is definitely not working. I get ENOSPC and listen queue = overflows on >> /var/run/logpriv now. >>=20 >> Grabbing an old 10.3 /usr/sbin/syslogd and placing it on the top of = the 12.x >> one worked fine, aside from the include statements. >=20 > This can't be right: > if (SecureMode || res->ai_family =3D=3D AF_LOCAL) { > /* Forbid communication in secure mode. */ > if (shutdown(s, SHUT_RD) < 0 && > errno !=3D ENOTCONN) { > logerror("shutdown"); > if (!Debug) > die(0); > } > dprintf("listening on socket\n"); > sl_recv =3D NULL; > } >=20 > This appears to disable unix domain sockets like /var/run/log and > /var/run/logpriv. ACK. This looks like a fun bug. -Ngie --Apple-Mail=_79513F97-9C0D-417F-A76A-8914AC4F4E2A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY8Y/wAAoJEPWDqSZpMIYVld4P+wSZvWY/Mi1eEcmz7h3u4B4D PktRfN2fdnsVnFjKBLWOz5ys3IB5xWWDmopZqelK+a5q7ze+hLevmBWnJE1i6R87 uXS/IRiMfq/0v2o1CeAkFVjNuFgVhyn6w2z+76HFWV4YTOYrOYk9Ol/EnrIUsFUA WmoH31qx87LMDJW5nsZGsNgW2UjElGPC30I95pf0b0CLTz47uDwIuN+Jb55E4d9Q pPdFhEz2iVm6l86Cpd0DOX8wyQxoXtHb5LzPfHwZCOOzo3ehwCBM17A/zOMTQ7ZS TlpbBWHkD9BNq+3U/Eu51Bq+mBf4yTnn5fqFGfhtQvTLiV8gLDiyQ2KucNEMoVDx VQy0AI1tyZVfnme4o/h77XYbwbDD0cZGdz3xKE+cSqZ9lcNNxRhtZD6/SwGas8cJ l3CpPT2YC6jmHjAufrtc/MkYEjy7IMs5EQV2pER7xgP2Bq5HBGfgCWJ6VbgNFYIB 21a8JRoyzZLdMC+OsNuuk6LnB6dGV0x8VofefV9yT+2o0ZFGQ9p4WtldfTPiHkTi kIxA6w/lFyMgyOUOE+iWDdljMNXFG5W1qzxM8CCckVPCMO6jX1+5P53qbCRyMGZ8 DXDRz0JqQvAMWEXPDIiRceB5CMOxk8XK8XppMIuDJdNY+aUNVTWvPd8j2m8Km4/g CbiNw5iABeF6fmZbWThC =zLg3 -----END PGP SIGNATURE----- --Apple-Mail=_79513F97-9C0D-417F-A76A-8914AC4F4E2A-- From owner-svn-src-all@freebsd.org Sat Apr 15 03:18:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A2CED3E0D5; Sat, 15 Apr 2017 03:18:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 081B5176; Sat, 15 Apr 2017 03:18:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F3IkFh009853; Fri, 14 Apr 2017 20:18:46 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F3IjMe009852; Fri, 14 Apr 2017 20:18:45 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150318.v3F3IjMe009852@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <62071184-0DDD-4996-867E-866BF1F8DC25@gmail.com> To: "Ngie Cooper (yaneurabeya)" Date: Fri, 14 Apr 2017 20:18:45 -0700 (PDT) CC: rgrimes@freebsd.org, John Baldwin , Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 03:18:48 -0000 > > > On Apr 14, 2017, at 19:40, Ngie Cooper (yaneurabeya) wrote: > > > >> > >> On Apr 14, 2017, at 18:49, Rodney W. Grimes wrote: > >> > >>> On Friday, April 14, 2017 07:41:48 PM Ngie Cooper wrote: > >>>> Author: ngie > >>>> Date: Fri Apr 14 19:41:48 2017 > >>>> New Revision: 316938 > >>>> URL: https://svnweb.freebsd.org/changeset/base/316938 > >>>> > >>>> Log: > >>>> savecore: fix space calculation with respect to `minfree` in check_space(..) > >>>> > >>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > >>>> representable data to INT_MAX. Check the values received from > >>>> strtoll(3), trimming trailing whitespace off the end to maintain > >>>> POLA. > >>>> - Use `KiB` instead of `kB` when describing free space, total space, > >>>> etc. I am now fully aware of `KiB` being the IEC standard for 1024 > >>>> bytes and `kB` being the IEC standard for 1000 bytes. > >>> > >>> I will just rant lightly that no one actually uses this in the real world. > >>> > >>> Good lucking finding a "16 GiB" DIMM on crucial.com or a 4Kin drive. A > >>> kilobyte is a power of 2. The End. > >>> > >>> (Next up we'll have to rename 4k displays to > >>> 4k) > >> > >> Do we use KiB, MiB, GiB,... any place else in the system? I cant think of > >> a place we do this, so please, lets not start doing this here? > > > > humanize_number(3) from libutil uses IEC units. > > > >> Yes, these are newer standards, perhaps some day we should make a global > >> switch to them, but lets not start mixing and matching things. > > > > I understand and agree. I?m not 100% sold on that one way or another, but since I was going to redo the number representation in save core with humanize_number(3), because reading `KiB` is not ideal usability wise, and I don?t want to reinvent the wheel normalizing numbers and printing out the unit. > > *unit. ?> *unit, KiB seemed like a logical next step after discussing it at long length in the CR. I do not see any long length discussion in the CR. I see an assertion that KiB is the new IEC standard, I see a miss understanding of what kB and KB means, and I see someone wanting to push the tree towards IEC. I see here on the mailling list a push to NOT start IEC'ing things, at least by myself and jhb. I would not consider 2 or 3 peole have a 15 line converstaion in a CR as reasonable grounds for a change like this. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 03:28:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38272D3E555; Sat, 15 Apr 2017 03:28:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1F5ECBD; Sat, 15 Apr 2017 03:28:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F3SEMM095851; Sat, 15 Apr 2017 03:28:14 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F3SE8k095850; Sat, 15 Apr 2017 03:28:14 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201704150328.v3F3SE8k095850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 15 Apr 2017 03:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316952 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 03:28:15 -0000 Author: sjg Date: Sat Apr 15 03:28:13 2017 New Revision: 316952 URL: https://svnweb.freebsd.org/changeset/base/316952 Log: Latest version, we need to realpath anyway to check if an obj dependency is also a src dependency. Modified: head/share/mk/meta2deps.py Modified: head/share/mk/meta2deps.py ============================================================================== --- head/share/mk/meta2deps.py Sat Apr 15 02:24:22 2017 (r316951) +++ head/share/mk/meta2deps.py Sat Apr 15 03:28:13 2017 (r316952) @@ -492,6 +492,21 @@ class MetaFile: if not file: f.close() + def is_src(self, base, dir, rdir): + """is base in srctop""" + for dir in [dir,rdir]: + if not dir: + continue + path = '/'.join([dir,base]) + srctop = self.find_top(path, self.srctops) + if srctop: + if self.dpdeps: + self.add(self.file_deps, path.replace(srctop,''), 'file') + self.add(self.src_deps, dir.replace(srctop,''), 'src') + self.seenit(dir) + return True + return False + def parse_path(self, path, cwd, op=None, w=[]): """look at a path for the op specified""" @@ -520,10 +535,9 @@ class MetaFile: # to the src dir, we may need to add dependencies for each rdir = dir dir = abspath(dir, cwd, self.last_dir, self.debug, self.debug_out) - if rdir == dir or rdir.find('./') > 0: - rdir = None - if os.path.islink(dir): rdir = os.path.realpath(dir) + if rdir == dir: + rdir = None # now put path back together path = '/'.join([dir,base]) if self.debug > 1: @@ -544,17 +558,9 @@ class MetaFile: # finally, we get down to it if dir == self.cwd or dir == self.curdir: return - srctop = self.find_top(path, self.srctops) - if srctop: - if self.dpdeps: - self.add(self.file_deps, path.replace(srctop,''), 'file') - self.add(self.src_deps, dir.replace(srctop,''), 'src') + if self.is_src(base, dir, rdir): self.seenit(w[2]) - self.seenit(dir) - if rdir and not rdir.startswith(srctop): - dir = rdir # for below - rdir = None - else: + if not rdir: return objroot = None From owner-svn-src-all@freebsd.org Sat Apr 15 03:31:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0BD1D3E720; Sat, 15 Apr 2017 03:31:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99EC6F29; Sat, 15 Apr 2017 03:31:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F3VBDm009906; Fri, 14 Apr 2017 20:31:11 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F3VB5b009905; Fri, 14 Apr 2017 20:31:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150331.v3F3VB5b009905@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <1DC7F131-3EC6-4C59-8941-DC3EE77764C2@gmail.com> To: "Ngie Cooper (yaneurabeya)" Date: Fri, 14 Apr 2017 20:31:11 -0700 (PDT) CC: rgrimes@freebsd.org, John Baldwin , Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 03:31:13 -0000 [ Charset UTF-8 unsupported, converting... ] > > > On Apr 14, 2017, at 20:05, Rodney W. Grimes wrote: > > > >>> > >>> On Apr 14, 2017, at 18:49, Rodney W. Grimes wrote: > >>> > >>>> On Friday, April 14, 2017 07:41:48 PM Ngie Cooper wrote: > >>>>> Author: ngie > >>>>> Date: Fri Apr 14 19:41:48 2017 > >>>>> New Revision: 316938 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/316938 > >>>>> > >>>>> Log: > >>>>> savecore: fix space calculation with respect to `minfree` in check_space(..) > >>>>> > >>>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > >>>>> representable data to INT_MAX. Check the values received from > >>>>> strtoll(3), trimming trailing whitespace off the end to maintain > >>>>> POLA. > >>>>> - Use `KiB` instead of `kB` when describing free space, total space, > >>>>> etc. I am now fully aware of `KiB` being the IEC standard for 1024 > >>>>> bytes and `kB` being the IEC standard for 1000 bytes. > >>>> > >>>> I will just rant lightly that no one actually uses this in the real world. > >>>> > >>>> Good lucking finding a "16 GiB" DIMM on crucial.com or a 4Kin drive. A > >>>> kilobyte is a power of 2. The End. > >>>> > >>>> (Next up we'll have to rename 4k displays to > >>>> 4k) > >>> > >>> Do we use KiB, MiB, GiB,... any place else in the system? I cant think of > >>> a place we do this, so please, lets not start doing this here? > >> > >> humanize_number(3) from libutil uses IEC units. > > > > And how many things bother to use this library function? Do the > > ones that do call it produce the traditional output that has been > > around for 40 years? > > > >>> Yes, these are newer standards, perhaps some day we should make a global > >>> switch to them, but lets not start mixing and matching things. > >> > >> I understand and agree. I?m not 100% sold on that one way or another, but > >> since I was going to redo the number representation in save core with > >> humanize_number(3), because reading `KiB` is not ideal > > ^^^ > > I hope we are not already reading KiB anyplace?. > > I meant it?s a lot harder for humans to read `KiB` > instead of ``. And I am agreeing on the scaled, and disagreeing on the KiB, another words please revert to printing KB as the former code did as far as a Unit goes. Lets not use Ki Mi Gi, etc. > >> usability wise, and I don?t want to reinvent the wheel normalizing numbers > >> and printing out the unit. > >> > >> Perhaps there should be a flag baked into humanize_number, etc for parsing IEC vs non-IEC unit values? > > > > I dont think it parses anything, but as far as producing strings from values > > it already has an IEC flag: HN_IEC_PREFIXES, please lets not use this flag, > > and if we are using it anyplace lets see if we can remove that use. > > I don?t see it used anywhere in the tree, based on a quick grep. YEA!!! Thanks for doing the search. > > Also be careful, this function only accepts signed int 64, which means > > we are not gona be able to use this in all places that probably need > > this, so perhaps a larger can of paint for a bigger bike shead is needed? > > I don?t necessarily follow the above statement 100%. Are you warning > against mass-conversion to libutil (if so, I agree? this was just a case > where it really helps readability in savecore(8))? Yes, I am warning against mass conversion, or for that that matter much conversion to humanize_number because it shall need to be revamped if it is ever to become a real solutions due to it being a very narrow minded function (no unsigned implementation for very large values that are probably the ones that could benifit the most from this type of function.) You also may want to still report full sizes in output (you maybe I have not read the final code:) >From kernel boot: real memory = 134217728 (128 MB) avail memory = 120832000 (115 MB) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 05:37:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1B74D3E52C; Sat, 15 Apr 2017 05:37:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 706A81546; Sat, 15 Apr 2017 05:37:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id a188so17527165pfa.2; Fri, 14 Apr 2017 22:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5JArcHcnxcEoIM1ckH5QmZ5xTkdEOXllHClfyOnP4PY=; b=nr9GQg0xLiYYjNCAzppJeKuw1/qwEzBjCVPF4f2QjzIkIW7Fvww90h5nnKo3e4BNmn eOxPU+uTnxQ6ySrb3Pcaw+ernQqIhjpTPyOLRm7ZW4HOJxIGDNDiueJOGguLGD+Luzp5 0yQe7XYTz1jMOKnu9ZDv5kzp4rR3uLHPpcATTBqdD9Wl6JnElghJCElsoU7i/5dN7sR+ yO8HdjpxfU97EHno+LKwTL5EcKZaoQr+rkBEriMqwQqNcYWuGYqGtwUIp6Ad9UUNwAUh 5CLTIxmAQYu4C2dLJkmJdG2hNr//INCZ+d2+EvlLQm/3LbT+NbwtaortJVQ2IQ9+EIyo MLaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=5JArcHcnxcEoIM1ckH5QmZ5xTkdEOXllHClfyOnP4PY=; b=ZPSTXbmnu2I1bNxjNfCzKk+K8zWIteTPlSJ867Peu2gW1YrAQ899bNV4QtNIKolro/ ARCC7gjiCHxaPeYbzDYd4ai/iqwG579Sjy5mOFh5YKS6OSMr8slPB18R5POv7D/PwbM0 5azd5thgueE5+aaraWhz/Z0qX0sZ8H/nsuVqXIP9VbXIL4kXLQGSh+hCgg0vGDlesntv H6GZQ4VZR0vW07N8K58fgHdcIoO4JF/M6kElJILTlgKgj0b7R4hzcTT1sb7UnjZgfNMY N9uCihxJREG/ofj5MCbv6adYArDD+6aVC3OIXBJk4ZDF4m6jph9RmQxQUD/wysmFTkn4 +YAA== X-Gm-Message-State: AN3rC/6vb0yErzWgcZvDt2QN2B2BlqEu0TqxjOEx4eVFkpcZW7oL0wpL vI5YXqv6ZKjIpgBIgYU= X-Received: by 10.84.241.3 with SMTP id a3mr526981pll.117.1492234654884; Fri, 14 Apr 2017 22:37:34 -0700 (PDT) Received: from raichu ([2604:4080:1102:0:ca60:ff:fe9d:3963]) by smtp.gmail.com with ESMTPSA id e13sm6087558pfb.30.2017.04.14.22.37.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 22:37:33 -0700 (PDT) Sender: Mark Johnston Date: Fri, 14 Apr 2017 22:37:29 -0700 From: Mark Johnston To: rgrimes@freebsd.org Cc: Alan Somers , Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170415053729.GA76139@raichu> References: <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> <201704150130.v3F1UHpR009181@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704150130.v3F1UHpR009181@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 05:37:35 -0000 On Fri, Apr 14, 2017 at 06:30:17PM -0700, Rodney W. Grimes wrote: > > The patch to add compression support is here and should largely still > > work: > > https://people.freebsd.org/~markj/patches/core-compression/20141110-kern_dump.diff > > > > I've been hesitant about pushing it forward: > > - The dump_write* APIs need some simplification after the addition of > > encrypted dump support and support for dumping to 4Kn drives. > > - I'm not sure how encryption should compose with compression. It seems > > intuitively obvious that we should compress before encrypting if the > > compression is to be of any use, but I don't know enough to know > > whether the compression might somehow compromise the effectiveness of > > the encryption. > > > > If anyone has some insight on the second of these two points, I'd > > appreciate hearing it. > > I have a large amount of reworking and modulization of the dump code > incuding intergration of your (markj) compressed dumps. Layer isnt > implemented but is in the plan. I should not of held off on the net > dump code as it got smashed by encrypted dumps, then again by > the libif'ing for all the Intel drives that had been netdump modified. > > Basically now starting over :-( Could you post your patches somewhere? I've been sitting on this (and the netdump patches, for which I have quite a few modifications) for far too long, and would like to finish them and get them in soon. I'll note that the netdump code posted a few years ago had some problems that are fixed in Isilon's version, which I'm working on rebasing on HEAD. In particular, I simplified the driver integration a bit, changed the code to avoid allocating mbufs from UMA after a panic, plumbed a configuration interface through dumpon, and fixed some problems with netdumpd. I'm working on integrating netdump with Isilon's internal infrastructure at the moment. The conversion of em and igb to iflib does complicate things a bit; I haven't yet looked at how hard it would be to support netdump in iflib'ed drivers. > Minidump is an lkm for me, and main dump is almost an lkm for me too. Does "lkm" mean "loadable kernel module"? If so, why? From owner-svn-src-all@freebsd.org Sat Apr 15 05:43:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6144CD3E7D3; Sat, 15 Apr 2017 05:43:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x234.google.com (mail-pf0-x234.google.com [IPv6:2607:f8b0:400e:c00::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E2101B46; Sat, 15 Apr 2017 05:43:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x234.google.com with SMTP id s16so47595566pfs.0; Fri, 14 Apr 2017 22:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=BD7VUsaBcnwN4QaZQ2JOVR/Lez+QBvm6sY8eXr/WkFA=; b=S05IcGFlS5+tQl+G59tUHb36k9OKPg2xg/vzped6q1Tjap8t7P3dviRaAwv2QpK6Uc lFmBWcMlubRz1muk3r86hxSN4fTEssxGnG98R3EdiqoBCfUxvxEzxpWCuYH59otjFhzJ goMKeFnFt+DUTnUhI1Utpcsptupf8yCpJBkeOmJ5+1uZ0d74cmdqfbnFGfkHQ3PEa7b0 BTTQzZEZbJ39PE+kMp3Vm1jKmAI1NZydW2mZhPl6M7VRB1W1veslK3KCqk49OlBqN49G 71qq9gzqicD6NnTi2PIrL5u5qgHPqlD7uZx4w+tN8eiomMQXbynV0xaaYKcHcvc9uv0k uyWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=BD7VUsaBcnwN4QaZQ2JOVR/Lez+QBvm6sY8eXr/WkFA=; b=t/QYDX0lhTFcd/+Fo4QP4sQRaAXcHGWUdKup4DsTTcZ/QI9bChDShd1hCn2udqz6My qc9cqEjaTPj1UHUlBpi2sl2cqr8JTyIuu642ScIylHFBjdWTGsbBKRRkWM5/66pEKik7 8vseoIWOxbwHAVP54KpF6KEyOe5rOGMexovD8v29cyNtsjK2syJLEnlp/Dty1eCn6XtE qNWzUPx4sJ1R2tdS7q/cVOkq5tp3lN0mGs4VDaO+u6ha7amtwLzq7/xhETChitZFLxGy pyBkKC/MeDu1y+n7rw3lPB3RvEq+yh0ZvQQNgDV7qQ2dlGzCkNNP/NEnfxbsEahhsqN0 PNzw== X-Gm-Message-State: AN3rC/6Fej/yKxUVw5WsHVNtXi3PnyRqstPPqIFOm8tcn72ptupWEb13 TTtuhHA9FW9/D6rzACg= X-Received: by 10.98.28.193 with SMTP id c184mr1145477pfc.212.1492235013448; Fri, 14 Apr 2017 22:43:33 -0700 (PDT) Received: from raichu ([2604:4080:1102:0:ca60:ff:fe9d:3963]) by smtp.gmail.com with ESMTPSA id e131sm164794pfg.10.2017.04.14.22.43.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 22:43:32 -0700 (PDT) Sender: Mark Johnston Date: Fri, 14 Apr 2017 22:43:31 -0700 From: Mark Johnston To: Conrad Meyer Cc: Larry Rosenman , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Ngie Cooper Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170415054331.GB76139@raichu> References: <201704150135.v3F1ZD2S009211@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 05:43:34 -0000 On Fri, Apr 14, 2017 at 07:00:36PM -0700, Conrad Meyer wrote: > Larry, > > You just need to run netdumpd on the nearby server. It could be a > port (although I'm not aware that it is ported yet). I was working on a port makefile for netdumpd before this thread started. :) It would be a bit more usable as a port; I prefer it that way since Isilon's infrastructure folks would like to run netdumpd on 11.0. For what it's worth, I've got my revision of the code here: https://github.com/markjdb/netdumpd This version fixes some performance problems in the original, and runs most of the code in capability mode. The capsicum integration hasn't yet been reviewed, however. > > Best, > Conrad > > On Fri, Apr 14, 2017 at 6:37 PM, Larry Rosenman wrote: > > On 4/14/17, 8:35 PM, "Rodney W. Grimes" wrote: > > > >> Yeah, I have the following: > > > borg.lerctr.org /home/ler $ swapctl -l > > > Device: 1024-blocks Used: > > > /dev/mfid0p3 8388608 0 > > > /dev/mfid1p3 8388608 0 > > > /dev/mfid2p3 8388608 0 > > > /dev/mfid3p3 8388608 0 > > > /dev/mfid4p3 8388608 0 > > > /dev/mfid5p3 8388608 0 > > > borg.lerctr.org /home/ler $ sysctl hw.physmem > > > hw.physmem: 137368682496 > > > borg.lerctr.org /home/ler $ > > > > > > SO 6 8G partitions (48G), but the dump is larger than 8G. > > > > Larry, > > This is a very good concern and point given todays more > > common huge memory foot prints and lots of spindles. I'll > > keep this in they back of my mind as I tromp around in the > > dump code. I have another solution that may work for you > > and that is to use Netdump rather than swapdump. This > > basically eliminates the trip to swap space and you end > > up going to savecore style output on the netdump server. > > > > -- > > Rod Grimes rgrimes@freebsd.org > > > > What does it take for NetDump to work to a FreeNAS (9.10 nightly) server since that’s what is “next to†this server? > > > > > > > From owner-svn-src-all@freebsd.org Sat Apr 15 06:42:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA1A6D3F6BF; Sat, 15 Apr 2017 06:42:08 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2D936E3; Sat, 15 Apr 2017 06:42:08 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F6g5tm010450; Fri, 14 Apr 2017 23:42:05 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F6g41p010449; Fri, 14 Apr 2017 23:42:04 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150642.v3F6g41p010449@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <20170415053729.GA76139@raichu> To: Mark Johnston Date: Fri, 14 Apr 2017 23:42:04 -0700 (PDT) CC: rgrimes@freebsd.org, Alan Somers , Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 06:42:09 -0000 > On Fri, Apr 14, 2017 at 06:30:17PM -0700, Rodney W. Grimes wrote: > > > The patch to add compression support is here and should largely still > > > work: > > > https://people.freebsd.org/~markj/patches/core-compression/20141110-kern_dump.diff > > > > > > I've been hesitant about pushing it forward: > > > - The dump_write* APIs need some simplification after the addition of > > > encrypted dump support and support for dumping to 4Kn drives. > > > - I'm not sure how encryption should compose with compression. It seems > > > intuitively obvious that we should compress before encrypting if the > > > compression is to be of any use, but I don't know enough to know > > > whether the compression might somehow compromise the effectiveness of > > > the encryption. > > > > > > If anyone has some insight on the second of these two points, I'd > > > appreciate hearing it. > > > > I have a large amount of reworking and modulization of the dump code > > incuding intergration of your (markj) compressed dumps. Layer isnt > > implemented but is in the plan. I should not of held off on the net > > dump code as it got smashed by encrypted dumps, then again by > > the libif'ing for all the Intel drives that had been netdump modified. > > > > Basically now starting over :-( > > Could you post your patches somewhere? I've been sitting on this (and > the netdump patches, for which I have quite a few modifications) for far > too long, and would like to finish them and get them in soon. I'll note > that the netdump code posted a few years ago had some problems that are > fixed in Isilon's version, which I'm working on rebasing on HEAD. In Isnt the code I rebaed in December to -12 your code from Isiolon???? Or tell me you handed me your patches to upstream, and then continued to evolved the code without letting me know? Are YOUR patckes some place public? I dont think mine are, but I do have a link in http://people.freebsd.org/~rgrimes pointing to the other Netdump version that I think is an old version of your code. > particular, I simplified the driver integration a bit, changed the code > to avoid allocating mbufs from UMA after a panic, plumbed a > configuration interface through dumpon, and fixed some problems with > netdumpd. I'm working on integrating netdump with Isilon's internal > infrastructure at the moment. The conversion of em and igb to iflib does > complicate things a bit; I haven't yet looked at how hard it would be > to support netdump in iflib'ed drivers. > > > Minidump is an lkm for me, and main dump is almost an lkm for me too. > > Does "lkm" mean "loadable kernel module"? If so, why? Yes, so you dont have to reboot to write and debug new versions, so you can have a kernel without minidump if you want, and I am sure there are others. More importantly, why not? Modules are good, staticially linked rarely used code is bad. I also have a version of minidump that can be asked, if I panicked right now how big would hte dump be? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 06:53:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A817D3F92F; Sat, 15 Apr 2017 06:53:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0D2BCC9; Sat, 15 Apr 2017 06:53:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F6r85l081001; Sat, 15 Apr 2017 06:53:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F6r7hJ081000; Sat, 15 Apr 2017 06:53:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704150653.v3F6r7hJ081000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 15 Apr 2017 06:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316953 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 06:53:09 -0000 Author: ngie Date: Sat Apr 15 06:53:07 2017 New Revision: 316953 URL: https://svnweb.freebsd.org/changeset/base/316953 Log: Switch back to non-IEC units for 1024 bytes I was swayed a little too quickly when I saw the wiki page discussing kB vs KiB. Switch back as none of the code in base openly uses IEC units via humanize_number(3) (which was my next step), and there's a large degree of dislike with IEC vs more SI-like units. MFC after: 7 weeks Submitted by: jhb, rgrimes Sponsored by: Dell EMC Isilon Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Sat Apr 15 03:28:13 2017 (r316952) +++ head/sbin/savecore/savecore.c Sat Apr 15 06:53:07 2017 (r316953) @@ -322,7 +322,7 @@ check_space(const char *savedir, off_t d if (available < needed) { syslog(LOG_WARNING, "no dump: not enough free space on device (need at least " - "%jdKiB for dump; %jdKiB available; %jdKiB reserved)", + "%jdkB for dump; %jdkB available; %jdkB reserved)", (intmax_t)needed, (intmax_t)available + minfree, (intmax_t)minfree); From owner-svn-src-all@freebsd.org Sat Apr 15 06:55:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94A2AD3F9DD; Sat, 15 Apr 2017 06:55:24 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7822BE81; Sat, 15 Apr 2017 06:55:24 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F6tN5P010504; Fri, 14 Apr 2017 23:55:23 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F6tMvg010503; Fri, 14 Apr 2017 23:55:23 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150655.v3F6tMvg010503@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316953 - head/sbin/savecore In-Reply-To: <201704150653.v3F6r7hJ081000@repo.freebsd.org> To: Ngie Cooper Date: Fri, 14 Apr 2017 23:55:22 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 06:55:24 -0000 > Author: ngie > Date: Sat Apr 15 06:53:07 2017 > New Revision: 316953 > URL: https://svnweb.freebsd.org/changeset/base/316953 > > Log: > Switch back to non-IEC units for 1024 bytes > > I was swayed a little too quickly when I saw the wiki page discussing > kB vs KiB. Switch back as none of the code in base openly uses > IEC units via humanize_number(3) (which was my next step), and there's > a large degree of dislike with IEC vs more SI-like units. > > MFC after: 7 weeks > Submitted by: jhb, rgrimes > Sponsored by: Dell EMC Isilon > > Modified: > head/sbin/savecore/savecore.c > > Modified: head/sbin/savecore/savecore.c > ============================================================================== > --- head/sbin/savecore/savecore.c Sat Apr 15 03:28:13 2017 (r316952) > +++ head/sbin/savecore/savecore.c Sat Apr 15 06:53:07 2017 (r316953) > @@ -322,7 +322,7 @@ check_space(const char *savedir, off_t d > if (available < needed) { > syslog(LOG_WARNING, > "no dump: not enough free space on device (need at least " > - "%jdKiB for dump; %jdKiB available; %jdKiB reserved)", > + "%jdkB for dump; %jdkB available; %jdkB reserved)", > (intmax_t)needed, > (intmax_t)available + minfree, > (intmax_t)minfree); Thank you! -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 06:59:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE63FD3FB08; Sat, 15 Apr 2017 06:59:00 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C84C4A0; Sat, 15 Apr 2017 06:59:00 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 94EE75B4; Fri, 14 Apr 2017 23:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1492239539; bh=JQXK13kc4JvQcILPSn/aG6FqsfP/HE0UDbkepQ/3yoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=erV80m+ZrW+lNNT0+HhO+AxWnU+Kf8F5JFNQRDOll4gdMO3kqeO99/BNThEBuDLOO rXMf2rOrQO/qCnvq39lQ1L4/e6v7FDZbQ+yi8hix7CJHizKkQ1O8G/dcsDz81oAxYI UDfqSnVa8hF4HdBDVntiuHWWPuOAsTI+TfEiTtNg= From: Peter Wemm To: "Ngie Cooper (yaneurabeya)" Cc: svn-src-all@freebsd.org, src-committers , Hiroki Sato , Hiren Panchasara , svn-src-head@freebsd.org, Maxim Sobolev Subject: Re: svn commit: r316874 - head/sys/kern Date: Fri, 14 Apr 2017 23:58:55 -0700 Message-ID: <11221477.gRA6BXfcIE@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <2109294.KVn8xeR1jZ@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart10292938.hy7NMZA4S1"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 06:59:01 -0000 --nextPart10292938.hy7NMZA4S1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday, April 14, 2017 08:13:52 PM Ngie Cooper wrote: > > On Apr 14, 2017, at 20:12, Peter Wemm wrote: > >=20 > > On Friday, April 14, 2017 07:36:55 PM Peter Wemm wrote: > >> On Friday, April 14, 2017 02:14:16 PM Ngie Cooper wrote: > >>>> On Apr 14, 2017, at 14:10, Maxim Sobolev = wrote: > >>>>=20 > >>>> Peter, Ngie, > >>>>=20 > >>>> Looks like out of that refactoring came a logical bug that is pr= esent > >>>> in > >>>> the head, which causes syslod to first to shutdown the socket fo= r > >>>> reading > >>>> and then try to select/recv on it (which is somewhat stupid). An= d that > >>>> issue has been masked by shutdown() on datagram socket becoming > >>>> effectively a NOP in 11 & head 20 months ago. It only affects he= ad > >>>> though, 11-stable still has the old code which does not include = that > >>>> half-closed socket into the select list. Attached patch is expec= ted to > >>>> fix head, Peter, it would be nice if you can give it a try (rest= oring > >>>> latest changes into uipc_sockets.c) and let me know if it helps.= > >>>>=20 > >>>> Thanks! > >>>=20 > >>> CCing hrs@ for input as he did the refactoring. > >>> Thanks! > >>> -Ngie > >>>=20 > >>> PS LGTM with the change. Will wait for feedback from wemm@. > >>=20 > >> This is definitely not working. I get ENOSPC and listen queue ov= erflows > >> on /var/run/logpriv now. > >>=20 > >> Grabbing an old 10.3 /usr/sbin/syslogd and placing it on the top o= f the > >> 12.x one worked fine, aside from the include statements. > >=20 > > This can't be right: > > if (SecureMode || res->ai_family =3D=3D AF_LOCAL) {= > > =20 > > /* Forbid communication in secure mode. */ > > if (shutdown(s, SHUT_RD) < 0 && > > =20 > > errno !=3D ENOTCONN) { > > =20 > > logerror("shutdown"); > > if (!Debug) > > =20 > > die(0); > > =20 > > } > > dprintf("listening on socket\n"); > > sl_recv =3D NULL; > > =20 > > } > >=20 > > This appears to disable unix domain sockets like /var/run/log and > > /var/run/logpriv. >=20 > ACK. This looks like a fun bug. > -Ngie I suspect it's meant to be "if (SecureMode && res->ai_family !=3D AF_LO= CAL) {"=20 as a simple logic inversion error of another line earlier. However the= re's an=20 awful lot of strange things in this code. 1) listen(s, 5) - on datagram sockets. 2) dprintf("shutdown") in code regardless of whether the shutdown is go= ing to=20 happen. 3) dprintf("listening on socket") in code that only happens when we're = NOT=20 going to listen. 4) dprintf("sending on socket") in the code path when we're going to li= sten. 5) shutdown on all unix domain sockets, regardless of securemode.. This code block makes my head spin. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart10292938.hy7NMZA4S1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAljxxK8ACgkQNdaXCeyA ngTWzAgAwTxqh8URPRWoP4xssbIcrHxQp24Vo3b2ybHpVmG+4VNudT2X2gb5tRso CpCy4rMNZd8OY+rIcC8lzIexFgmvnwGEfZQgBjXiDK1cup5ylg6aR/CPziJ38jk/ uR56sh3hPiIONPHht5TlRrXpZAMN3NrX08GqTP1gXC5uoB0nCViffBkew+54bK+h OduYGUkqkiIV2aHzVKDX/sv8dnqS0SOJKZIf4YRyDp5qyg3Wu2yAj7427+vI2pPc d1R4A5BHajEPLcxssFRWD/SQug0hUG7cZwyX7d8qoD3LqZEFecF/Oe3sdJAFFiQZ ZGxmddHKfLwJhhtvOwIbYn+4IFvc9g== =XJBZ -----END PGP SIGNATURE----- --nextPart10292938.hy7NMZA4S1-- From owner-svn-src-all@freebsd.org Sat Apr 15 07:12:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18BEED3FF1C; Sat, 15 Apr 2017 07:12:47 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf0-x22a.google.com (mail-pf0-x22a.google.com [IPv6:2607:f8b0:400e:c00::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB5E2B54; Sat, 15 Apr 2017 07:12:46 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf0-x22a.google.com with SMTP id s16so48154878pfs.0; Sat, 15 Apr 2017 00:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=oZZv8PFhZ9HAk7iLSf5uS9UsFwa4APOBnVnrMmTJXYs=; b=Z9jDK+2vs75B94SmrBZCyLgDLT4mWNVMQvSlfuis6liae7znW2wJ0RfdKrGMpQIGiP dHkXWMfBcRAcA7lsHpf/ZKoWUmkoJrZ5ocXlebXdkTleBidLR41opQb/4IZOT6sN3LAy 1d9Cgxier7HfLeWa1AFcca6Z1O9VRdRNpy000GQAu3MaCfij4UQIrDmJmlBtVeNxAH1w 1kgbx2aXwQMRevk/2hgQ9NqdyYF/8iMUVXF1LBvmk8hyqAOkY/1EiPlw+jA+2hojt4Vn zGdB/Xi1f+aB3rYahT2IkZSAzVaLks/pVAyzlQRIcv4h4WjQB8TJISxwJpB87IRL5VJS B4ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=oZZv8PFhZ9HAk7iLSf5uS9UsFwa4APOBnVnrMmTJXYs=; b=TW9WGeNTH1kZBCMOo2lfpw/MaL29hsu3Ay+BRayOF//H+q1VEq12iVRX6bCFoHZozX DOqnD0hAJKcgCxQmbLyQA4HWHF/4UlKojB5g+0Uu2qWw0SRuQmHbYO2GJfMhZQUyXLPd UC1G6CrrqCHWdOiuI4euOP4TJky4Pw2KKN4QZSZlJmwtqnLdQ1KJqMLpIyaKfwCYt89h +QAbsCaiKMPYo5wpYT+05zBBUd39qn7vRq0l7jlVReEPuoHSSs9GXTMvZ/Y8HepWAQKn 8hB/3slibTmEmjqqtCA8M0RIhmEKh4rx7X+dfT6EfrzU5sP1xAzD2ER22E3CmkekmNVa a4bQ== X-Gm-Message-State: AN3rC/4Fh9orriDO7fO53NDlwpv3TVM3mZh8AashYbZTxoquZYTlyQ17 KqiwH6bopJdI+qEs X-Received: by 10.98.44.142 with SMTP id s136mr1429244pfs.244.1492240366384; Sat, 15 Apr 2017 00:12:46 -0700 (PDT) Received: from ox ([2601:641:c000:b800:201d:8cb6:8467:a85c]) by smtp.gmail.com with ESMTPSA id p80sm6676691pfk.50.2017.04.15.00.12.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Apr 2017 00:12:45 -0700 (PDT) Sender: Navdeep Parhar Date: Sat, 15 Apr 2017 00:12:33 -0700 From: Navdeep Parhar To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316936 - head/sys/dev/cxgbe/iw_cxgbe Message-ID: <20170415071233.GA12250@ox> Mail-Followup-To: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704141915.v3EJFVMX093441@repo.freebsd.org> <201704150115.v3F1FAbU009132@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704150115.v3F1FAbU009132@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 07:12:47 -0000 On Fri, Apr 14, 2017 at 06:15:10PM -0700, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: np > > Date: Fri Apr 14 19:15:31 2017 > > New Revision: 316936 > > URL: https://svnweb.freebsd.org/changeset/base/316936 > > > > Log: > > cxgbe/iw_cxgbe: hw supports 64K (not 32K) Protection Domains. > > > > MFC after: 3 days > > Sponsored by: Chelsio Communications > > > > Modified: > > head/sys/dev/cxgbe/iw_cxgbe/t4.h > > > > Modified: head/sys/dev/cxgbe/iw_cxgbe/t4.h > > ============================================================================== > > --- head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 18:56:00 2017 (r316935) > > +++ head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 19:15:31 2017 (r316936) > > @@ -61,7 +61,7 @@ > > > > #define T4_MAX_NUM_QP (1<<16) > > #define T4_MAX_NUM_CQ (1<<15) > > -#define T4_MAX_NUM_PD (1<<15) > > +#define T4_MAX_NUM_PD 65536 > > Why the change in methods of expressing powers of 2 here? > This, imho, would better match the near by code as > #define T4_MAX_NUM_PD (1<<16) > r316940 removed both of the 1< Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38709D3E1ED; Sat, 15 Apr 2017 07:27:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D507F85; Sat, 15 Apr 2017 07:27:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3F7Rtql010659; Sat, 15 Apr 2017 00:27:55 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3F7Rt9e010658; Sat, 15 Apr 2017 00:27:55 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704150727.v3F7Rt9e010658@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316936 - head/sys/dev/cxgbe/iw_cxgbe In-Reply-To: <20170415071233.GA12250@ox> To: Navdeep Parhar Date: Sat, 15 Apr 2017 00:27:55 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 07:27:57 -0000 > On Fri, Apr 14, 2017 at 06:15:10PM -0700, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > > > Author: np > > > Date: Fri Apr 14 19:15:31 2017 > > > New Revision: 316936 > > > URL: https://svnweb.freebsd.org/changeset/base/316936 > > > > > > Log: > > > cxgbe/iw_cxgbe: hw supports 64K (not 32K) Protection Domains. > > > > > > MFC after: 3 days > > > Sponsored by: Chelsio Communications > > > > > > Modified: > > > head/sys/dev/cxgbe/iw_cxgbe/t4.h > > > > > > Modified: head/sys/dev/cxgbe/iw_cxgbe/t4.h > > > ============================================================================== > > > --- head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 18:56:00 2017 (r316935) > > > +++ head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 19:15:31 2017 (r316936) > > > @@ -61,7 +61,7 @@ > > > > > > #define T4_MAX_NUM_QP (1<<16) > > > #define T4_MAX_NUM_CQ (1<<15) > > > -#define T4_MAX_NUM_PD (1<<15) > > > +#define T4_MAX_NUM_PD 65536 > > > > Why the change in methods of expressing powers of 2 here? > > This, imho, would better match the near by code as > > #define T4_MAX_NUM_PD (1<<16) > > > > r316940 removed both of the 1< in this part of the header match nearby code: > > #define T4_MAX_NUM_PD 65536 > #define T4_MAX_EQ_SIZE 65520 > #define T4_MAX_IQ_SIZE 65520 > #define T4_MAX_RQ_SIZE(n) (8192 - (n) - 1) ^^^ unexplained off by 1 Magic??? Ok, but why not code those as (1<<16), ((1<<16)-16) to me it makes it more clear as to what is going on here. I suspect the -16 is actually sizeof(something). So even more clear is to do something like: #define X ((1<<16)-sizeof(somethingXreleated)) Magic constants like 65520 that dont even have a comment as to why they are 65520 are in bad form as well. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 08:11:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41FC1D3C258; Sat, 15 Apr 2017 08:11:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id CDB0881B; Sat, 15 Apr 2017 08:11:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id C67691A2B48; Sat, 15 Apr 2017 18:11:35 +1000 (AEST) Date: Sat, 15 Apr 2017 18:11:34 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ngie Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316953 - head/sbin/savecore In-Reply-To: <201704150653.v3F6r7hJ081000@repo.freebsd.org> Message-ID: <20170415170730.T1682@besplex.bde.org> References: <201704150653.v3F6r7hJ081000@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=AYLBJzfG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=obLidZeR02VS5v7W5h0A:9 a=yYNlLnx4y4jV7yTa:21 a=NO8rpTwOmFYFgm1h:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 08:11:46 -0000 On Sat, 15 Apr 2017, Ngie Cooper wrote: > Log: > Switch back to non-IEC units for 1024 bytes > > I was swayed a little too quickly when I saw the wiki page discussing > kB vs KiB. Switch back as none of the code in base openly uses > IEC units via humanize_number(3) (which was my next step), and there's > a large degree of dislike with IEC vs more SI-like units. > Modified: head/sbin/savecore/savecore.c > ============================================================================== > --- head/sbin/savecore/savecore.c Sat Apr 15 03:28:13 2017 (r316952) > +++ head/sbin/savecore/savecore.c Sat Apr 15 06:53:07 2017 (r316953) > @@ -322,7 +322,7 @@ check_space(const char *savedir, off_t d > if (available < needed) { > syslog(LOG_WARNING, > "no dump: not enough free space on device (need at least " > - "%jdKiB for dump; %jdKiB available; %jdKiB reserved)", > + "%jdkB for dump; %jdkB available; %jdkB reserved)", > (intmax_t)needed, > (intmax_t)available + minfree, > (intmax_t)minfree); Thanks, but kB is almost as uncouth as KiB. Real K are in K or KB (except for thermodynamicists, reak K are temperatures), and the K are real here. It would have been reasonable to standardize kB for disk sellers' kilobytes, but K was already taken for "Kelvin" in dehumanized (scientific) units, and the same method was unavailable for disk seller's megabytes since m was already taken for "milli". (Since millibytes don't exist, mB for disk sellers' megabytes would work OK, but it needs the B suffix.) "M" is also needed for decimal "million" in frequency and network bandwidth descriptions. For network bandwidths the uncouth term is mb/sec (millibits per second), or better yet, mbs (master of business selling or millibit-seconds). dehumanize^Wscientificize^Whumanize_number(3) does use k for 1000 and K for 1024. This is actually documented. dedehumanize^descientificize^Wexpand_number() doesn't understand this or any of the uncouth formats produced by dehumanize_number(). It has undocumented support for other lower case "prefixes" and only supports upper case ones by converting to lower case. For k and K, this immediately forgets the difference. dedehumanize_number() only supports powers of 2. So when dehumanize_number() prints 1000 as 1k, dedehumanize_number() misparses it the same as 1K and produces 1024 for both. dedehumanize_number() has undocumented support for a [bB] suffix. It is unclear if this suffix is for bytes or the common zeroth power of 2 and 10. dedehumanize_number() has related parsing errors. It stops after the first letter after digits. So it correctly parses 1iKB as garbage, but it parses 1KiB as 1K and discards the the garbage after the K. dehumanize_number() documents B a bit better, but says that it is a "prefix" meaning "bytes". But since it means "bytes", it is a pure suffix. The other "prefixes" are also suffixes in normal use. They are suffixes to the number and only prefixes to the units, but the units are normally left out. It is confusing to describe prefixes to empty strings as being prefixes. [bB] should also be avoided as a "prefix" since in dd it actually is a prefix, meaning 512-blocks. dd has much better number parsers than dedehumanize_number(), with less than 100 known bugs (counting duplicated bugs separately). It supports almost any number of prefixes with any values as multipliers. E.g., bs=1 iseek='1024*1000*1000*1000' seeks through a real K of disk sellers' GB. It even attempts to detect overflow in the multiplications and shifts. To get near 100 bugs in it, I count minor things like: - no support for E (exa) - 8 bugs for the 8 supported multiplier letters by accepting both uppor and lower case as meaning powers of 2. Letters are in short supply even for powers of 2. Backwards compatibilty prevents changing the meaning of k to 1000. This was originally broken by only using lower case letters. This wasn't unimproved until 2004 when upper case aliases were added. Bruce From owner-svn-src-all@freebsd.org Sat Apr 15 08:23:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C6EED3C55F; Sat, 15 Apr 2017 08:23:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 49D49E69; Sat, 15 Apr 2017 08:23:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 4C2DF1044DFC; Sat, 15 Apr 2017 18:23:16 +1000 (AEST) Date: Sat, 15 Apr 2017 18:23:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: rgrimes@freebsd.org cc: Navdeep Parhar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316936 - head/sys/dev/cxgbe/iw_cxgbe In-Reply-To: <201704150727.v3F7Rt9e010658@pdx.rh.CN85.dnsmgr.net> Message-ID: <20170415181258.E1854@besplex.bde.org> References: <201704150727.v3F7Rt9e010658@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=XnfSFxyx20jCCp17jlQA:9 a=THTVO4oSvBJ2XBti:21 a=NLJJKto-OsRgpRGp:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 08:23:24 -0000 On Sat, 15 Apr 2017, Rodney W. Grimes wrote: >> On Fri, Apr 14, 2017 at 06:15:10PM -0700, Rodney W. Grimes wrote: >>> [ Charset UTF-8 unsupported, converting... ] >>>> Author: np >>>> Date: Fri Apr 14 19:15:31 2017 >>>> New Revision: 316936 >>>> URL: https://svnweb.freebsd.org/changeset/base/316936 >>>> >>>> Log: >>>> cxgbe/iw_cxgbe: hw supports 64K (not 32K) Protection Domains. >>>> >>>> MFC after: 3 days >>>> Sponsored by: Chelsio Communications >>>> >>>> Modified: >>>> head/sys/dev/cxgbe/iw_cxgbe/t4.h >>>> >>>> Modified: head/sys/dev/cxgbe/iw_cxgbe/t4.h >>>> ============================================================================== >>>> --- head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 18:56:00 2017 (r316935) >>>> +++ head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Apr 14 19:15:31 2017 (r316936) >>>> @@ -61,7 +61,7 @@ >>>> >>>> #define T4_MAX_NUM_QP (1<<16) >>>> #define T4_MAX_NUM_CQ (1<<15) >>>> -#define T4_MAX_NUM_PD (1<<15) >>>> +#define T4_MAX_NUM_PD 65536 >>> >>> Why the change in methods of expressing powers of 2 here? >>> This, imho, would better match the near by code as >>> #define T4_MAX_NUM_PD (1<<16) >> >> r316940 removed both of the 1<> in this part of the header match nearby code: >> >> #define T4_MAX_NUM_PD 65536 >> #define T4_MAX_EQ_SIZE 65520 >> #define T4_MAX_IQ_SIZE 65520 >> #define T4_MAX_RQ_SIZE(n) (8192 - (n) - 1) > ^^^ unexplained off by 1 Magic??? > > Ok, but why not code those as (1<<16), ((1<<16)-16) to me it makes > it more clear as to what is going on here. I suspect the -16 is > actually sizeof(something). So even more clear is > to do something like: > #define X ((1<<16)-sizeof(somethingXreleated)) > > Magic constants like 65520 that dont even have a comment as to > why they are 65520 are in bad form as well. When the expressions are even slightly complicated, it can be better to have magic numbers (but spell ones near 64K in hex). Try vmparam.h and related files to figure out where basic addresses are. Most are perfectly unreadably parametrized by going through about 5 layers of nested macros leading back to not very many basic parameters. Bruce From owner-svn-src-all@freebsd.org Sat Apr 15 08:39:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFC31D3C9F0; Sat, 15 Apr 2017 08:39:56 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FA9B6DB; Sat, 15 Apr 2017 08:39:56 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1czJFI-000LrG-RZ; Sat, 15 Apr 2017 11:39:52 +0300 Date: Sat, 15 Apr 2017 11:39:52 +0300 From: Slawa Olhovchenkov To: Mark Johnston Cc: Xin LI , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170415083952.GA83631@zxy.spb.ru> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> <20170414220525.GF5039@wkstn-mjohnston.west.isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170414220525.GF5039@wkstn-mjohnston.west.isilon.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 08:39:57 -0000 On Fri, Apr 14, 2017 at 03:05:25PM -0700, Mark Johnston wrote: > > And with textdumps available, the benefit > > of having compression is limited because we can request for minidump > > or full dumps only when the textdumps are not good enough for > > diagnosing the kernel bug. > > Sure, but in this case the compression may be vital. > > > > > I don't think security (e.g. leaking information because of the use of > > compression) is a very big concern in this context because in order > > for the potential attacker to read the raw material needs a > > compromised system (unlike an attack from the network, where someone > > who controls the network would have access to the raw material); the > > dump is usually quite large, and measuring downtime would be hard at > > that scale. > > Ok. > > > > > By the way (not meant to bikeshed) if I was to do this I'd prefer > > using lz4 or something that compresses faster than zlib. > > I agree, but I think the existing lz4 implementation in the kernel is > not so well suited to running after a panic. It seems fixable, but > compression speed also isn't hugely important here IMO. On production system this is downtime. For may case, dumped about 32GB (from 256GB RAM). This is take several minutes. Can compression increase this to hour? From owner-svn-src-all@freebsd.org Sat Apr 15 09:33:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDDEBD3FC6D; Sat, 15 Apr 2017 09:33:43 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D92A96F; Sat, 15 Apr 2017 09:33:43 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F9Xgi3045423; Sat, 15 Apr 2017 09:33:42 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F9XgfZ045420; Sat, 15 Apr 2017 09:33:42 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201704150933.v3F9XgfZ045420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Sat, 15 Apr 2017 09:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316955 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 09:33:43 -0000 Author: avatar Date: Sat Apr 15 09:33:42 2017 New Revision: 316955 URL: https://svnweb.freebsd.org/changeset/base/316955 Log: MFC 316644: Trying to be more compatible with Linux if.h definitions: - renaming l_ifreq::ifru_metric to l_ifreq::ifru_ivalue; - adding a definition for ifr_ifindex which points to l_ifreq::ifru_ivalue. A quick search indicates that Linux already got the above changes since 2.1.14. Reviewed by: kib, marcel, dchagin Modified: stable/11/sys/amd64/linux/linux.h stable/11/sys/amd64/linux32/linux.h stable/11/sys/i386/linux/linux.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux.h ============================================================================== --- stable/11/sys/amd64/linux/linux.h Sat Apr 15 07:32:57 2017 (r316954) +++ stable/11/sys/amd64/linux/linux.h Sat Apr 15 09:33:42 2017 (r316955) @@ -464,7 +464,7 @@ struct l_ifreq { struct l_sockaddr ifru_netmask; struct l_sockaddr ifru_hwaddr; l_short ifru_flags[1]; - l_int ifru_metric; + l_int ifru_ivalue; l_int ifru_mtu; struct l_ifmap ifru_map; char ifru_slave[LINUX_IFNAMSIZ]; @@ -474,6 +474,7 @@ struct l_ifreq { #define ifr_name ifr_ifrn.ifrn_name /* Interface name */ #define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ +#define ifr_ifindex ifr_ifru.ifru_ivalue /* Interface index */ struct l_ifconf { int ifc_len; Modified: stable/11/sys/amd64/linux32/linux.h ============================================================================== --- stable/11/sys/amd64/linux32/linux.h Sat Apr 15 07:32:57 2017 (r316954) +++ stable/11/sys/amd64/linux32/linux.h Sat Apr 15 09:33:42 2017 (r316955) @@ -544,7 +544,7 @@ struct l_ifreq { struct l_sockaddr ifru_netmask; struct l_sockaddr ifru_hwaddr; l_short ifru_flags[1]; - l_int ifru_metric; + l_int ifru_ivalue; l_int ifru_mtu; struct l_ifmap ifru_map; char ifru_slave[LINUX_IFNAMSIZ]; @@ -554,6 +554,7 @@ struct l_ifreq { #define ifr_name ifr_ifrn.ifrn_name /* Interface name */ #define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ +#define ifr_ifindex ifr_ifru.ifru_ivalue /* Interface index */ struct l_ifconf { int ifc_len; Modified: stable/11/sys/i386/linux/linux.h ============================================================================== --- stable/11/sys/i386/linux/linux.h Sat Apr 15 07:32:57 2017 (r316954) +++ stable/11/sys/i386/linux/linux.h Sat Apr 15 09:33:42 2017 (r316955) @@ -523,7 +523,7 @@ struct l_ifreq { struct l_sockaddr ifru_netmask; struct l_sockaddr ifru_hwaddr; l_short ifru_flags[1]; - l_int ifru_metric; + l_int ifru_ivalue; l_int ifru_mtu; struct l_ifmap ifru_map; char ifru_slave[LINUX_IFNAMSIZ]; @@ -533,6 +533,7 @@ struct l_ifreq { #define ifr_name ifr_ifrn.ifrn_name /* Interface name */ #define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ +#define ifr_ifindex ifr_ifru.ifru_ivalue /* Interface index */ /* * poll() From owner-svn-src-all@freebsd.org Sat Apr 15 09:56:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A14B4D3C5CD; Sat, 15 Apr 2017 09:56:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC5C892; Sat, 15 Apr 2017 09:56:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F9ugS4053775; Sat, 15 Apr 2017 09:56:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F9ugob053774; Sat, 15 Apr 2017 09:56:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704150956.v3F9ugob053774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 09:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316956 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 09:56:43 -0000 Author: bapt Date: Sat Apr 15 09:56:42 2017 New Revision: 316956 URL: https://svnweb.freebsd.org/changeset/base/316956 Log: Update to 2017.04.03 Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Sat Apr 15 09:33:42 2017 (r316955) +++ head/share/misc/pci_vendors Sat Apr 15 09:56:42 2017 (r316956) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.03.16 -# Date: 2017-03-16 03:15:01 +# Version: 2017.04.03 +# Date: 2017-04-03 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -10674,7 +10674,7 @@ 1430 GM206GL [Quadro M2000] 1431 GM206GL [Tesla M4] 1436 GM206GLM [Quadro M2200 Mobile] - 15f0 GP100GL + 15f0 GP100GL [Quadro GP100] 15f1 GP100GL 15f7 GP100GL [Tesla P100 PCIe 12GB] 15f8 GP100GL [Tesla P100 PCIe 16GB] @@ -10707,7 +10707,7 @@ 1ba0 GP104M [GeForce GTX 1080 Mobile] 1ba1 GP104M [GeForce GTX 1070 Mobile] 1bb0 GP104GL [Quadro P5000] - 1bb1 GP104GL + 1bb1 GP104GL [Quadro P4000] 1bb3 GP104GL [Tesla P4] 1bb4 GP104GL 1bb6 GP104GLM [Quadro P5000 Mobile] @@ -10720,7 +10720,7 @@ 1c02 GP106 [GeForce GTX 1060 3GB] 1c03 GP106 [GeForce GTX 1060 6GB] 1c20 GP106M [GeForce GTX 1060 Mobile] - 1c30 GP106GL + 1c30 GP106GL [Quadro P2000] 1c35 GP106 1c60 GP106M [GeForce GTX 1060 Mobile] 1c61 GP106M [GeForce GTX 1050 Ti Mobile] @@ -10735,6 +10735,9 @@ 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL + 1cb1 GP107GL [Quardo P1000] + 1cb2 GP107GL [Quardo P600] + 1cb3 GP107GL [Quardo P400] 1d01 GP108 1d81 GV100 10df Emulex Corporation @@ -16467,7 +16470,7 @@ 1028 1fc2 Express Flash NVMe PM1725 1.6TB SFF 1028 1fc4 Express Flash NVMe PM1725 1.6TB AIC a822 NVMe SSD Controller 172Xa - 1028 1fd9 Express Flash NVMe PM1725a 800GB SFF + 1028 1fd9 Express Flash PM1725a 800GB SFF 1028 1fda Express Flash PM1725a 1.6TB SFF 1028 1fdb Express Flash PM1725a 3.2TB SFF 1028 1fdc Express Flash PM1725a 6.4TB SFF @@ -20300,6 +20303,7 @@ 1b79 Absolute Analysis 1b85 OCZ Technology Group, Inc. 1041 RevoDrive 3 X2 PCI-Express SSD 240 GB (Marvell Controller) + 6018 RD400/400A SSD 8788 RevoDrive Hybrid 1b94 Signatec / Dynamic Signals Corp e400 PX14400 Dual Xilinx Virtex5 based Digitizer @@ -23094,6 +23098,7 @@ 8086 0000 Ethernet Converged Network Adapter X710-T 8086 0001 Ethernet Converged Network Adapter X710-T4 8086 0002 Ethernet Converged Network Adapter X710-T4 + 8086 0003 Ethernet Converged Network Adapter X710-T 8086 1003 Ethernet Converged Network Adapter X710-T 158a Ethernet Controller XXV710 for 25GbE backplane 158b Ethernet Controller XXV710 for 25GbE SFP28 @@ -27004,7 +27009,7 @@ 1001 8086 mPCI 3B Europe ZZE 1002 8086 mPCI 3B Japan ZZJ 1003 8086 mPCI 3B High-Band ZZH - 1351 103c Compaq NC6220 + 103c 1351 Compaq nc6220 4224 PRO/Wireless 2915ABG [Calexico2] Network Connection 4227 PRO/Wireless 3945ABG [Golan] Network Connection 8086 1010 ThinkPad R60e @@ -27127,6 +27132,7 @@ 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine 5902 HD Graphics 610 + 5912 HD Graphics 630 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller 5a88 Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit 5a98 Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster From owner-svn-src-all@freebsd.org Sat Apr 15 11:00:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F0EAD3DD6B for ; Sat, 15 Apr 2017 11:00:28 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34E3087D for ; Sat, 15 Apr 2017 11:00:28 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-it0-x22b.google.com with SMTP id b15so5916491iti.1 for ; Sat, 15 Apr 2017 04:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=60fVQhkct5u0itCHcRSu+pTGq9Bkbgi0zZWye7m03ak=; b=HFrbFjRW4kBnlaPZBzzFk5EUh/Xx8V+2CKJxlqwc3dbHANAnt0/7+0Nep1/oqjwlBM EtVZ5ytvzyMxfAsy9m65T+QQioUD0LYHWqZE10O7AH3XFsXGcV1pQJn1jkjF6C5moMK6 hg/7bPDCv5kXzVfRPOU+MeBVYmbQ3xfwMb2Wt+SGEGzIRyF7NUWa9FTObHW2GOlizUCV TWZzScJ/c6SbDUrdvo4x2sZGdCKJfoiCK3y+1zeX3Ddp/UW5BZihmQcDHYbT9AeaDXPB vv98xm28AtU2LrVcdPqBrGcrgyDQHPMZnANLicwHYtmojIjazNb3G46jy3Y+9Y29osJz Xyig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=60fVQhkct5u0itCHcRSu+pTGq9Bkbgi0zZWye7m03ak=; b=kkB8l5CKsoYH9ov9BI62UPCZG5g+HjapUVOPoyQNzZC9UVHstnwb1yCTfrU43XmObW zAhmzLUsTIlMls++Mspo6eNLDiC1/SPIY+alawjwbiYhIZWRZYLj3IYmVpf+qvQIyN4w BsmnHyUYUx+iuUh3DBA2jbHwaMF3wH0w3xUW/65NSGwcfA73G1SCompRf4P6yE3XOCuR RUs//eFgo8Kfab5wKucY/kfv8SshCAe7XCatxBgFku0VyqRhjT6oi0zQKFsT+yw4uFBj XVRsaxO+T2KjI9i23Oj923Nn4Z8dri/d7jdwTCx8VvOwMTe7aRuVzLtUxXwcsbmrHjQO mKBQ== X-Gm-Message-State: AN3rC/4YLXHQf5UYUvZYSDkLuISVPcFZfVkOXz0W0YaOc1+bqUQ0VXUn m0T0U9ryJph7KMQJ2FZkyq5gYmtxez5V X-Received: by 10.36.213.3 with SMTP id a3mr1577012itg.106.1492254027517; Sat, 15 Apr 2017 04:00:27 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.104.135 with HTTP; Sat, 15 Apr 2017 04:00:27 -0700 (PDT) In-Reply-To: <11221477.gRA6BXfcIE@overcee.wemm.org> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <2109294.KVn8xeR1jZ@overcee.wemm.org> <11221477.gRA6BXfcIE@overcee.wemm.org> From: Maxim Sobolev Date: Sat, 15 Apr 2017 04:00:27 -0700 X-Google-Sender-Auth: BJWAbN0NakrI4QHXYjpmFGGOfr4 Message-ID: Subject: Re: svn commit: r316874 - head/sys/kern To: Peter Wemm Cc: "Ngie Cooper (yaneurabeya)" , svn-src-all@freebsd.org, src-committers , Hiroki Sato , Hiren Panchasara , svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 11:00:28 -0000 Peter, Ngie, none of this stuff is really directly related to the shutdown(2) change, so I'll probably let Hiroki to clean it up. -Max On Fri, Apr 14, 2017 at 11:58 PM, Peter Wemm wrote: > On Friday, April 14, 2017 08:13:52 PM Ngie Cooper wrote: > > > On Apr 14, 2017, at 20:12, Peter Wemm wrote: > > > > > > On Friday, April 14, 2017 07:36:55 PM Peter Wemm wrote: > > >> On Friday, April 14, 2017 02:14:16 PM Ngie Cooper wrote: > > >>>> On Apr 14, 2017, at 14:10, Maxim Sobolev > wrote: > > >>>> > > >>>> Peter, Ngie, > > >>>> > > >>>> Looks like out of that refactoring came a logical bug that is > present > > >>>> in > > >>>> the head, which causes syslod to first to shutdown the socket for > > >>>> reading > > >>>> and then try to select/recv on it (which is somewhat stupid). And > that > > >>>> issue has been masked by shutdown() on datagram socket becoming > > >>>> effectively a NOP in 11 & head 20 months ago. It only affects head > > >>>> though, 11-stable still has the old code which does not include that > > >>>> half-closed socket into the select list. Attached patch is expected > to > > >>>> fix head, Peter, it would be nice if you can give it a try > (restoring > > >>>> latest changes into uipc_sockets.c) and let me know if it helps. > > >>>> > > >>>> Thanks! > > >>> > > >>> CCing hrs@ for input as he did the refactoring. > > >>> Thanks! > > >>> -Ngie > > >>> > > >>> PS LGTM with the change. Will wait for feedback from wemm@. > > >> > > >> This is definitely not working. I get ENOSPC and listen queue > overflows > > >> on /var/run/logpriv now. > > >> > > >> Grabbing an old 10.3 /usr/sbin/syslogd and placing it on the top of > the > > >> 12.x one worked fine, aside from the include statements. > > > > > > This can't be right: > > > if (SecureMode || res->ai_family == AF_LOCAL) { > > > > > > /* Forbid communication in secure mode. */ > > > if (shutdown(s, SHUT_RD) < 0 && > > > > > > errno != ENOTCONN) { > > > > > > logerror("shutdown"); > > > if (!Debug) > > > > > > die(0); > > > > > > } > > > dprintf("listening on socket\n"); > > > sl_recv = NULL; > > > > > > } > > > > > > This appears to disable unix domain sockets like /var/run/log and > > > /var/run/logpriv. > > > > ACK. This looks like a fun bug. > > > -Ngie > > I suspect it's meant to be "if (SecureMode && res->ai_family != AF_LOCAL) > {" > as a simple logic inversion error of another line earlier. However > there's an > awful lot of strange things in this code. > > 1) listen(s, 5) - on datagram sockets. > 2) dprintf("shutdown") in code regardless of whether the shutdown is going > to > happen. > 3) dprintf("listening on socket") in code that only happens when we're NOT > going to listen. > 4) dprintf("sending on socket") in the code path when we're going to > listen. > 5) shutdown on all unix domain sockets, regardless of securemode.. > > This code block makes my head spin. > > -- > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; > KI6FJV > UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 > From owner-svn-src-all@freebsd.org Sat Apr 15 11:13:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A73ACD3E413; Sat, 15 Apr 2017 11:13:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51744226; Sat, 15 Apr 2017 11:13:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FBDC0r085772; Sat, 15 Apr 2017 11:13:12 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FBDBWp085762; Sat, 15 Apr 2017 11:13:11 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151113.v3FBDBWp085762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 11:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316957 - in stable/11: bin/csh contrib/tcsh contrib/tcsh/config contrib/tcsh/nls contrib/tcsh/nls/C contrib/tcsh/nls/et contrib/tcsh/nls/finnish contrib/tcsh/nls/french contrib/tcsh/nl... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 11:13:13 -0000 Author: dchagin Date: Sat Apr 15 11:13:11 2017 New Revision: 316957 URL: https://svnweb.freebsd.org/changeset/base/316957 Log: MFC r315948: Update tcsh to 6.20.00 MFC r315952: Update tcsh to vendor git b605cb561d Vendor changes: 1. PR/471: Daiki Ueno: Delay interpreting arginp until we've processed our startup files (which can change the NLS environment). 2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar). 3. Fix out of bounds read (Brooks Davis) (reproduce by starting tcsh and hitting tab at the prompt). 4. Don't play pointer tricks that are undefined in modern c (Brooks Davis). Added: stable/11/contrib/tcsh/dotlock.c - copied unchanged from r315948, head/contrib/tcsh/dotlock.c stable/11/contrib/tcsh/dotlock.h - copied unchanged from r315948, head/contrib/tcsh/dotlock.h stable/11/contrib/tcsh/tcsh.man.new - copied unchanged from r315948, head/contrib/tcsh/tcsh.man.new Deleted: stable/11/contrib/tcsh/configure.in Modified: stable/11/bin/csh/Makefile stable/11/contrib/tcsh/Fixes (contents, props changed) stable/11/contrib/tcsh/Imakefile (contents, props changed) stable/11/contrib/tcsh/Makefile.in (contents, props changed) stable/11/contrib/tcsh/Makefile.std (contents, props changed) stable/11/contrib/tcsh/Makefile.vms (contents, props changed) stable/11/contrib/tcsh/README (contents, props changed) stable/11/contrib/tcsh/complete.tcsh (contents, props changed) stable/11/contrib/tcsh/config.guess (contents, props changed) stable/11/contrib/tcsh/config.h.in (contents, props changed) stable/11/contrib/tcsh/config.sub (contents, props changed) stable/11/contrib/tcsh/config/bsd4.4 (contents, props changed) stable/11/contrib/tcsh/config_f.h (contents, props changed) stable/11/contrib/tcsh/configure (contents, props changed) stable/11/contrib/tcsh/ed.chared.c (contents, props changed) stable/11/contrib/tcsh/ed.decls.h (contents, props changed) stable/11/contrib/tcsh/ed.defns.c (contents, props changed) stable/11/contrib/tcsh/ed.inputl.c (contents, props changed) stable/11/contrib/tcsh/ed.refresh.c (contents, props changed) stable/11/contrib/tcsh/ed.screen.c (contents, props changed) stable/11/contrib/tcsh/ed.term.h (contents, props changed) stable/11/contrib/tcsh/ed.xmap.c (contents, props changed) stable/11/contrib/tcsh/gethost.c (contents, props changed) stable/11/contrib/tcsh/glob.c (contents, props changed) stable/11/contrib/tcsh/host.defs (contents, props changed) stable/11/contrib/tcsh/nls/C/set1 (contents, props changed) stable/11/contrib/tcsh/nls/C/set20 (contents, props changed) stable/11/contrib/tcsh/nls/C/set9 (contents, props changed) stable/11/contrib/tcsh/nls/Makefile.in stable/11/contrib/tcsh/nls/catgen stable/11/contrib/tcsh/nls/et/set1 (contents, props changed) stable/11/contrib/tcsh/nls/et/set20 (contents, props changed) stable/11/contrib/tcsh/nls/et/set9 (contents, props changed) stable/11/contrib/tcsh/nls/finnish/set1 (contents, props changed) stable/11/contrib/tcsh/nls/finnish/set20 (contents, props changed) stable/11/contrib/tcsh/nls/finnish/set3 (contents, props changed) stable/11/contrib/tcsh/nls/finnish/set9 (contents, props changed) stable/11/contrib/tcsh/nls/french/set1 (contents, props changed) stable/11/contrib/tcsh/nls/french/set20 (contents, props changed) stable/11/contrib/tcsh/nls/french/set9 (contents, props changed) stable/11/contrib/tcsh/nls/german/set1 (contents, props changed) stable/11/contrib/tcsh/nls/german/set20 (contents, props changed) stable/11/contrib/tcsh/nls/german/set9 (contents, props changed) stable/11/contrib/tcsh/nls/greek/set1 (contents, props changed) stable/11/contrib/tcsh/nls/greek/set20 (contents, props changed) stable/11/contrib/tcsh/nls/greek/set9 (contents, props changed) stable/11/contrib/tcsh/nls/italian/set1 (contents, props changed) stable/11/contrib/tcsh/nls/italian/set20 (contents, props changed) stable/11/contrib/tcsh/nls/italian/set9 (contents, props changed) stable/11/contrib/tcsh/nls/ja/set1 (contents, props changed) stable/11/contrib/tcsh/nls/russian/set1 (contents, props changed) stable/11/contrib/tcsh/nls/russian/set20 (contents, props changed) stable/11/contrib/tcsh/nls/russian/set9 (contents, props changed) stable/11/contrib/tcsh/nls/spanish/set1 (contents, props changed) stable/11/contrib/tcsh/nls/spanish/set20 (contents, props changed) stable/11/contrib/tcsh/nls/spanish/set9 (contents, props changed) stable/11/contrib/tcsh/nls/ukrainian/set1 (contents, props changed) stable/11/contrib/tcsh/nls/ukrainian/set20 (contents, props changed) stable/11/contrib/tcsh/nls/ukrainian/set9 (contents, props changed) stable/11/contrib/tcsh/patchlevel.h (contents, props changed) stable/11/contrib/tcsh/sh.c (contents, props changed) stable/11/contrib/tcsh/sh.char.h (contents, props changed) stable/11/contrib/tcsh/sh.decls.h (contents, props changed) stable/11/contrib/tcsh/sh.dir.c (contents, props changed) stable/11/contrib/tcsh/sh.dol.c (contents, props changed) stable/11/contrib/tcsh/sh.err.c (contents, props changed) stable/11/contrib/tcsh/sh.exec.c (contents, props changed) stable/11/contrib/tcsh/sh.exp.c (contents, props changed) stable/11/contrib/tcsh/sh.file.c (contents, props changed) stable/11/contrib/tcsh/sh.func.c (contents, props changed) stable/11/contrib/tcsh/sh.glob.c (contents, props changed) stable/11/contrib/tcsh/sh.h (contents, props changed) stable/11/contrib/tcsh/sh.hist.c (contents, props changed) stable/11/contrib/tcsh/sh.init.c (contents, props changed) stable/11/contrib/tcsh/sh.lex.c (contents, props changed) stable/11/contrib/tcsh/sh.misc.c (contents, props changed) stable/11/contrib/tcsh/sh.print.c (contents, props changed) stable/11/contrib/tcsh/sh.proc.c (contents, props changed) stable/11/contrib/tcsh/sh.proc.h (contents, props changed) stable/11/contrib/tcsh/sh.sem.c (contents, props changed) stable/11/contrib/tcsh/sh.set.c (contents, props changed) stable/11/contrib/tcsh/sh.time.c (contents, props changed) stable/11/contrib/tcsh/tc.alloc.c (contents, props changed) stable/11/contrib/tcsh/tc.bind.c (contents, props changed) stable/11/contrib/tcsh/tc.const.c (contents, props changed) stable/11/contrib/tcsh/tc.decls.h (contents, props changed) stable/11/contrib/tcsh/tc.func.c (contents, props changed) stable/11/contrib/tcsh/tc.nls.c (contents, props changed) stable/11/contrib/tcsh/tc.nls.h (contents, props changed) stable/11/contrib/tcsh/tc.os.c (contents, props changed) stable/11/contrib/tcsh/tc.printf.c (contents, props changed) stable/11/contrib/tcsh/tc.prompt.c (contents, props changed) stable/11/contrib/tcsh/tc.str.c (contents, props changed) stable/11/contrib/tcsh/tc.who.c (contents, props changed) stable/11/contrib/tcsh/tcsh.man (contents, props changed) stable/11/contrib/tcsh/tw.color.c (contents, props changed) stable/11/contrib/tcsh/tw.comp.c (contents, props changed) stable/11/contrib/tcsh/tw.decls.h (contents, props changed) stable/11/contrib/tcsh/tw.init.c (contents, props changed) stable/11/contrib/tcsh/tw.parse.c (contents, props changed) Directory Properties: stable/11/contrib/tcsh/FAQ (props changed) stable/11/contrib/tcsh/MAKEDIFFS (props changed) stable/11/contrib/tcsh/MAKESHAR (props changed) stable/11/contrib/tcsh/NewThings (props changed) stable/11/contrib/tcsh/Ported (props changed) stable/11/contrib/tcsh/README.imake (props changed) stable/11/contrib/tcsh/WishList (props changed) stable/11/contrib/tcsh/Y2K (props changed) stable/11/contrib/tcsh/csh-mode.el (props changed) stable/11/contrib/tcsh/ed.h (props changed) stable/11/contrib/tcsh/ed.init.c (props changed) stable/11/contrib/tcsh/ed.term.c (props changed) stable/11/contrib/tcsh/eight-bit.me (props changed) stable/11/contrib/tcsh/glob.3 (props changed) stable/11/contrib/tcsh/glob.h (props changed) stable/11/contrib/tcsh/imake.config (props changed) stable/11/contrib/tcsh/install-sh (props changed) stable/11/contrib/tcsh/ma.setp.c (props changed) stable/11/contrib/tcsh/mi.termios.c (props changed) stable/11/contrib/tcsh/mi.varargs.h (props changed) stable/11/contrib/tcsh/mi.wait.h (props changed) stable/11/contrib/tcsh/nls/C/charset (props changed) stable/11/contrib/tcsh/nls/C/set10 (props changed) stable/11/contrib/tcsh/nls/C/set11 (props changed) stable/11/contrib/tcsh/nls/C/set12 (props changed) stable/11/contrib/tcsh/nls/C/set13 (props changed) stable/11/contrib/tcsh/nls/C/set14 (props changed) stable/11/contrib/tcsh/nls/C/set15 (props changed) stable/11/contrib/tcsh/nls/C/set16 (props changed) stable/11/contrib/tcsh/nls/C/set17 (props changed) stable/11/contrib/tcsh/nls/C/set18 (props changed) stable/11/contrib/tcsh/nls/C/set19 (props changed) stable/11/contrib/tcsh/nls/C/set2 (props changed) stable/11/contrib/tcsh/nls/C/set21 (props changed) stable/11/contrib/tcsh/nls/C/set22 (props changed) stable/11/contrib/tcsh/nls/C/set23 (props changed) stable/11/contrib/tcsh/nls/C/set24 (props changed) stable/11/contrib/tcsh/nls/C/set25 (props changed) stable/11/contrib/tcsh/nls/C/set26 (props changed) stable/11/contrib/tcsh/nls/C/set27 (props changed) stable/11/contrib/tcsh/nls/C/set29 (props changed) stable/11/contrib/tcsh/nls/C/set3 (props changed) stable/11/contrib/tcsh/nls/C/set30 (props changed) stable/11/contrib/tcsh/nls/C/set31 (props changed) stable/11/contrib/tcsh/nls/C/set4 (props changed) stable/11/contrib/tcsh/nls/C/set5 (props changed) stable/11/contrib/tcsh/nls/C/set6 (props changed) stable/11/contrib/tcsh/nls/C/set7 (props changed) stable/11/contrib/tcsh/nls/C/set8 (props changed) stable/11/contrib/tcsh/nls/et/charset (props changed) stable/11/contrib/tcsh/nls/et/set10 (props changed) stable/11/contrib/tcsh/nls/et/set11 (props changed) stable/11/contrib/tcsh/nls/et/set12 (props changed) stable/11/contrib/tcsh/nls/et/set13 (props changed) stable/11/contrib/tcsh/nls/et/set14 (props changed) stable/11/contrib/tcsh/nls/et/set15 (props changed) stable/11/contrib/tcsh/nls/et/set16 (props changed) stable/11/contrib/tcsh/nls/et/set17 (props changed) stable/11/contrib/tcsh/nls/et/set18 (props changed) stable/11/contrib/tcsh/nls/et/set19 (props changed) stable/11/contrib/tcsh/nls/et/set2 (props changed) stable/11/contrib/tcsh/nls/et/set21 (props changed) stable/11/contrib/tcsh/nls/et/set22 (props changed) stable/11/contrib/tcsh/nls/et/set23 (props changed) stable/11/contrib/tcsh/nls/et/set24 (props changed) stable/11/contrib/tcsh/nls/et/set25 (props changed) stable/11/contrib/tcsh/nls/et/set26 (props changed) stable/11/contrib/tcsh/nls/et/set27 (props changed) stable/11/contrib/tcsh/nls/et/set29 (props changed) stable/11/contrib/tcsh/nls/et/set3 (props changed) stable/11/contrib/tcsh/nls/et/set30 (props changed) stable/11/contrib/tcsh/nls/et/set31 (props changed) stable/11/contrib/tcsh/nls/et/set4 (props changed) stable/11/contrib/tcsh/nls/et/set5 (props changed) stable/11/contrib/tcsh/nls/et/set6 (props changed) stable/11/contrib/tcsh/nls/et/set7 (props changed) stable/11/contrib/tcsh/nls/et/set8 (props changed) stable/11/contrib/tcsh/nls/finnish/charset (props changed) stable/11/contrib/tcsh/nls/finnish/set10 (props changed) stable/11/contrib/tcsh/nls/finnish/set11 (props changed) stable/11/contrib/tcsh/nls/finnish/set12 (props changed) stable/11/contrib/tcsh/nls/finnish/set13 (props changed) stable/11/contrib/tcsh/nls/finnish/set14 (props changed) stable/11/contrib/tcsh/nls/finnish/set15 (props changed) stable/11/contrib/tcsh/nls/finnish/set16 (props changed) stable/11/contrib/tcsh/nls/finnish/set17 (props changed) stable/11/contrib/tcsh/nls/finnish/set18 (props changed) stable/11/contrib/tcsh/nls/finnish/set19 (props changed) stable/11/contrib/tcsh/nls/finnish/set2 (props changed) stable/11/contrib/tcsh/nls/finnish/set21 (props changed) stable/11/contrib/tcsh/nls/finnish/set22 (props changed) stable/11/contrib/tcsh/nls/finnish/set23 (props changed) stable/11/contrib/tcsh/nls/finnish/set24 (props changed) stable/11/contrib/tcsh/nls/finnish/set25 (props changed) stable/11/contrib/tcsh/nls/finnish/set26 (props changed) stable/11/contrib/tcsh/nls/finnish/set27 (props changed) stable/11/contrib/tcsh/nls/finnish/set29 (props changed) stable/11/contrib/tcsh/nls/finnish/set30 (props changed) stable/11/contrib/tcsh/nls/finnish/set31 (props changed) stable/11/contrib/tcsh/nls/finnish/set4 (props changed) stable/11/contrib/tcsh/nls/finnish/set5 (props changed) stable/11/contrib/tcsh/nls/finnish/set6 (props changed) stable/11/contrib/tcsh/nls/finnish/set7 (props changed) stable/11/contrib/tcsh/nls/finnish/set8 (props changed) stable/11/contrib/tcsh/nls/french/charset (props changed) stable/11/contrib/tcsh/nls/french/set10 (props changed) stable/11/contrib/tcsh/nls/french/set11 (props changed) stable/11/contrib/tcsh/nls/french/set12 (props changed) stable/11/contrib/tcsh/nls/french/set13 (props changed) stable/11/contrib/tcsh/nls/french/set14 (props changed) stable/11/contrib/tcsh/nls/french/set15 (props changed) stable/11/contrib/tcsh/nls/french/set16 (props changed) stable/11/contrib/tcsh/nls/french/set17 (props changed) stable/11/contrib/tcsh/nls/french/set18 (props changed) stable/11/contrib/tcsh/nls/french/set19 (props changed) stable/11/contrib/tcsh/nls/french/set2 (props changed) stable/11/contrib/tcsh/nls/french/set21 (props changed) stable/11/contrib/tcsh/nls/french/set22 (props changed) stable/11/contrib/tcsh/nls/french/set23 (props changed) stable/11/contrib/tcsh/nls/french/set24 (props changed) stable/11/contrib/tcsh/nls/french/set25 (props changed) stable/11/contrib/tcsh/nls/french/set26 (props changed) stable/11/contrib/tcsh/nls/french/set27 (props changed) stable/11/contrib/tcsh/nls/french/set29 (props changed) stable/11/contrib/tcsh/nls/french/set3 (props changed) stable/11/contrib/tcsh/nls/french/set30 (props changed) stable/11/contrib/tcsh/nls/french/set31 (props changed) stable/11/contrib/tcsh/nls/french/set4 (props changed) stable/11/contrib/tcsh/nls/french/set5 (props changed) stable/11/contrib/tcsh/nls/french/set6 (props changed) stable/11/contrib/tcsh/nls/french/set7 (props changed) stable/11/contrib/tcsh/nls/french/set8 (props changed) stable/11/contrib/tcsh/nls/german/charset (props changed) stable/11/contrib/tcsh/nls/german/set10 (props changed) stable/11/contrib/tcsh/nls/german/set11 (props changed) stable/11/contrib/tcsh/nls/german/set12 (props changed) stable/11/contrib/tcsh/nls/german/set13 (props changed) stable/11/contrib/tcsh/nls/german/set14 (props changed) stable/11/contrib/tcsh/nls/german/set15 (props changed) stable/11/contrib/tcsh/nls/german/set16 (props changed) stable/11/contrib/tcsh/nls/german/set17 (props changed) stable/11/contrib/tcsh/nls/german/set18 (props changed) stable/11/contrib/tcsh/nls/german/set19 (props changed) stable/11/contrib/tcsh/nls/german/set2 (props changed) stable/11/contrib/tcsh/nls/german/set21 (props changed) stable/11/contrib/tcsh/nls/german/set22 (props changed) stable/11/contrib/tcsh/nls/german/set23 (props changed) stable/11/contrib/tcsh/nls/german/set24 (props changed) stable/11/contrib/tcsh/nls/german/set25 (props changed) stable/11/contrib/tcsh/nls/german/set26 (props changed) stable/11/contrib/tcsh/nls/german/set27 (props changed) stable/11/contrib/tcsh/nls/german/set29 (props changed) stable/11/contrib/tcsh/nls/german/set3 (props changed) stable/11/contrib/tcsh/nls/german/set30 (props changed) stable/11/contrib/tcsh/nls/german/set31 (props changed) stable/11/contrib/tcsh/nls/german/set4 (props changed) stable/11/contrib/tcsh/nls/german/set5 (props changed) stable/11/contrib/tcsh/nls/german/set6 (props changed) stable/11/contrib/tcsh/nls/german/set7 (props changed) stable/11/contrib/tcsh/nls/german/set8 (props changed) stable/11/contrib/tcsh/nls/greek/charset (props changed) stable/11/contrib/tcsh/nls/greek/set10 (props changed) stable/11/contrib/tcsh/nls/greek/set11 (props changed) stable/11/contrib/tcsh/nls/greek/set12 (props changed) stable/11/contrib/tcsh/nls/greek/set13 (props changed) stable/11/contrib/tcsh/nls/greek/set14 (props changed) stable/11/contrib/tcsh/nls/greek/set15 (props changed) stable/11/contrib/tcsh/nls/greek/set16 (props changed) stable/11/contrib/tcsh/nls/greek/set17 (props changed) stable/11/contrib/tcsh/nls/greek/set18 (props changed) stable/11/contrib/tcsh/nls/greek/set19 (props changed) stable/11/contrib/tcsh/nls/greek/set2 (props changed) stable/11/contrib/tcsh/nls/greek/set21 (props changed) stable/11/contrib/tcsh/nls/greek/set22 (props changed) stable/11/contrib/tcsh/nls/greek/set23 (props changed) stable/11/contrib/tcsh/nls/greek/set24 (props changed) stable/11/contrib/tcsh/nls/greek/set25 (props changed) stable/11/contrib/tcsh/nls/greek/set26 (props changed) stable/11/contrib/tcsh/nls/greek/set27 (props changed) stable/11/contrib/tcsh/nls/greek/set29 (props changed) stable/11/contrib/tcsh/nls/greek/set3 (props changed) stable/11/contrib/tcsh/nls/greek/set30 (props changed) stable/11/contrib/tcsh/nls/greek/set31 (props changed) stable/11/contrib/tcsh/nls/greek/set4 (props changed) stable/11/contrib/tcsh/nls/greek/set5 (props changed) stable/11/contrib/tcsh/nls/greek/set6 (props changed) stable/11/contrib/tcsh/nls/greek/set7 (props changed) stable/11/contrib/tcsh/nls/greek/set8 (props changed) stable/11/contrib/tcsh/nls/italian/charset (props changed) stable/11/contrib/tcsh/nls/italian/set10 (props changed) stable/11/contrib/tcsh/nls/italian/set11 (props changed) stable/11/contrib/tcsh/nls/italian/set12 (props changed) stable/11/contrib/tcsh/nls/italian/set13 (props changed) stable/11/contrib/tcsh/nls/italian/set14 (props changed) stable/11/contrib/tcsh/nls/italian/set15 (props changed) stable/11/contrib/tcsh/nls/italian/set16 (props changed) stable/11/contrib/tcsh/nls/italian/set17 (props changed) stable/11/contrib/tcsh/nls/italian/set18 (props changed) stable/11/contrib/tcsh/nls/italian/set19 (props changed) stable/11/contrib/tcsh/nls/italian/set2 (props changed) stable/11/contrib/tcsh/nls/italian/set21 (props changed) stable/11/contrib/tcsh/nls/italian/set22 (props changed) stable/11/contrib/tcsh/nls/italian/set23 (props changed) stable/11/contrib/tcsh/nls/italian/set24 (props changed) stable/11/contrib/tcsh/nls/italian/set25 (props changed) stable/11/contrib/tcsh/nls/italian/set26 (props changed) stable/11/contrib/tcsh/nls/italian/set27 (props changed) stable/11/contrib/tcsh/nls/italian/set29 (props changed) stable/11/contrib/tcsh/nls/italian/set3 (props changed) stable/11/contrib/tcsh/nls/italian/set30 (props changed) stable/11/contrib/tcsh/nls/italian/set31 (props changed) stable/11/contrib/tcsh/nls/italian/set4 (props changed) stable/11/contrib/tcsh/nls/italian/set5 (props changed) stable/11/contrib/tcsh/nls/italian/set6 (props changed) stable/11/contrib/tcsh/nls/italian/set7 (props changed) stable/11/contrib/tcsh/nls/italian/set8 (props changed) stable/11/contrib/tcsh/nls/ja/charset (props changed) stable/11/contrib/tcsh/nls/ja/set10 (props changed) stable/11/contrib/tcsh/nls/ja/set11 (props changed) stable/11/contrib/tcsh/nls/ja/set12 (props changed) stable/11/contrib/tcsh/nls/ja/set13 (props changed) stable/11/contrib/tcsh/nls/ja/set15 (props changed) stable/11/contrib/tcsh/nls/ja/set16 (props changed) stable/11/contrib/tcsh/nls/ja/set17 (props changed) stable/11/contrib/tcsh/nls/ja/set18 (props changed) stable/11/contrib/tcsh/nls/ja/set2 (props changed) stable/11/contrib/tcsh/nls/ja/set21 (props changed) stable/11/contrib/tcsh/nls/ja/set24 (props changed) stable/11/contrib/tcsh/nls/ja/set29 (props changed) stable/11/contrib/tcsh/nls/ja/set3 (props changed) stable/11/contrib/tcsh/nls/ja/set30 (props changed) stable/11/contrib/tcsh/nls/ja/set4 (props changed) stable/11/contrib/tcsh/nls/ja/set5 (props changed) stable/11/contrib/tcsh/nls/ja/set6 (props changed) stable/11/contrib/tcsh/nls/ja/set7 (props changed) stable/11/contrib/tcsh/nls/ja/set8 (props changed) stable/11/contrib/tcsh/nls/russian/charset (props changed) stable/11/contrib/tcsh/nls/russian/set10 (props changed) stable/11/contrib/tcsh/nls/russian/set11 (props changed) stable/11/contrib/tcsh/nls/russian/set12 (props changed) stable/11/contrib/tcsh/nls/russian/set13 (props changed) stable/11/contrib/tcsh/nls/russian/set14 (props changed) stable/11/contrib/tcsh/nls/russian/set15 (props changed) stable/11/contrib/tcsh/nls/russian/set16 (props changed) stable/11/contrib/tcsh/nls/russian/set17 (props changed) stable/11/contrib/tcsh/nls/russian/set18 (props changed) stable/11/contrib/tcsh/nls/russian/set19 (props changed) stable/11/contrib/tcsh/nls/russian/set2 (props changed) stable/11/contrib/tcsh/nls/russian/set21 (props changed) stable/11/contrib/tcsh/nls/russian/set22 (props changed) stable/11/contrib/tcsh/nls/russian/set23 (props changed) stable/11/contrib/tcsh/nls/russian/set24 (props changed) stable/11/contrib/tcsh/nls/russian/set25 (props changed) stable/11/contrib/tcsh/nls/russian/set26 (props changed) stable/11/contrib/tcsh/nls/russian/set27 (props changed) stable/11/contrib/tcsh/nls/russian/set29 (props changed) stable/11/contrib/tcsh/nls/russian/set3 (props changed) stable/11/contrib/tcsh/nls/russian/set30 (props changed) stable/11/contrib/tcsh/nls/russian/set31 (props changed) stable/11/contrib/tcsh/nls/russian/set4 (props changed) stable/11/contrib/tcsh/nls/russian/set5 (props changed) stable/11/contrib/tcsh/nls/russian/set6 (props changed) stable/11/contrib/tcsh/nls/russian/set7 (props changed) stable/11/contrib/tcsh/nls/russian/set8 (props changed) stable/11/contrib/tcsh/nls/spanish/charset (props changed) stable/11/contrib/tcsh/nls/spanish/set10 (props changed) stable/11/contrib/tcsh/nls/spanish/set11 (props changed) stable/11/contrib/tcsh/nls/spanish/set12 (props changed) stable/11/contrib/tcsh/nls/spanish/set13 (props changed) stable/11/contrib/tcsh/nls/spanish/set14 (props changed) stable/11/contrib/tcsh/nls/spanish/set15 (props changed) stable/11/contrib/tcsh/nls/spanish/set16 (props changed) stable/11/contrib/tcsh/nls/spanish/set17 (props changed) stable/11/contrib/tcsh/nls/spanish/set18 (props changed) stable/11/contrib/tcsh/nls/spanish/set19 (props changed) stable/11/contrib/tcsh/nls/spanish/set2 (props changed) stable/11/contrib/tcsh/nls/spanish/set21 (props changed) stable/11/contrib/tcsh/nls/spanish/set22 (props changed) stable/11/contrib/tcsh/nls/spanish/set23 (props changed) stable/11/contrib/tcsh/nls/spanish/set24 (props changed) stable/11/contrib/tcsh/nls/spanish/set25 (props changed) stable/11/contrib/tcsh/nls/spanish/set26 (props changed) stable/11/contrib/tcsh/nls/spanish/set27 (props changed) stable/11/contrib/tcsh/nls/spanish/set29 (props changed) stable/11/contrib/tcsh/nls/spanish/set3 (props changed) stable/11/contrib/tcsh/nls/spanish/set30 (props changed) stable/11/contrib/tcsh/nls/spanish/set31 (props changed) stable/11/contrib/tcsh/nls/spanish/set4 (props changed) stable/11/contrib/tcsh/nls/spanish/set5 (props changed) stable/11/contrib/tcsh/nls/spanish/set6 (props changed) stable/11/contrib/tcsh/nls/spanish/set7 (props changed) stable/11/contrib/tcsh/nls/spanish/set8 (props changed) stable/11/contrib/tcsh/nls/ukrainian/charset (props changed) stable/11/contrib/tcsh/nls/ukrainian/set10 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set11 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set12 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set13 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set14 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set15 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set16 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set17 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set18 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set19 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set2 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set21 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set22 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set23 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set24 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set25 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set26 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set27 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set29 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set3 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set30 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set31 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set4 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set5 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set6 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set7 (props changed) stable/11/contrib/tcsh/nls/ukrainian/set8 (props changed) stable/11/contrib/tcsh/pathnames.h (props changed) stable/11/contrib/tcsh/sh.char.c (props changed) stable/11/contrib/tcsh/sh.dir.h (props changed) stable/11/contrib/tcsh/sh.parse.c (props changed) stable/11/contrib/tcsh/sh.types.h (props changed) stable/11/contrib/tcsh/snames.h (props changed) stable/11/contrib/tcsh/src.desc (props changed) stable/11/contrib/tcsh/tc.disc.c (props changed) stable/11/contrib/tcsh/tc.h (props changed) stable/11/contrib/tcsh/tc.os.h (props changed) stable/11/contrib/tcsh/tc.sched.c (props changed) stable/11/contrib/tcsh/tc.sig.c (props changed) stable/11/contrib/tcsh/tc.sig.h (props changed) stable/11/contrib/tcsh/tc.vers.c (props changed) stable/11/contrib/tcsh/tc.wait.h (props changed) stable/11/contrib/tcsh/tcsh.man2html (props changed) stable/11/contrib/tcsh/termcap.vms (props changed) stable/11/contrib/tcsh/tw.h (props changed) stable/11/contrib/tcsh/tw.help.c (props changed) stable/11/contrib/tcsh/tw.spell.c (props changed) stable/11/contrib/tcsh/vms.termcap.c (props changed) Modified: stable/11/bin/csh/Makefile ============================================================================== --- stable/11/bin/csh/Makefile Sat Apr 15 09:56:42 2017 (r316956) +++ stable/11/bin/csh/Makefile Sat Apr 15 11:13:11 2017 (r316957) @@ -33,6 +33,7 @@ SRCS+= tc.alloc.c tc.bind.c tc.const.c t tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \ tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \ tc.who.c tc.h +SRCS+= dotlock.c dotlock.h GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c SRCS+= ${GENHDRS} Modified: stable/11/contrib/tcsh/Fixes ============================================================================== --- stable/11/contrib/tcsh/Fixes Sat Apr 15 09:56:42 2017 (r316956) +++ stable/11/contrib/tcsh/Fixes Sat Apr 15 11:13:11 2017 (r316957) @@ -1,3 +1,96 @@ + 22. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar) + 20. V6.20.00 - 20161124 + 19. Don't resize the screen if it did not change size. + 18. V6.19.01 - 20161025 + 17. restore file description when cleaning up after eval: + repeat 99 time + 16. PR/572: Fix $SHLVL issue when exec'ing subshells. + 15. PR/403: Fix backquote expansion for multi-byte character sets. + 14. Fix drawing issu with multi-line prompt (Kensuke Iwahashi/David Kaspar) + 13. always send prusage to stdout. + 12. PR/526: Fix double \\ printing from previous fix in history expansion. + 11. Android updates from Corinna Vinschen + 10. PR/526: Quote backslashes properly so they can be preserved in `` + expansions + 9. Fix memory leak for paraml + 8. Add notempty and ask values for the noclobber setting (Martin Tournoij) + 7. more correct $wordchars for vimode (Luke Mewburn) + 6. expose VImode in $vimode (Luke Mewburn) + 5. display what the compiled in editor is in bindkey -d (Luke Mewburn) + 4. run-fg-editor improvements and documentation (Luke Mewburn) + 3. Fix parsing of 'if (cond)then' (Fridolin Pokorny) + 2. PR/437: Fix handling of invalid unicode characters. + 1. PR/451: Fix error messages containing %c to be always '%c' + + 41. V6.19.00 - 20150521 + 40. V6.18.05 - 20150510 + 39. fix reseting when interrupted inside an eval "eval sleep 10^C" + (paulo.cesar.pereira.de.andrade) + 38. rename handle_intr -> handle_interrupt as originally intended. + 37. fix input tests that need stdin on a tty + 36. V6.18.04 - 20150504 + 35. revert fix echo "\1", it is incorrect. + 34. revert fix to PR/437, breaks short strings. + 33. V6.18.03 - 20150503 + 32. PR/437: Nakajima Akira: Fix segmentation fault reading input files + 31. PR/291: Print job status messages to stderr. + 30. Fridolin Pokorny NUL in `` does not mean EOF. + 29. Pavel Raiskup fix hang with: + while (1) + ( date & ; wait ) + end + 28. Add cdtohome special variable (Martin Tournoij) + 27. Fix root prompt char for windows (Corinna Vinschen) + 26. For "next" completion matches only consider exact matches of the previous + word (Jamie Landeg-Jones) + 25. Fix echo "\1" for echo_style=both where the first character was + not processed properly (Gary Duzan) + 24. V6.18.02 - 20140618 + 23. fix ls-F /non printing exit value twice. + 22. rename configure.in to configure.ac, add aclocal.m4 to CVS + 21. set foo="aabaabaa"; echo $foo:as/a// should produce bb + 20. Add locked merge history support (Marcin Konarski) + 19. Support more resource limits from various BSD's + 18. Cache history count to speed up thing + 17. PR/240: minix support + 16. revert fix for 15. Causes extra quoting, for example (foo is a program + that prints its arguments): + $ ./foo 'abc' * + '\a\b\c' + 15. fix globbing for ``, stripping backslashes. Example: + cat << _EOF > huh + echo 'hello\;world' + _EOF + echo `./huh 0` + echo `./huh $?` + 14. fix for `` that causes hang. Example: + cat << _EOF > huh + #!/bin/sh + echo "[$@]" + echo "I am running" + echo "I am running ($$)" >> huh.out + _EOF + cat << _EOF > huh.tcsh + #!/bin/tcsh -f + + ./huh \ + `#comment blah blah blah` \ + parameter a \ + `#comment blah blah blah` \ + parameter b \ + `#comment blah blah blah` \ + parameter c + echo ok + _EOF + 13. remove AsciiOnly fix now that the real issue has been fixed (Roman Kollar) + 12. define utmp file for aix (Laurence Darby) + 11. fix if history in loops + 10. make ls-F print to stderr and set the exit code + 9. make rmstar interruptible on linux + 8. Get rid of pret_t and make the printf functions return the number of + characters printed as the system ones do. + 7. Parse a FreeBSD compat $LSCOLORS. What to do when both LSCOLORS and + LS_COLORS are set. I am not documenting this until we decide. 6. V6.18.01 - 20120214 5. fix interruptible wait again 4. ignore bogus compiler overflow message Modified: stable/11/contrib/tcsh/Imakefile ============================================================================== --- stable/11/contrib/tcsh/Imakefile Sat Apr 15 09:56:42 2017 (r316956) +++ stable/11/contrib/tcsh/Imakefile Sat Apr 15 11:13:11 2017 (r316957) @@ -1,5 +1,5 @@ XCOMM -XCOMM $tcsh: Imakefile,v 1.87 2010/01/28 19:01:05 christos Exp $ +XCOMM $tcsh: Imakefile,v 1.88 2014/07/07 20:34:58 christos Exp $ XCOMM XCOMM Imakefile for tcsh 6.12 XCOMM Marc Horowitz, MIT SIPB @@ -526,8 +526,8 @@ MISCF = Makefile.std Fixes MAKEDIFFS MAK WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \ - snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.in \ - Makefile.win32 + snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.ac \ + Makefile.win32 aclocal.m4 CONFSRCS=config/[a-z]* Modified: stable/11/contrib/tcsh/Makefile.in ============================================================================== --- stable/11/contrib/tcsh/Makefile.in Sat Apr 15 09:56:42 2017 (r316956) +++ stable/11/contrib/tcsh/Makefile.in Sat Apr 15 11:13:11 2017 (r316957) @@ -1,4 +1,4 @@ -# $tcsh: Makefile.in,v 3.49 2011/02/05 17:35:31 christos Exp $ +# $tcsh: Makefile.in,v 3.59 2015/08/24 20:09:04 kim Exp $ # Makefile.in 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile @@ -315,8 +315,8 @@ CPP = @CPP@ # on the suns does not know how to make dynamically linked binaries. # This is set by autoconf. CC = @CC@ -#CC= gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Werror -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wcast-qual -Wreturn-type -Wswitch -Wshadow -Wwrite-strings -Wextra -# -ansi -pedantic +#CC= gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Werror -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wcast-qual -Wreturn-type -Wswitch -Wshadow -Wwrite-strings -Wextra -Wcast-qual -Wwrite-strings -Wold-style-definition -Wuninitialized -Wpointer-sign +# -Wconversion -Wformat=2 -ansi -pedantic #CC= gcc -Wall -pipe -B/bin/ # Generate code for Intel 486 (linux) #CC= gcc -m486 -pipe -Wall @@ -377,14 +377,14 @@ ASSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \ sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h \ tw.color.c -PSSRCS= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \ +PSSRCS= sh.decls.h glob.c glob.h dotlock.c dotlock.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \ vms.termcap.c SHSRCS= ${ASSRCS} ${PSSRCS} SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \ sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \ sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \ sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \ - sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} \ + sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} dotlock.${SUF} \ mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF} TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \ @@ -411,12 +411,12 @@ AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThin WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.in configure config.h.in \ - tests/testsuite.at + host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + tests/testsuite.at aclocal.m4 TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \ tests/expr.at tests/lexical.at tests/mb-eucjp.at \ - tests/mb-utf8.at tests/noexec.at tests/syntax.at tests/subst.at \ - tests/variables.at tests/sh.dol.at + tests/mb-utf8.at tests/noexec.at tests/parenthesis.at tests/syntax.at \ + tests/subst.at tests/variables.at tests/sh.dol.at VHSRCS=${PVSRCS} ${AVSRCS} @@ -533,11 +533,11 @@ tc.const.h: tc.const.c sh.char.h config. ${CPP} $(CPPFLAGS) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\ $(srcdir)/tc.const.c | \ sed -n -e 's/^\(Char STR[a-zA-Z0-9_]*\) *\[ *\].*/extern \1[];/p' | \ - sort >> $@.tmp + LC_COLLATE=C sort >> $@.tmp @echo '#endif /* _h_tc_const */' >> $@.tmp @if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi -$(srcdir)/tests/package.m4: $(srcdir)/configure.in +$(srcdir)/tests/package.m4: $(srcdir)/configure.ac { \ echo '# Signature of the current package.'; \ echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ @@ -594,12 +594,12 @@ vgrind: @vgrind -t -x -h Index index >/crp/bill/csh/index.t install-strip: install + -strip ${DESTBIN}/tcsh$(EXEEXT) install: tcsh$(EXEEXT) install.catalogs install.man -mkdir -p ${DESTBIN} -mv -f ${DESTBIN}/tcsh$(EXEEXT) ${DESTBIN}/tcsh.old cp tcsh$(EXEEXT) ${DESTBIN}/tcsh$(EXEEXT) - -strip ${DESTBIN}/tcsh$(EXEEXT) chmod 755 ${DESTBIN}/tcsh$(EXEEXT) install.catalogs: @@ -623,25 +623,6 @@ install.man: tcsh.man # nroff -man tcsh.man | compress > ${DESTMAN}/tcsh.${MANSECT}.Z # chmod 444 ${DESTMAN}/tcsh.${MANSECT}.Z -install.cygwin: install - -gzip ${DESTMAN}/tcsh.${MANSECT} - -mkdir -p ${DESTDIR}${prefix}/share/doc/tcsh - cp ${srcdir}/FAQ ${srcdir}/Fixes ${DESTDIR}${prefix}/share/doc/tcsh - cp ${srcdir}/NewThings ${srcdir}/README ${DESTDIR}${prefix}/share/doc/tcsh - cp ${srcdir}/WishList ${srcdir}/Y2K ${DESTDIR}${prefix}/share/doc/tcsh - perl ${srcdir}/tcsh.man2html ${srcdir}/tcsh.man - cp -rp tcsh.html ${DESTDIR}${prefix}/share/doc/tcsh - -mkdir -p ${DESTDIR}/etc/defaults/etc/profile.d - -mkdir -p ${DESTDIR}/etc/profile.d - -mkdir -p ${DESTDIR}/etc/postinstall - -mkdir -p ${DESTDIR}/etc/preremove - cp -p ${srcdir}/cygwin/csh.cshrc ${DESTDIR}/etc/defaults/etc - cp -p ${srcdir}/cygwin/csh.login ${DESTDIR}/etc/defaults/etc - cp -p ${srcdir}/cygwin/bindkey.tcsh ${DESTDIR}/etc/defaults/etc/profile.d - cp -p ${srcdir}/complete.tcsh ${DESTDIR}/etc/defaults/etc/profile.d - cp -p ${srcdir}/cygwin/postinstall.sh ${DESTDIR}/etc/postinstall/tcsh.sh - cp -p ${srcdir}/cygwin/preremove.sh ${DESTDIR}/etc/preremove/tcsh.sh - clean: clean.catalogs ${RM} -f a.out strings x.c xs.c tcsh$(EXEEXT) tcsh.a _MAKE_LOG gethost ${RM} -f *.${SUF} *.i *.s @@ -748,11 +729,11 @@ ftp: tcsh-${VERSION}.tar.Z tcsh.tahoe-${ autoconfigure: $(srcdir)/configure $(srcdir)/config.h.in -$(srcdir)/configure: $(srcdir)/configure.in +$(srcdir)/configure: $(srcdir)/configure.ac cd $(srcdir) && autoconf $(srcdir)/config.h.in: $(srcdir)/stamp-h.in -$(srcdir)/stamp-h.in: $(srcdir)/configure.in +$(srcdir)/stamp-h.in: $(srcdir)/configure.ac cd $(srcdir) && autoheader @echo timestamp > $(srcdir)/stamp-h.in @@ -787,6 +768,9 @@ ${TWOBJS} ${TWINC}: ${TWH} # glob.h glob.${SUF} sh.glob.${SUF}: glob.h +# dotlock.h +dotlock.${SUF}: dotlock.h + # ed.defns.h EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF} ${EDOBJS} ${EDDINC}: ed.defns.h Modified: stable/11/contrib/tcsh/Makefile.std ============================================================================== --- stable/11/contrib/tcsh/Makefile.std Sat Apr 15 09:56:42 2017 (r316956) +++ stable/11/contrib/tcsh/Makefile.std Sat Apr 15 11:13:11 2017 (r316957) @@ -1,4 +1,4 @@ -# $tcsh: Makefile.std,v 1.97 2006/03/02 18:46:44 christos Exp $ +# $tcsh: Makefile.std,v 1.100 2015/08/24 20:09:04 kim Exp $ # Makefile.std 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile @@ -287,14 +287,14 @@ ASSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \ sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \ sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h -PSSRCS= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \ +PSSRCS= sh.decls.h glob.c glob.h dotlock.c dotlock.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \ vms.termcap.c SHSRCS= ${ASSRCS} ${PSSRCS} SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \ sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \ sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \ sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \ - sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} \ + sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} dotlock.${SUF} \ mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF} TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \ @@ -321,7 +321,8 @@ AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThin WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.in configure config.h.in + host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} @@ -424,7 +425,7 @@ tc.const.h: tc.const.c sh.char.h config. ${CPP} $(INCLUDES) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\ $(srcdir)/tc.const.c | grep 'Char STR' | \ sed -e 's/Char \([a-zA-Z0-9_]*\) *\[ *\].*/extern Char \1[];/' | \ - sort >> $@ + LC_COLLATE=C sort >> $@ @echo '#endif /* _h_tc_const */' >> $@ csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF} @@ -584,11 +585,11 @@ ftp: tcsh-${VERSION}.tar.Z tcsh.tahoe-${ autoconfigure: $(srcdir)/configure $(srcdir)/config.h.in -$(srcdir)/configure: $(srcdir)/configure.in +$(srcdir)/configure: $(srcdir)/configure.ac cd $(srcdir) && autoconf $(srcdir)/config.h.in: $(srcdir)/stamp-h.in -$(srcdir)/stamp-h.in: $(srcdir)/configure.in +$(srcdir)/stamp-h.in: $(srcdir)/configure.ac cd $(srcdir) && autoheader @echo timestamp > $(srcdir)/stamp-h.in @@ -620,6 +621,9 @@ ${TWOBJS} ${TWINC}: ${TWH} # glob.h glob.${SUF} sh.glob.${SUF}: glob.h +# dotlock.h +dotlock.${SUF}: dotlock.h + # ed.defns.h EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF} ${EDOBJS} ${EDDINC}: ed.defns.h Modified: stable/11/contrib/tcsh/Makefile.vms ============================================================================== --- stable/11/contrib/tcsh/Makefile.vms Sat Apr 15 09:56:42 2017 (r316956) +++ stable/11/contrib/tcsh/Makefile.vms Sat Apr 15 11:13:11 2017 (r316957) @@ -1,4 +1,4 @@ -# $tcsh: Makefile.vms,v 1.39 2006/03/02 18:46:44 christos Exp $ +# $tcsh: Makefile.vms,v 1.40 2014/07/07 20:34:58 christos Exp $ # Makefile.vms 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile @@ -299,7 +299,7 @@ AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThin WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.in + host.defs gethost.c tcsh.man2html configure.ac aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} Modified: stable/11/contrib/tcsh/README ============================================================================== --- stable/11/contrib/tcsh/README Sat Apr 15 09:56:42 2017 (r316956) +++ stable/11/contrib/tcsh/README Sat Apr 15 11:13:11 2017 (r316957) @@ -1,4 +1,4 @@ -This is tcsh version 6.18.01. Tcsh is a version of the Berkeley +This is tcsh version 6.20.00. Tcsh is a version of the Berkeley C-Shell, with the addition of: a command line editor, command and file name completion, listing, etc. and a bunch of small additions to the shell itself. Modified: stable/11/contrib/tcsh/complete.tcsh ============================================================================== --- stable/11/contrib/tcsh/complete.tcsh Sat Apr 15 09:56:42 2017 (r316956) +++ stable/11/contrib/tcsh/complete.tcsh Sat Apr 15 11:13:11 2017 (r316957) @@ -1,5 +1,5 @@ # -# $tcsh: complete.tcsh,v 1.52 2010/05/07 17:54:13 christos Exp $ +# $tcsh: complete.tcsh,v 1.56 2015/07/03 16:52:47 christos Exp $ # example file using the new completion code # # Debian GNU/Linux @@ -20,1209 +20,1262 @@ # Cleanup by Martin A. Godisch . onintr - -if (! $?prompt) goto end +if ( ! $?prompt ) goto end -if ($?tcsh) then - if ($tcsh != 1) then - set rev=$tcsh:r - set rel=$rev:e - set pat=$tcsh:e - set rev=$rev:r +if ( $?tcsh ) then + if ( $tcsh != 1 ) then + set rev=$tcsh:r:r + set rel=$tcsh:r:e + if ( $rev > 6 || ( $rev > 5 && $rel > 1 ) ) then + set _has_complete=1 endif - if ($rev > 5 && $rel > 1) then - set _complete=1 - endif - unset rev rel pat + endif + unset rev rel endif -if ($?_complete) then - set noglob - if ( ! $?hosts ) set hosts - foreach f ("$HOME/.hosts" /usr/local/etc/csh.hosts "$HOME/.rhosts" /etc/hosts.equiv) - if ( -r "$f" ) then - set hosts = ($hosts `grep -v "+" "$f" | grep -E -v "^#" | tr -s " " " " | cut -f 1`) - endif - end - if ( -r "$HOME/.netrc" ) then - set f=`awk '/machine/ { print $2 }' < "$HOME/.netrc"` >& /dev/null - set hosts=($hosts $f) - endif - if ( -r "$HOME/.ssh/known_hosts" ) then - set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ ` >& /dev/null - set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ | sed -e 's/,/ /g'` >& /dev/null - set hosts=($hosts $f) - endif - unset f - if ( ! $?hosts ) then - set hosts=(hyperion.ee.cornell.edu phaeton.ee.cornell.edu \ - guillemin.ee.cornell.edu vangogh.cs.berkeley.edu \ - ftp.uu.net prep.ai.mit.edu export.lcs.mit.edu \ - labrea.stanford.edu sumex-aim.stanford.edu \ - tut.cis.ohio-state.edu) - endif +if ( ! $?_has_complete ) goto end - complete ywho n/*/\$hosts/ # argument from list in $hosts - complete rsh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ - complete ssh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ - complete xrsh p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ - complete rlogin p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ - complete telnet p/1/\$hosts/ p/2/x:''/ n/*/n/ - - complete cd p/1/d/ # Directories only - complete chdir p/1/d/ - complete pushd p/1/d/ - complete popd p/1/d/ - complete pu p/1/d/ - complete po p/1/d/ - complete complete p/1/X/ # Completions only - complete uncomplete n/*/X/ - complete exec p/1/c/ # Commands only - complete trace p/1/c/ - complete strace p/1/c/ - complete which n/*/c/ - complete where n/*/c/ - complete skill p/1/c/ - complete dde p/1/c/ - complete adb c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/ - complete sdb p/1/c/ - complete dbx c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/ - complete xdb p/1/c/ - complete gdb n/-d/d/ n/*/c/ - complete ups p/1/c/ - complete set 'c/*=/f/' 'p/1/s/=' 'n/=/f/' - complete unset n/*/s/ - complete alias p/1/a/ # only aliases are valid - complete unalias n/*/a/ - complete xdvi n/*/f:*.dvi/ # Only files that match *.dvi - complete dvips n/*/f:*.dvi/ - if ($?traditional_complete) then - complete tex n/*/f:*.tex/ # Only files that match *.tex - else - complete tex n/*/f:*.{tex,texi}/ # Files that match *.tex and *.texi - endif - complete latex n/*/f:*.{tex,ltx}/ - complete su c/--/"(login fast preserve-environment command shell \ - help version)"/ c/-/"(f l m p c s -)"/ \ - n/{-c,--command}/c/ \ - n@{-s,--shell}@'`cat /etc/shells`'@ n/*/u/ - complete cc c/-[IL]/d/ \ - c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \ - c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/ - complete acc c/-[IL]/d/ \ - c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \ - c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/ - complete gcc c/-[IL]/d/ \ - c/-f/"(caller-saves cse-follow-jumps delayed-branch \ - elide-constructors expensive-optimizations \ - float-store force-addr force-mem inline \ - inline-functions keep-inline-functions \ - memoize-lookups no-default-inline \ - no-defer-pop no-function-cse omit-frame-pointer \ - rerun-cse-after-loop schedule-insns \ - schedule-insns2 strength-reduce \ - thread-jumps unroll-all-loops \ - unroll-loops syntax-only all-virtual \ - cond-mismatch dollars-in-identifiers \ - enum-int-equiv no-asm no-builtin \ - no-strict-prototype signed-bitfields \ - signed-char this-is-variable unsigned-bitfields \ - unsigned-char writable-strings call-saved-reg \ - call-used-reg fixed-reg no-common \ - no-gnu-binutils nonnull-objects \ - pcc-struct-return pic PIC shared-data \ - short-enums short-double volatile)"/ \ - c/-W/"(all aggregate-return cast-align cast-qual \ - comment conversion enum-clash error format \ - id-clash-len implicit missing-prototypes \ - no-parentheses pointer-arith return-type shadow \ - strict-prototypes switch uninitialized unused \ - write-strings)"/ \ - c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd \ - short c68000 c68020 soft-float g gnu unix fpu \ - no-epilogue)"/ \ - c/-d/"(D M N)"/ \ - c/-/"(f W vspec v vpath ansi traditional \ - traditional-cpp trigraphs pedantic x o l c g L \ - I D U O O2 C E H B b V M MD MM i dynamic \ - nodtdlib static nostdinc undef)"/ \ - c/-l/f:*.a/ \ - n/*/f:*.{c,C,cc,o,a,s,i}/ - complete g++ n/*/f:*.{C,cc,o,s,i}/ - complete CC n/*/f:*.{C,cc,cpp,o,s,i}/ - complete rm c/--/"(directory force interactive verbose \ - recursive help version)"/ c/-/"(d f i v r R -)"/ \ - n/*/f:^*.{c,cc,C,h,in}/ # Protect precious files - complete vi n/*/f:^*.[oa]/ - complete bindkey N/-a/b/ N/-c/c/ n/-[ascr]/'x:'/ \ - n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/\ - n/-k/"(left right up down)"/ p/2-/b/ \ - p/1/'x:'/ - - complete find n/-fstype/"(nfs 4.2)"/ n/-name/f/ \ - n/-type/"(c b d f p l s)"/ n/-user/u/ n/-group/g/ \ - n/-exec/c/ n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \ - c/-/"(fstype name perm prune type user nouser \ - group nogroup size inum atime mtime ctime exec \ - ok print ls cpio ncpio newer xdev depth \ - daystart follow maxdepth mindepth noleaf version \ - anewer cnewer amin cmin mmin true false uid gid \ - ilname iname ipath iregex links lname empty path \ - regex used xtype fprint fprint0 fprintf \ - print0 printf not a and o or)"/ \ - n/*/d/ - - complete -%* c/%/j/ # fill in the jobs builtin - complete {fg,bg,stop} c/%/j/ p/1/"(%)"// - - complete limit c/-/"(h)"/ n/*/l/ - complete unlimit c/-/"(h)"/ n/*/l/ - - complete -co* p/0/"(compress)"/ # make compress completion - # not ambiguous - if ($?traditional_complete) then - complete zcat n/*/f:*.Z/ - else - # "zcat" may be linked to "compress" or "gzip" - if (-X zcat) then - zcat --version >& /dev/null - if ($status != 0) then - complete zcat n/*/f:*.Z/ - else - complete zcat c/--/"(force help license quiet version)"/ \ - c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/ - endif - endif - endif +if ( ! $?noglob ) set noglob _unset_noglob - complete finger c/*@/\$hosts/ n/*/u/@ - complete ping p/1/\$hosts/ - complete traceroute p/1/\$hosts/ - - complete {talk,ntalk,phone} p/1/'`users | tr " " "\012" | uniq`'/ \ - n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/ - - complete ftp c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/ - - # this one is simple... - #complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/: - # From Michael Schroeder - # This one will rsh to the file to fetch the list of files! - complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@' 'n/*/$hosts/:' - - complete dd c/--/"(help version)"/ c/[io]f=/f/ \ - c/conv=*,/"(ascii ebcdic ibm block unblock \ - lcase notrunc ucase swab noerror sync)"/,\ - c/conv=/"(ascii ebcdic ibm block unblock \ - lcase notrunc ucase swab noerror sync)"/,\ - c/*=/x:''/ \ - n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/= - - complete nslookup p/1/x:''/ p/2/\$hosts/ - - complete ar c/[dmpqrtx]/"(c l o u v a b i)"/ p/1/"(d m p q r t x)"// \ - p/2/f:*.a/ p/*/f:*.o/ - - # these should be merged with the MH completion hacks below - jgotts - complete {refile,sprev,snext,scan,pick,rmm,inc,folder,show} \ - "c@+@F:$HOME/Mail/@" - - # these and interrupt handling from Jaap Vermeulen - complete {rexec,rxexec,rxterm,rmterm} \ - 'p/1/$hosts/' 'c/-/(l L E)/' 'n/-l/u/' 'n/-L/f/' \ - 'n/-E/e/' 'n/*/c/' - complete kill 'c/-/S/' 'c/%/j/' \ - 'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/' - - # these from Marc Horowitz - complete attach 'n/-mountpoint/d/' 'n/-m/d/' 'n/-type/(afs nfs rvd ufs)/' \ - 'n/-t/(afs nfs rvd ufs)/' 'n/-user/u/' 'n/-U/u/' \ - 'c/-/(verbose quiet force printpath lookup debug map \ - nomap remap zephyr nozephyr readonly write \ - mountpoint noexplicit explicit type mountoptions \ - nosetuid setuid override skipfsck lock user host)/' \ - 'n/-e/f/' 'n/*/()/' - complete hesinfo 'p/1/u/' \ - 'p/2/(passwd group uid grplist pcap pobox cluster \ - filsys sloc service)/' - - # these from E. Jay Berkenbilt - # = isn't always followed by a filename or a path anymore - jgotts - if ($?traditional_complete) then - complete ./configure \ - 'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\ - bindir,sbindir,libexecdir,datadir,\ - sysconfdir,sharedstatedir,localstatedir,\ - libdir,includedir,oldincludedir,infodir,\ - mandir,srcdir}/(=)//' \ - 'c/--/(cache-file verbose prefix exec-prefix bindir \ - sbindir libexecdir datadir sysconfdir \ - sharedstatedir localstatedir libdir \ - includedir oldincludedir infodir mandir \ - srcdir)//' - else - complete ./configure \ - 'c@--{prefix,exec-prefix,bindir,sbindir,libexecdir,datadir,sysconfdir,sharedstatedir,localstatedir,infodir,mandir,srcdir,x-includes,x-libraries}=*@x:'@ \ - 'c/--cachefile=*/x:/' \ - 'c/--{enable,disable,with}-*/x://' \ - 'c/--*=/x://' \ - 'c/--/(prefix= exec-prefix= bindir= \ - sbindir= libexecdir= datadir= sysconfdir= \ - sharedstatedir= localstatedir= infodir= \ - mandir= srcdir= x-includes= x-libraries= cachefile= \ - enable- disable- with- \ - help no-create quiet silent version verbose )//' - endif - complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \ - dfaxhigh dfaxlow laserjet ljet4 sparc pbm \ - pbmraw pgm pgmraw ppm ppmraw bit)/' \ - 'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \ - 'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/' - complete perl 'n/-S/c/' - complete printenv 'n/*/e/' - complete sccs p/1/"(admin cdc check clean comb deledit delget \ - delta diffs edit enter fix get help info \ - print prs prt rmdel sccsdiff tell unedit \ - unget val what)"/ - complete setenv 'p/1/e/' 'c/*:/f/' - - # these and method of setting hosts from Kimmo Suominen - if ( -f "$HOME/.mh_profile" && -x "`which folders`" ) then - - if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`" - if ( ! $?MHA ) setenv MHA "`ali | sed -e '/^ /d' -e 's/:.*//'`" - - set folders = ( $FOLDERS ) - set mha = ( $MHA ) - - complete ali \ - 'c/-/(alias nolist list nonormalize normalize nouser user help)/' \ - 'n,-alias,f,' - - complete anno \ - 'c/-/(component noinplace inplace nodate date text help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete burst \ - 'c/-/(noinplace inplace noquiet quiet noverbose verbose help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete comp \ - 'c/-/(draftfolder draftmessage nodraftfolder editor noedit file form nouse use whatnowproc nowhatnowproc help)/' \ - 'c,+,$folders,' \ - 'n,-whatnowproc,c,' \ - 'n,-file,f,'\ - 'n,-form,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete dist \ - 'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit form noinplace inplace whatnowproc nowhatnowproc help)/' \ - 'c,+,$folders,' \ - 'n,-whatnowproc,c,' \ - 'n,-form,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete folder \ - 'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete folders \ - 'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete forw \ - 'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit filter form noformat format noinplace inplace digest issue volume whatnowproc nowhatnowproc help)/' \ - 'c,+,$folders,' \ - 'n,-whatnowproc,c,' \ - 'n,-filter,f,'\ - 'n,-form,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete inc \ - 'c/-/(audit file noaudit nochangecur changecur file form format nosilent silent notruncate truncate width help)/' \ - 'c,+,$folders,' \ - 'n,-audit,f,'\ - 'n,-form,f,' - - complete mark \ - 'c/-/(add delete list sequence nopublic public nozero zero help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete mhmail \ - 'c/-/(body cc from subject help)/' \ - 'n,-cc,$mha,' \ - 'n,-from,$mha,' \ - 'n/*/$mha/' - - complete mhpath \ - 'c/-/(help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete msgchk \ - 'c/-/(nodate date nonotify notify help)/' - - complete msh \ - 'c/-/(prompt noscan scan notopcur topcur help)/' - - complete next \ - 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \ - 'c,+,$folders,' \ - 'n,-moreproc,c,' \ - 'n,-showproc,c,' \ - 'n,-form,f,' - - complete packf \ - 'c/-/(file help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete pick \ - 'c/-/(and or not lbrace rbrace cc date from search subject to othercomponent after before datefield sequence nopublic public nozero zero nolist list help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete prev \ - 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \ - 'c,+,$folders,' \ - 'n,-moreproc,c,' \ - 'n,-showproc,c,' \ - 'n,-form,f,' - - complete prompter \ - 'c/-/(erase kill noprepend prepend norapid rapid nodoteof doteof help)/' - - complete refile \ - 'c/-/(draft nolink link nopreserve preserve src file help)/' \ - 'c,+,$folders,' \ - 'n,-file,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete rmf \ - 'c/-/(nointeractive interactive help)/' \ - 'c,+,$folders,' - - complete rmm \ - 'c/-/(help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete scan \ - 'c/-/(noclear clear form format noheader header width noreverse reverse file help)/' \ - 'c,+,$folders,' \ - 'n,-form,f,'\ - 'n,-file,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete send \ - 'c/-/(alias draft draftfolder draftmessage nodraftfolder filter nofilter noformat format noforward forward nomsgid msgid nopush push noverbose verbose nowatch watch width help)/' \ - 'n,-alias,f,'\ - 'n,-filter,f,' - - complete show \ - 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \ - 'c,+,$folders,' \ - 'n,-moreproc,c,' \ - 'n,-showproc,c,' \ - 'n,-form,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete sortm \ - 'c/-/(datefield textfield notextfield limit nolimit noverbose verbose help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete vmh \ - 'c/-/(prompt vmhproc novmhproc help)/' \ - 'n,-vmhproc,c,' - - complete whatnow \ - 'c/-/(draftfolder draftmessage nodraftfolder editor noedit prompt help)/' - - complete whom \ - 'c/-/(alias nocheck check draft draftfolder draftmessage nodraftfolder help)/' \ - 'n,-alias,f,' - - complete plum \ - 'c/-/()/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete mail \ - 'c/-/()/' \ - 'n/*/$mha/' +# Old TCSH versions don't define OSTYPE. +# Use a close approximation instead. - endif +if ( ! $?OSTYPE ) then + setenv OSTYPE `echo "$HOSTTYPE" | sed -e 's/^(i[3456]86|(amd|x86_)64)-//'` +endif - #from Dan Nicolaescu - if ( $?MODULESHOME ) then - alias Compl_module 'find ${MODULEPATH:as/:/ /} -name .version -o -name .modulea\* -prune -o -print | sed `echo "-e s@${MODULEPATH:as%:%/\*@@g -e s@%}/\*@@g"`' - complete module 'p%1%(add load unload switch display avail use unuse update purge list clear help initadd initrm initswitch initlist initclear)%' \ - 'n%{unl*,sw*,inits*}%`echo "$LOADEDMODULES:as/:/ /"`%' \ - 'n%{lo*,di*,he*,inita*,initr*}%`eval Compl_module`%' \ - 'N%{sw*,initsw*}%`eval Compl_module`%' 'C%-%(-append)%' 'n%{use,unu*,av*}%d%' 'n%-append%d%' \ - 'C%[^-]*%`eval Compl_module`%' - endif +if ( ! $?hosts ) set hosts + +foreach f ( "$HOME/."{,r,ssh/known_}hosts* \ + /usr/local/etc/csh.hosts /etc/hosts.equiv ) + if ( -r "$f" ) then + set hosts=($hosts `sed \ + -e 's/#.*//' \ + -e '/^[+-]@/d' \ + -e 's/^[-+]//' \ + -e 's/[[:space:]].*//' \ + -e 's/,/\n/g' "$f" \ + | sed -e '/^[.:[:xdigit:][:space:]]*$/d'`) + endif +end +unset f + +if ( -r "$HOME/.netrc" ) then + set hosts=($hosts `awk '$1 == "machine" { print $2 }' "$HOME/.netrc"`) +endif + +set hosts=(`echo $hosts | tr ' ' '\012' | sort -u`) + +if ( ! $#hosts ) then + # This is just a hint for the user. + set hosts=(ftp.funet.fi ftp.gnu.org ftp.uu.net) +endif + +complete ywho n/*/\$hosts/ # argument from list in $hosts +complete rsh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ +complete ssh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ +complete xrsh p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ +complete rlogin p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ +complete telnet p/1/\$hosts/ p/2/x:''/ n/*/n/ + +complete cd p/1/d/ # Directories only +complete chdir p/1/d/ +complete pushd p/1/d/ +complete popd p/1/d/ +complete pu p/1/d/ +complete po p/1/d/ +complete complete p/1/X/ # Completions only +complete uncomplete n/*/X/ +complete exec p/1/c/ # Commands only +complete trace p/1/c/ +complete strace p/1/c/ +complete which n/*/c/ +complete where n/*/c/ +complete skill p/1/c/ +complete dde p/1/c/ +complete adb c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/ +complete sdb p/1/c/ +complete dbx c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/ +complete xdb p/1/c/ +complete gdb n/-d/d/ n/*/c/ +complete ups p/1/c/ +complete set 'c/*=/f/' 'p/1/s/=' 'n/=/f/' +complete unset n/*/s/ +complete alias p/1/a/ # only aliases are valid +complete unalias n/*/a/ +complete xdvi n/*/f:*.dvi/ +complete dvips n/*/f:*.dvi/ +complete tex n/*/f:*.{tex,texi}/ +complete latex n/*/f:*.{tex,ltx}/ + +complete su \ + c/--/"(login fast preserve-environment command shell help version)"/ \ + c/-/"(f l m p c s -)"/ \ + n/{-c,--command}/c/ \ + n@{-s,--shell}@'`cat /etc/shells`'@ \ + n/*/u/ +complete cc \ + c/-[IL]/d/ \ + c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \ + c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/ +complete acc \ + c/-[IL]/d/ \ + c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \ + c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/ +complete gcc \ + c/-[IL]/d/ \ + c/-f/"(caller-saves cse-follow-jumps delayed-branch elide-constructors \ + expensive-optimizations float-store force-addr force-mem inline \ + inline-functions keep-inline-functions memoize-lookups \ + no-default-inline no-defer-pop no-function-cse omit-frame-pointer \ + rerun-cse-after-loop schedule-insns schedule-insns2 strength-reduce \ + thread-jumps unroll-all-loops unroll-loops syntax-only all-virtual \ + cond-mismatch dollars-in-identifiers enum-int-equiv no-asm no-builtin \ + no-strict-prototype signed-bitfields signed-char this-is-variable \ + unsigned-bitfields unsigned-char writable-strings call-saved-reg \ + call-used-reg fixed-reg no-common no-gnu-binutils nonnull-objects \ + pcc-struct-return pic PIC shared-data short-enums short-double \ + volatile)"/ \ + c/-W/"(all aggregate-return cast-align cast-qual comment conversion \ + enum-clash error format id-clash-len implicit missing-prototypes \ + no-parentheses pointer-arith return-type shadow strict-prototypes \ + switch uninitialized unused write-strings)"/ \ + c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd short c68000 c68020 \ + soft-float g gnu unix fpu no-epilogue)"/ \ + c/-d/"(D M N)"/ \ + c/-/"(f W vspec v vpath ansi traditional traditional-cpp trigraphs pedantic \ + x o l c g L I D U O O2 C E H B b V M MD MM i dynamic nodtdlib static \ + nostdinc undef)"/ \ + c/-l/f:*.a/ \ + n/*/f:*.{c,C,cc,o,a,s,i}/ +complete g++ n/*/f:*.{C,cc,o,s,i}/ +complete CC n/*/f:*.{C,cc,cpp,o,s,i}/ +complete rm \ + c/--/"(directory force interactive verbose recursive help version)"/ \ + c/-/"(d f i v r R -)"/ \ + n/*/f:^*.{c,cc,C,h,in}/ + # Protect precious files +complete vi n/*/f:^*.[oa]/ +complete bindkey \ + N/-a/b/ N/-c/c/ n/-[ascr]/'x:'/ \ + n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/ \ + n/-k/"(left right up down)"/ p/2-/b/ \ + p/1/'x:'/ + +complete find \ + n/-fstype/"(nfs 4.2)"/ \ + n/-name/f/ \ + n/-type/"(c b d f p l s)"/ \ + n/-user/u/ \ + n/-group/g/ \ + n/-exec/c/ \ + n/-ok/c/ \ + n/-cpio/f/ \ + n/-ncpio/f/ \ + n/-newer/f/ \ + c/-/"(fstype name perm prune type user nouser group nogroup size inum \ + atime mtime ctime exec ok print ls cpio ncpio newer xdev depth \ + daystart follow maxdepth mindepth noleaf version anewer cnewer \ + amin cmin mmin true false uid gid ilname iname ipath iregex links \ + lname empty path regex used xtype fprint fprint0 fprintf print0 \ + printf not a and o or)"/ \ + n/*/d/ + +complete -%* c/%/j/ # fill in the jobs builtin +complete {fg,bg,stop} c/%/j/ p/1/"(%)"// + +complete limit c/-/"(h)"/ n/*/l/ +complete unlimit c/-/"(h)"/ n/*/l/ + +#complete -co* p/0/"(compress)"/ # make compress completion +# # not ambiguous + +# "zcat" may be linked to "compress" or "gzip" +if (-X zcat) then + zcat --version >& /dev/null + if ($status != 0) then + complete zcat n/*/f:*.Z/ + else + complete zcat c/--/"(force help license quiet version)"/ \ + c/-/"(f h L q V -)"/ \ + n/*/f:*.{gz,Z,z,zip}/ + endif +endif + +complete finger c/*@/\$hosts/ n/*/u/@ +complete ping p/1/\$hosts/ +complete traceroute p/1/\$hosts/ + +complete {talk,ntalk,phone} \ + p/1/'`users | tr " " "\012" | uniq`'/ \ + n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/ + +complete ftp c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/ + +# this one is simple... +#complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/: +# From Michael Schroeder *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Apr 15 11:16:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03E22D3E508; Sat, 15 Apr 2017 11:16:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1F2A6E3; Sat, 15 Apr 2017 11:16:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FBGC3c086078; Sat, 15 Apr 2017 11:16:12 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FBGCd5086069; Sat, 15 Apr 2017 11:16:12 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151116.v3FBGCd5086069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 11:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r316958 - in stable/10: bin/csh contrib/tcsh contrib/tcsh/config contrib/tcsh/nls contrib/tcsh/nls/C contrib/tcsh/nls/et contrib/tcsh/nls/finnish contrib/tcsh/nls/french contrib/tcsh/nl... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 11:16:14 -0000 Author: dchagin Date: Sat Apr 15 11:16:11 2017 New Revision: 316958 URL: https://svnweb.freebsd.org/changeset/base/316958 Log: MFC r315948: Update tcsh to 6.20.00 MFC r315952: Update tcsh to vendor git b605cb561d Vendor changes: 1. PR/471: Daiki Ueno: Delay interpreting arginp until we've processed our startup files (which can change the NLS environment). 2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar). 3. Fix out of bounds read (Brooks Davis) (reproduce by starting tcsh and hitting tab at the prompt). 4. Don't play pointer tricks that are undefined in modern c (Brooks Davis). Added: stable/10/contrib/tcsh/dotlock.c - copied unchanged from r315948, head/contrib/tcsh/dotlock.c stable/10/contrib/tcsh/dotlock.h - copied unchanged from r315948, head/contrib/tcsh/dotlock.h stable/10/contrib/tcsh/tcsh.man.new - copied unchanged from r315948, head/contrib/tcsh/tcsh.man.new Deleted: stable/10/contrib/tcsh/configure.in Modified: stable/10/bin/csh/Makefile stable/10/contrib/tcsh/Fixes (contents, props changed) stable/10/contrib/tcsh/Imakefile (contents, props changed) stable/10/contrib/tcsh/Makefile.in (contents, props changed) stable/10/contrib/tcsh/Makefile.std (contents, props changed) stable/10/contrib/tcsh/Makefile.vms (contents, props changed) stable/10/contrib/tcsh/README (contents, props changed) stable/10/contrib/tcsh/complete.tcsh (contents, props changed) stable/10/contrib/tcsh/config.guess (contents, props changed) stable/10/contrib/tcsh/config.h.in (contents, props changed) stable/10/contrib/tcsh/config.sub (contents, props changed) stable/10/contrib/tcsh/config/bsd4.4 (contents, props changed) stable/10/contrib/tcsh/config_f.h (contents, props changed) stable/10/contrib/tcsh/configure (contents, props changed) stable/10/contrib/tcsh/ed.chared.c (contents, props changed) stable/10/contrib/tcsh/ed.decls.h (contents, props changed) stable/10/contrib/tcsh/ed.defns.c (contents, props changed) stable/10/contrib/tcsh/ed.inputl.c (contents, props changed) stable/10/contrib/tcsh/ed.refresh.c (contents, props changed) stable/10/contrib/tcsh/ed.screen.c (contents, props changed) stable/10/contrib/tcsh/ed.term.h (contents, props changed) stable/10/contrib/tcsh/ed.xmap.c (contents, props changed) stable/10/contrib/tcsh/gethost.c (contents, props changed) stable/10/contrib/tcsh/glob.c (contents, props changed) stable/10/contrib/tcsh/host.defs (contents, props changed) stable/10/contrib/tcsh/nls/C/set1 (contents, props changed) stable/10/contrib/tcsh/nls/C/set20 (contents, props changed) stable/10/contrib/tcsh/nls/C/set9 (contents, props changed) stable/10/contrib/tcsh/nls/Makefile.in stable/10/contrib/tcsh/nls/catgen stable/10/contrib/tcsh/nls/et/set1 (contents, props changed) stable/10/contrib/tcsh/nls/et/set20 (contents, props changed) stable/10/contrib/tcsh/nls/et/set9 (contents, props changed) stable/10/contrib/tcsh/nls/finnish/set1 (contents, props changed) stable/10/contrib/tcsh/nls/finnish/set20 (contents, props changed) stable/10/contrib/tcsh/nls/finnish/set3 (contents, props changed) stable/10/contrib/tcsh/nls/finnish/set9 (contents, props changed) stable/10/contrib/tcsh/nls/french/set1 (contents, props changed) stable/10/contrib/tcsh/nls/french/set20 (contents, props changed) stable/10/contrib/tcsh/nls/french/set9 (contents, props changed) stable/10/contrib/tcsh/nls/german/set1 (contents, props changed) stable/10/contrib/tcsh/nls/german/set20 (contents, props changed) stable/10/contrib/tcsh/nls/german/set9 (contents, props changed) stable/10/contrib/tcsh/nls/greek/set1 (contents, props changed) stable/10/contrib/tcsh/nls/greek/set20 (contents, props changed) stable/10/contrib/tcsh/nls/greek/set9 (contents, props changed) stable/10/contrib/tcsh/nls/italian/set1 (contents, props changed) stable/10/contrib/tcsh/nls/italian/set20 (contents, props changed) stable/10/contrib/tcsh/nls/italian/set9 (contents, props changed) stable/10/contrib/tcsh/nls/ja/set1 (contents, props changed) stable/10/contrib/tcsh/nls/russian/set1 (contents, props changed) stable/10/contrib/tcsh/nls/russian/set20 (contents, props changed) stable/10/contrib/tcsh/nls/russian/set9 (contents, props changed) stable/10/contrib/tcsh/nls/spanish/set1 (contents, props changed) stable/10/contrib/tcsh/nls/spanish/set20 (contents, props changed) stable/10/contrib/tcsh/nls/spanish/set9 (contents, props changed) stable/10/contrib/tcsh/nls/ukrainian/set1 (contents, props changed) stable/10/contrib/tcsh/nls/ukrainian/set20 (contents, props changed) stable/10/contrib/tcsh/nls/ukrainian/set9 (contents, props changed) stable/10/contrib/tcsh/patchlevel.h (contents, props changed) stable/10/contrib/tcsh/sh.c (contents, props changed) stable/10/contrib/tcsh/sh.char.h (contents, props changed) stable/10/contrib/tcsh/sh.decls.h (contents, props changed) stable/10/contrib/tcsh/sh.dir.c (contents, props changed) stable/10/contrib/tcsh/sh.dol.c (contents, props changed) stable/10/contrib/tcsh/sh.err.c (contents, props changed) stable/10/contrib/tcsh/sh.exec.c (contents, props changed) stable/10/contrib/tcsh/sh.exp.c (contents, props changed) stable/10/contrib/tcsh/sh.file.c (contents, props changed) stable/10/contrib/tcsh/sh.func.c (contents, props changed) stable/10/contrib/tcsh/sh.glob.c (contents, props changed) stable/10/contrib/tcsh/sh.h (contents, props changed) stable/10/contrib/tcsh/sh.hist.c (contents, props changed) stable/10/contrib/tcsh/sh.init.c (contents, props changed) stable/10/contrib/tcsh/sh.lex.c (contents, props changed) stable/10/contrib/tcsh/sh.misc.c (contents, props changed) stable/10/contrib/tcsh/sh.print.c (contents, props changed) stable/10/contrib/tcsh/sh.proc.c (contents, props changed) stable/10/contrib/tcsh/sh.proc.h (contents, props changed) stable/10/contrib/tcsh/sh.sem.c (contents, props changed) stable/10/contrib/tcsh/sh.set.c (contents, props changed) stable/10/contrib/tcsh/sh.time.c (contents, props changed) stable/10/contrib/tcsh/tc.alloc.c (contents, props changed) stable/10/contrib/tcsh/tc.bind.c (contents, props changed) stable/10/contrib/tcsh/tc.const.c (contents, props changed) stable/10/contrib/tcsh/tc.decls.h (contents, props changed) stable/10/contrib/tcsh/tc.func.c (contents, props changed) stable/10/contrib/tcsh/tc.nls.c (contents, props changed) stable/10/contrib/tcsh/tc.nls.h (contents, props changed) stable/10/contrib/tcsh/tc.os.c (contents, props changed) stable/10/contrib/tcsh/tc.printf.c (contents, props changed) stable/10/contrib/tcsh/tc.prompt.c (contents, props changed) stable/10/contrib/tcsh/tc.str.c (contents, props changed) stable/10/contrib/tcsh/tc.who.c (contents, props changed) stable/10/contrib/tcsh/tcsh.man (contents, props changed) stable/10/contrib/tcsh/tw.color.c (contents, props changed) stable/10/contrib/tcsh/tw.comp.c (contents, props changed) stable/10/contrib/tcsh/tw.decls.h (contents, props changed) stable/10/contrib/tcsh/tw.init.c (contents, props changed) stable/10/contrib/tcsh/tw.parse.c (contents, props changed) Directory Properties: stable/10/contrib/tcsh/FAQ (props changed) stable/10/contrib/tcsh/MAKEDIFFS (props changed) stable/10/contrib/tcsh/MAKESHAR (props changed) stable/10/contrib/tcsh/NewThings (props changed) stable/10/contrib/tcsh/Ported (props changed) stable/10/contrib/tcsh/README.imake (props changed) stable/10/contrib/tcsh/WishList (props changed) stable/10/contrib/tcsh/Y2K (props changed) stable/10/contrib/tcsh/csh-mode.el (props changed) stable/10/contrib/tcsh/ed.h (props changed) stable/10/contrib/tcsh/ed.init.c (props changed) stable/10/contrib/tcsh/ed.term.c (props changed) stable/10/contrib/tcsh/eight-bit.me (props changed) stable/10/contrib/tcsh/glob.3 (props changed) stable/10/contrib/tcsh/glob.h (props changed) stable/10/contrib/tcsh/imake.config (props changed) stable/10/contrib/tcsh/install-sh (props changed) stable/10/contrib/tcsh/ma.setp.c (props changed) stable/10/contrib/tcsh/mi.termios.c (props changed) stable/10/contrib/tcsh/mi.varargs.h (props changed) stable/10/contrib/tcsh/mi.wait.h (props changed) stable/10/contrib/tcsh/nls/C/charset (props changed) stable/10/contrib/tcsh/nls/C/set10 (props changed) stable/10/contrib/tcsh/nls/C/set11 (props changed) stable/10/contrib/tcsh/nls/C/set12 (props changed) stable/10/contrib/tcsh/nls/C/set13 (props changed) stable/10/contrib/tcsh/nls/C/set14 (props changed) stable/10/contrib/tcsh/nls/C/set15 (props changed) stable/10/contrib/tcsh/nls/C/set16 (props changed) stable/10/contrib/tcsh/nls/C/set17 (props changed) stable/10/contrib/tcsh/nls/C/set18 (props changed) stable/10/contrib/tcsh/nls/C/set19 (props changed) stable/10/contrib/tcsh/nls/C/set2 (props changed) stable/10/contrib/tcsh/nls/C/set21 (props changed) stable/10/contrib/tcsh/nls/C/set22 (props changed) stable/10/contrib/tcsh/nls/C/set23 (props changed) stable/10/contrib/tcsh/nls/C/set24 (props changed) stable/10/contrib/tcsh/nls/C/set25 (props changed) stable/10/contrib/tcsh/nls/C/set26 (props changed) stable/10/contrib/tcsh/nls/C/set27 (props changed) stable/10/contrib/tcsh/nls/C/set29 (props changed) stable/10/contrib/tcsh/nls/C/set3 (props changed) stable/10/contrib/tcsh/nls/C/set30 (props changed) stable/10/contrib/tcsh/nls/C/set31 (props changed) stable/10/contrib/tcsh/nls/C/set4 (props changed) stable/10/contrib/tcsh/nls/C/set5 (props changed) stable/10/contrib/tcsh/nls/C/set6 (props changed) stable/10/contrib/tcsh/nls/C/set7 (props changed) stable/10/contrib/tcsh/nls/C/set8 (props changed) stable/10/contrib/tcsh/nls/et/charset (props changed) stable/10/contrib/tcsh/nls/et/set10 (props changed) stable/10/contrib/tcsh/nls/et/set11 (props changed) stable/10/contrib/tcsh/nls/et/set12 (props changed) stable/10/contrib/tcsh/nls/et/set13 (props changed) stable/10/contrib/tcsh/nls/et/set14 (props changed) stable/10/contrib/tcsh/nls/et/set15 (props changed) stable/10/contrib/tcsh/nls/et/set16 (props changed) stable/10/contrib/tcsh/nls/et/set17 (props changed) stable/10/contrib/tcsh/nls/et/set18 (props changed) stable/10/contrib/tcsh/nls/et/set19 (props changed) stable/10/contrib/tcsh/nls/et/set2 (props changed) stable/10/contrib/tcsh/nls/et/set21 (props changed) stable/10/contrib/tcsh/nls/et/set22 (props changed) stable/10/contrib/tcsh/nls/et/set23 (props changed) stable/10/contrib/tcsh/nls/et/set24 (props changed) stable/10/contrib/tcsh/nls/et/set25 (props changed) stable/10/contrib/tcsh/nls/et/set26 (props changed) stable/10/contrib/tcsh/nls/et/set27 (props changed) stable/10/contrib/tcsh/nls/et/set29 (props changed) stable/10/contrib/tcsh/nls/et/set3 (props changed) stable/10/contrib/tcsh/nls/et/set30 (props changed) stable/10/contrib/tcsh/nls/et/set31 (props changed) stable/10/contrib/tcsh/nls/et/set4 (props changed) stable/10/contrib/tcsh/nls/et/set5 (props changed) stable/10/contrib/tcsh/nls/et/set6 (props changed) stable/10/contrib/tcsh/nls/et/set7 (props changed) stable/10/contrib/tcsh/nls/et/set8 (props changed) stable/10/contrib/tcsh/nls/finnish/charset (props changed) stable/10/contrib/tcsh/nls/finnish/set10 (props changed) stable/10/contrib/tcsh/nls/finnish/set11 (props changed) stable/10/contrib/tcsh/nls/finnish/set12 (props changed) stable/10/contrib/tcsh/nls/finnish/set13 (props changed) stable/10/contrib/tcsh/nls/finnish/set14 (props changed) stable/10/contrib/tcsh/nls/finnish/set15 (props changed) stable/10/contrib/tcsh/nls/finnish/set16 (props changed) stable/10/contrib/tcsh/nls/finnish/set17 (props changed) stable/10/contrib/tcsh/nls/finnish/set18 (props changed) stable/10/contrib/tcsh/nls/finnish/set19 (props changed) stable/10/contrib/tcsh/nls/finnish/set2 (props changed) stable/10/contrib/tcsh/nls/finnish/set21 (props changed) stable/10/contrib/tcsh/nls/finnish/set22 (props changed) stable/10/contrib/tcsh/nls/finnish/set23 (props changed) stable/10/contrib/tcsh/nls/finnish/set24 (props changed) stable/10/contrib/tcsh/nls/finnish/set25 (props changed) stable/10/contrib/tcsh/nls/finnish/set26 (props changed) stable/10/contrib/tcsh/nls/finnish/set27 (props changed) stable/10/contrib/tcsh/nls/finnish/set29 (props changed) stable/10/contrib/tcsh/nls/finnish/set30 (props changed) stable/10/contrib/tcsh/nls/finnish/set31 (props changed) stable/10/contrib/tcsh/nls/finnish/set4 (props changed) stable/10/contrib/tcsh/nls/finnish/set5 (props changed) stable/10/contrib/tcsh/nls/finnish/set6 (props changed) stable/10/contrib/tcsh/nls/finnish/set7 (props changed) stable/10/contrib/tcsh/nls/finnish/set8 (props changed) stable/10/contrib/tcsh/nls/french/charset (props changed) stable/10/contrib/tcsh/nls/french/set10 (props changed) stable/10/contrib/tcsh/nls/french/set11 (props changed) stable/10/contrib/tcsh/nls/french/set12 (props changed) stable/10/contrib/tcsh/nls/french/set13 (props changed) stable/10/contrib/tcsh/nls/french/set14 (props changed) stable/10/contrib/tcsh/nls/french/set15 (props changed) stable/10/contrib/tcsh/nls/french/set16 (props changed) stable/10/contrib/tcsh/nls/french/set17 (props changed) stable/10/contrib/tcsh/nls/french/set18 (props changed) stable/10/contrib/tcsh/nls/french/set19 (props changed) stable/10/contrib/tcsh/nls/french/set2 (props changed) stable/10/contrib/tcsh/nls/french/set21 (props changed) stable/10/contrib/tcsh/nls/french/set22 (props changed) stable/10/contrib/tcsh/nls/french/set23 (props changed) stable/10/contrib/tcsh/nls/french/set24 (props changed) stable/10/contrib/tcsh/nls/french/set25 (props changed) stable/10/contrib/tcsh/nls/french/set26 (props changed) stable/10/contrib/tcsh/nls/french/set27 (props changed) stable/10/contrib/tcsh/nls/french/set29 (props changed) stable/10/contrib/tcsh/nls/french/set3 (props changed) stable/10/contrib/tcsh/nls/french/set30 (props changed) stable/10/contrib/tcsh/nls/french/set31 (props changed) stable/10/contrib/tcsh/nls/french/set4 (props changed) stable/10/contrib/tcsh/nls/french/set5 (props changed) stable/10/contrib/tcsh/nls/french/set6 (props changed) stable/10/contrib/tcsh/nls/french/set7 (props changed) stable/10/contrib/tcsh/nls/french/set8 (props changed) stable/10/contrib/tcsh/nls/german/charset (props changed) stable/10/contrib/tcsh/nls/german/set10 (props changed) stable/10/contrib/tcsh/nls/german/set11 (props changed) stable/10/contrib/tcsh/nls/german/set12 (props changed) stable/10/contrib/tcsh/nls/german/set13 (props changed) stable/10/contrib/tcsh/nls/german/set14 (props changed) stable/10/contrib/tcsh/nls/german/set15 (props changed) stable/10/contrib/tcsh/nls/german/set16 (props changed) stable/10/contrib/tcsh/nls/german/set17 (props changed) stable/10/contrib/tcsh/nls/german/set18 (props changed) stable/10/contrib/tcsh/nls/german/set19 (props changed) stable/10/contrib/tcsh/nls/german/set2 (props changed) stable/10/contrib/tcsh/nls/german/set21 (props changed) stable/10/contrib/tcsh/nls/german/set22 (props changed) stable/10/contrib/tcsh/nls/german/set23 (props changed) stable/10/contrib/tcsh/nls/german/set24 (props changed) stable/10/contrib/tcsh/nls/german/set25 (props changed) stable/10/contrib/tcsh/nls/german/set26 (props changed) stable/10/contrib/tcsh/nls/german/set27 (props changed) stable/10/contrib/tcsh/nls/german/set29 (props changed) stable/10/contrib/tcsh/nls/german/set3 (props changed) stable/10/contrib/tcsh/nls/german/set30 (props changed) stable/10/contrib/tcsh/nls/german/set31 (props changed) stable/10/contrib/tcsh/nls/german/set4 (props changed) stable/10/contrib/tcsh/nls/german/set5 (props changed) stable/10/contrib/tcsh/nls/german/set6 (props changed) stable/10/contrib/tcsh/nls/german/set7 (props changed) stable/10/contrib/tcsh/nls/german/set8 (props changed) stable/10/contrib/tcsh/nls/greek/charset (props changed) stable/10/contrib/tcsh/nls/greek/set10 (props changed) stable/10/contrib/tcsh/nls/greek/set11 (props changed) stable/10/contrib/tcsh/nls/greek/set12 (props changed) stable/10/contrib/tcsh/nls/greek/set13 (props changed) stable/10/contrib/tcsh/nls/greek/set14 (props changed) stable/10/contrib/tcsh/nls/greek/set15 (props changed) stable/10/contrib/tcsh/nls/greek/set16 (props changed) stable/10/contrib/tcsh/nls/greek/set17 (props changed) stable/10/contrib/tcsh/nls/greek/set18 (props changed) stable/10/contrib/tcsh/nls/greek/set19 (props changed) stable/10/contrib/tcsh/nls/greek/set2 (props changed) stable/10/contrib/tcsh/nls/greek/set21 (props changed) stable/10/contrib/tcsh/nls/greek/set22 (props changed) stable/10/contrib/tcsh/nls/greek/set23 (props changed) stable/10/contrib/tcsh/nls/greek/set24 (props changed) stable/10/contrib/tcsh/nls/greek/set25 (props changed) stable/10/contrib/tcsh/nls/greek/set26 (props changed) stable/10/contrib/tcsh/nls/greek/set27 (props changed) stable/10/contrib/tcsh/nls/greek/set29 (props changed) stable/10/contrib/tcsh/nls/greek/set3 (props changed) stable/10/contrib/tcsh/nls/greek/set30 (props changed) stable/10/contrib/tcsh/nls/greek/set31 (props changed) stable/10/contrib/tcsh/nls/greek/set4 (props changed) stable/10/contrib/tcsh/nls/greek/set5 (props changed) stable/10/contrib/tcsh/nls/greek/set6 (props changed) stable/10/contrib/tcsh/nls/greek/set7 (props changed) stable/10/contrib/tcsh/nls/greek/set8 (props changed) stable/10/contrib/tcsh/nls/italian/charset (props changed) stable/10/contrib/tcsh/nls/italian/set10 (props changed) stable/10/contrib/tcsh/nls/italian/set11 (props changed) stable/10/contrib/tcsh/nls/italian/set12 (props changed) stable/10/contrib/tcsh/nls/italian/set13 (props changed) stable/10/contrib/tcsh/nls/italian/set14 (props changed) stable/10/contrib/tcsh/nls/italian/set15 (props changed) stable/10/contrib/tcsh/nls/italian/set16 (props changed) stable/10/contrib/tcsh/nls/italian/set17 (props changed) stable/10/contrib/tcsh/nls/italian/set18 (props changed) stable/10/contrib/tcsh/nls/italian/set19 (props changed) stable/10/contrib/tcsh/nls/italian/set2 (props changed) stable/10/contrib/tcsh/nls/italian/set21 (props changed) stable/10/contrib/tcsh/nls/italian/set22 (props changed) stable/10/contrib/tcsh/nls/italian/set23 (props changed) stable/10/contrib/tcsh/nls/italian/set24 (props changed) stable/10/contrib/tcsh/nls/italian/set25 (props changed) stable/10/contrib/tcsh/nls/italian/set26 (props changed) stable/10/contrib/tcsh/nls/italian/set27 (props changed) stable/10/contrib/tcsh/nls/italian/set29 (props changed) stable/10/contrib/tcsh/nls/italian/set3 (props changed) stable/10/contrib/tcsh/nls/italian/set30 (props changed) stable/10/contrib/tcsh/nls/italian/set31 (props changed) stable/10/contrib/tcsh/nls/italian/set4 (props changed) stable/10/contrib/tcsh/nls/italian/set5 (props changed) stable/10/contrib/tcsh/nls/italian/set6 (props changed) stable/10/contrib/tcsh/nls/italian/set7 (props changed) stable/10/contrib/tcsh/nls/italian/set8 (props changed) stable/10/contrib/tcsh/nls/ja/charset (props changed) stable/10/contrib/tcsh/nls/ja/set10 (props changed) stable/10/contrib/tcsh/nls/ja/set11 (props changed) stable/10/contrib/tcsh/nls/ja/set12 (props changed) stable/10/contrib/tcsh/nls/ja/set13 (props changed) stable/10/contrib/tcsh/nls/ja/set15 (props changed) stable/10/contrib/tcsh/nls/ja/set16 (props changed) stable/10/contrib/tcsh/nls/ja/set17 (props changed) stable/10/contrib/tcsh/nls/ja/set18 (props changed) stable/10/contrib/tcsh/nls/ja/set2 (props changed) stable/10/contrib/tcsh/nls/ja/set21 (props changed) stable/10/contrib/tcsh/nls/ja/set24 (props changed) stable/10/contrib/tcsh/nls/ja/set29 (props changed) stable/10/contrib/tcsh/nls/ja/set3 (props changed) stable/10/contrib/tcsh/nls/ja/set30 (props changed) stable/10/contrib/tcsh/nls/ja/set4 (props changed) stable/10/contrib/tcsh/nls/ja/set5 (props changed) stable/10/contrib/tcsh/nls/ja/set6 (props changed) stable/10/contrib/tcsh/nls/ja/set7 (props changed) stable/10/contrib/tcsh/nls/ja/set8 (props changed) stable/10/contrib/tcsh/nls/russian/charset (props changed) stable/10/contrib/tcsh/nls/russian/set10 (props changed) stable/10/contrib/tcsh/nls/russian/set11 (props changed) stable/10/contrib/tcsh/nls/russian/set12 (props changed) stable/10/contrib/tcsh/nls/russian/set13 (props changed) stable/10/contrib/tcsh/nls/russian/set14 (props changed) stable/10/contrib/tcsh/nls/russian/set15 (props changed) stable/10/contrib/tcsh/nls/russian/set16 (props changed) stable/10/contrib/tcsh/nls/russian/set17 (props changed) stable/10/contrib/tcsh/nls/russian/set18 (props changed) stable/10/contrib/tcsh/nls/russian/set19 (props changed) stable/10/contrib/tcsh/nls/russian/set2 (props changed) stable/10/contrib/tcsh/nls/russian/set21 (props changed) stable/10/contrib/tcsh/nls/russian/set22 (props changed) stable/10/contrib/tcsh/nls/russian/set23 (props changed) stable/10/contrib/tcsh/nls/russian/set24 (props changed) stable/10/contrib/tcsh/nls/russian/set25 (props changed) stable/10/contrib/tcsh/nls/russian/set26 (props changed) stable/10/contrib/tcsh/nls/russian/set27 (props changed) stable/10/contrib/tcsh/nls/russian/set29 (props changed) stable/10/contrib/tcsh/nls/russian/set3 (props changed) stable/10/contrib/tcsh/nls/russian/set30 (props changed) stable/10/contrib/tcsh/nls/russian/set31 (props changed) stable/10/contrib/tcsh/nls/russian/set4 (props changed) stable/10/contrib/tcsh/nls/russian/set5 (props changed) stable/10/contrib/tcsh/nls/russian/set6 (props changed) stable/10/contrib/tcsh/nls/russian/set7 (props changed) stable/10/contrib/tcsh/nls/russian/set8 (props changed) stable/10/contrib/tcsh/nls/spanish/charset (props changed) stable/10/contrib/tcsh/nls/spanish/set10 (props changed) stable/10/contrib/tcsh/nls/spanish/set11 (props changed) stable/10/contrib/tcsh/nls/spanish/set12 (props changed) stable/10/contrib/tcsh/nls/spanish/set13 (props changed) stable/10/contrib/tcsh/nls/spanish/set14 (props changed) stable/10/contrib/tcsh/nls/spanish/set15 (props changed) stable/10/contrib/tcsh/nls/spanish/set16 (props changed) stable/10/contrib/tcsh/nls/spanish/set17 (props changed) stable/10/contrib/tcsh/nls/spanish/set18 (props changed) stable/10/contrib/tcsh/nls/spanish/set19 (props changed) stable/10/contrib/tcsh/nls/spanish/set2 (props changed) stable/10/contrib/tcsh/nls/spanish/set21 (props changed) stable/10/contrib/tcsh/nls/spanish/set22 (props changed) stable/10/contrib/tcsh/nls/spanish/set23 (props changed) stable/10/contrib/tcsh/nls/spanish/set24 (props changed) stable/10/contrib/tcsh/nls/spanish/set25 (props changed) stable/10/contrib/tcsh/nls/spanish/set26 (props changed) stable/10/contrib/tcsh/nls/spanish/set27 (props changed) stable/10/contrib/tcsh/nls/spanish/set29 (props changed) stable/10/contrib/tcsh/nls/spanish/set3 (props changed) stable/10/contrib/tcsh/nls/spanish/set30 (props changed) stable/10/contrib/tcsh/nls/spanish/set31 (props changed) stable/10/contrib/tcsh/nls/spanish/set4 (props changed) stable/10/contrib/tcsh/nls/spanish/set5 (props changed) stable/10/contrib/tcsh/nls/spanish/set6 (props changed) stable/10/contrib/tcsh/nls/spanish/set7 (props changed) stable/10/contrib/tcsh/nls/spanish/set8 (props changed) stable/10/contrib/tcsh/nls/ukrainian/charset (props changed) stable/10/contrib/tcsh/nls/ukrainian/set10 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set11 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set12 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set13 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set14 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set15 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set16 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set17 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set18 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set19 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set2 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set21 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set22 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set23 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set24 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set25 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set26 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set27 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set29 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set3 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set30 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set31 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set4 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set5 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set6 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set7 (props changed) stable/10/contrib/tcsh/nls/ukrainian/set8 (props changed) stable/10/contrib/tcsh/pathnames.h (props changed) stable/10/contrib/tcsh/sh.char.c (props changed) stable/10/contrib/tcsh/sh.dir.h (props changed) stable/10/contrib/tcsh/sh.parse.c (props changed) stable/10/contrib/tcsh/sh.types.h (props changed) stable/10/contrib/tcsh/snames.h (props changed) stable/10/contrib/tcsh/src.desc (props changed) stable/10/contrib/tcsh/tc.disc.c (props changed) stable/10/contrib/tcsh/tc.h (props changed) stable/10/contrib/tcsh/tc.os.h (props changed) stable/10/contrib/tcsh/tc.sched.c (props changed) stable/10/contrib/tcsh/tc.sig.c (props changed) stable/10/contrib/tcsh/tc.sig.h (props changed) stable/10/contrib/tcsh/tc.vers.c (props changed) stable/10/contrib/tcsh/tc.wait.h (props changed) stable/10/contrib/tcsh/tcsh.man2html (props changed) stable/10/contrib/tcsh/termcap.vms (props changed) stable/10/contrib/tcsh/tw.h (props changed) stable/10/contrib/tcsh/tw.help.c (props changed) stable/10/contrib/tcsh/tw.spell.c (props changed) stable/10/contrib/tcsh/vms.termcap.c (props changed) Modified: stable/10/bin/csh/Makefile ============================================================================== --- stable/10/bin/csh/Makefile Sat Apr 15 11:13:11 2017 (r316957) +++ stable/10/bin/csh/Makefile Sat Apr 15 11:16:11 2017 (r316958) @@ -32,6 +32,7 @@ SRCS+= tc.alloc.c tc.bind.c tc.const.c t tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \ tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \ tc.who.c tc.h +SRCS+= dotlock.c dotlock.h GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c SRCS+= ${GENHDRS} Modified: stable/10/contrib/tcsh/Fixes ============================================================================== --- stable/10/contrib/tcsh/Fixes Sat Apr 15 11:13:11 2017 (r316957) +++ stable/10/contrib/tcsh/Fixes Sat Apr 15 11:16:11 2017 (r316958) @@ -1,3 +1,96 @@ + 22. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar) + 20. V6.20.00 - 20161124 + 19. Don't resize the screen if it did not change size. + 18. V6.19.01 - 20161025 + 17. restore file description when cleaning up after eval: + repeat 99 time + 16. PR/572: Fix $SHLVL issue when exec'ing subshells. + 15. PR/403: Fix backquote expansion for multi-byte character sets. + 14. Fix drawing issu with multi-line prompt (Kensuke Iwahashi/David Kaspar) + 13. always send prusage to stdout. + 12. PR/526: Fix double \\ printing from previous fix in history expansion. + 11. Android updates from Corinna Vinschen + 10. PR/526: Quote backslashes properly so they can be preserved in `` + expansions + 9. Fix memory leak for paraml + 8. Add notempty and ask values for the noclobber setting (Martin Tournoij) + 7. more correct $wordchars for vimode (Luke Mewburn) + 6. expose VImode in $vimode (Luke Mewburn) + 5. display what the compiled in editor is in bindkey -d (Luke Mewburn) + 4. run-fg-editor improvements and documentation (Luke Mewburn) + 3. Fix parsing of 'if (cond)then' (Fridolin Pokorny) + 2. PR/437: Fix handling of invalid unicode characters. + 1. PR/451: Fix error messages containing %c to be always '%c' + + 41. V6.19.00 - 20150521 + 40. V6.18.05 - 20150510 + 39. fix reseting when interrupted inside an eval "eval sleep 10^C" + (paulo.cesar.pereira.de.andrade) + 38. rename handle_intr -> handle_interrupt as originally intended. + 37. fix input tests that need stdin on a tty + 36. V6.18.04 - 20150504 + 35. revert fix echo "\1", it is incorrect. + 34. revert fix to PR/437, breaks short strings. + 33. V6.18.03 - 20150503 + 32. PR/437: Nakajima Akira: Fix segmentation fault reading input files + 31. PR/291: Print job status messages to stderr. + 30. Fridolin Pokorny NUL in `` does not mean EOF. + 29. Pavel Raiskup fix hang with: + while (1) + ( date & ; wait ) + end + 28. Add cdtohome special variable (Martin Tournoij) + 27. Fix root prompt char for windows (Corinna Vinschen) + 26. For "next" completion matches only consider exact matches of the previous + word (Jamie Landeg-Jones) + 25. Fix echo "\1" for echo_style=both where the first character was + not processed properly (Gary Duzan) + 24. V6.18.02 - 20140618 + 23. fix ls-F /non printing exit value twice. + 22. rename configure.in to configure.ac, add aclocal.m4 to CVS + 21. set foo="aabaabaa"; echo $foo:as/a// should produce bb + 20. Add locked merge history support (Marcin Konarski) + 19. Support more resource limits from various BSD's + 18. Cache history count to speed up thing + 17. PR/240: minix support + 16. revert fix for 15. Causes extra quoting, for example (foo is a program + that prints its arguments): + $ ./foo 'abc' * + '\a\b\c' + 15. fix globbing for ``, stripping backslashes. Example: + cat << _EOF > huh + echo 'hello\;world' + _EOF + echo `./huh 0` + echo `./huh $?` + 14. fix for `` that causes hang. Example: + cat << _EOF > huh + #!/bin/sh + echo "[$@]" + echo "I am running" + echo "I am running ($$)" >> huh.out + _EOF + cat << _EOF > huh.tcsh + #!/bin/tcsh -f + + ./huh \ + `#comment blah blah blah` \ + parameter a \ + `#comment blah blah blah` \ + parameter b \ + `#comment blah blah blah` \ + parameter c + echo ok + _EOF + 13. remove AsciiOnly fix now that the real issue has been fixed (Roman Kollar) + 12. define utmp file for aix (Laurence Darby) + 11. fix if history in loops + 10. make ls-F print to stderr and set the exit code + 9. make rmstar interruptible on linux + 8. Get rid of pret_t and make the printf functions return the number of + characters printed as the system ones do. + 7. Parse a FreeBSD compat $LSCOLORS. What to do when both LSCOLORS and + LS_COLORS are set. I am not documenting this until we decide. 6. V6.18.01 - 20120214 5. fix interruptible wait again 4. ignore bogus compiler overflow message Modified: stable/10/contrib/tcsh/Imakefile ============================================================================== --- stable/10/contrib/tcsh/Imakefile Sat Apr 15 11:13:11 2017 (r316957) +++ stable/10/contrib/tcsh/Imakefile Sat Apr 15 11:16:11 2017 (r316958) @@ -1,5 +1,5 @@ XCOMM -XCOMM $tcsh: Imakefile,v 1.87 2010/01/28 19:01:05 christos Exp $ +XCOMM $tcsh: Imakefile,v 1.88 2014/07/07 20:34:58 christos Exp $ XCOMM XCOMM Imakefile for tcsh 6.12 XCOMM Marc Horowitz, MIT SIPB @@ -526,8 +526,8 @@ MISCF = Makefile.std Fixes MAKEDIFFS MAK WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \ - snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.in \ - Makefile.win32 + snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.ac \ + Makefile.win32 aclocal.m4 CONFSRCS=config/[a-z]* Modified: stable/10/contrib/tcsh/Makefile.in ============================================================================== --- stable/10/contrib/tcsh/Makefile.in Sat Apr 15 11:13:11 2017 (r316957) +++ stable/10/contrib/tcsh/Makefile.in Sat Apr 15 11:16:11 2017 (r316958) @@ -1,4 +1,4 @@ -# $tcsh: Makefile.in,v 3.49 2011/02/05 17:35:31 christos Exp $ +# $tcsh: Makefile.in,v 3.59 2015/08/24 20:09:04 kim Exp $ # Makefile.in 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile @@ -315,8 +315,8 @@ CPP = @CPP@ # on the suns does not know how to make dynamically linked binaries. # This is set by autoconf. CC = @CC@ -#CC= gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Werror -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wcast-qual -Wreturn-type -Wswitch -Wshadow -Wwrite-strings -Wextra -# -ansi -pedantic +#CC= gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Werror -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wcast-qual -Wreturn-type -Wswitch -Wshadow -Wwrite-strings -Wextra -Wcast-qual -Wwrite-strings -Wold-style-definition -Wuninitialized -Wpointer-sign +# -Wconversion -Wformat=2 -ansi -pedantic #CC= gcc -Wall -pipe -B/bin/ # Generate code for Intel 486 (linux) #CC= gcc -m486 -pipe -Wall @@ -377,14 +377,14 @@ ASSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \ sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h \ tw.color.c -PSSRCS= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \ +PSSRCS= sh.decls.h glob.c glob.h dotlock.c dotlock.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \ vms.termcap.c SHSRCS= ${ASSRCS} ${PSSRCS} SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \ sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \ sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \ sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \ - sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} \ + sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} dotlock.${SUF} \ mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF} TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \ @@ -411,12 +411,12 @@ AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThin WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.in configure config.h.in \ - tests/testsuite.at + host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + tests/testsuite.at aclocal.m4 TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \ tests/expr.at tests/lexical.at tests/mb-eucjp.at \ - tests/mb-utf8.at tests/noexec.at tests/syntax.at tests/subst.at \ - tests/variables.at tests/sh.dol.at + tests/mb-utf8.at tests/noexec.at tests/parenthesis.at tests/syntax.at \ + tests/subst.at tests/variables.at tests/sh.dol.at VHSRCS=${PVSRCS} ${AVSRCS} @@ -533,11 +533,11 @@ tc.const.h: tc.const.c sh.char.h config. ${CPP} $(CPPFLAGS) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\ $(srcdir)/tc.const.c | \ sed -n -e 's/^\(Char STR[a-zA-Z0-9_]*\) *\[ *\].*/extern \1[];/p' | \ - sort >> $@.tmp + LC_COLLATE=C sort >> $@.tmp @echo '#endif /* _h_tc_const */' >> $@.tmp @if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi -$(srcdir)/tests/package.m4: $(srcdir)/configure.in +$(srcdir)/tests/package.m4: $(srcdir)/configure.ac { \ echo '# Signature of the current package.'; \ echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ @@ -594,12 +594,12 @@ vgrind: @vgrind -t -x -h Index index >/crp/bill/csh/index.t install-strip: install + -strip ${DESTBIN}/tcsh$(EXEEXT) install: tcsh$(EXEEXT) install.catalogs install.man -mkdir -p ${DESTBIN} -mv -f ${DESTBIN}/tcsh$(EXEEXT) ${DESTBIN}/tcsh.old cp tcsh$(EXEEXT) ${DESTBIN}/tcsh$(EXEEXT) - -strip ${DESTBIN}/tcsh$(EXEEXT) chmod 755 ${DESTBIN}/tcsh$(EXEEXT) install.catalogs: @@ -623,25 +623,6 @@ install.man: tcsh.man # nroff -man tcsh.man | compress > ${DESTMAN}/tcsh.${MANSECT}.Z # chmod 444 ${DESTMAN}/tcsh.${MANSECT}.Z -install.cygwin: install - -gzip ${DESTMAN}/tcsh.${MANSECT} - -mkdir -p ${DESTDIR}${prefix}/share/doc/tcsh - cp ${srcdir}/FAQ ${srcdir}/Fixes ${DESTDIR}${prefix}/share/doc/tcsh - cp ${srcdir}/NewThings ${srcdir}/README ${DESTDIR}${prefix}/share/doc/tcsh - cp ${srcdir}/WishList ${srcdir}/Y2K ${DESTDIR}${prefix}/share/doc/tcsh - perl ${srcdir}/tcsh.man2html ${srcdir}/tcsh.man - cp -rp tcsh.html ${DESTDIR}${prefix}/share/doc/tcsh - -mkdir -p ${DESTDIR}/etc/defaults/etc/profile.d - -mkdir -p ${DESTDIR}/etc/profile.d - -mkdir -p ${DESTDIR}/etc/postinstall - -mkdir -p ${DESTDIR}/etc/preremove - cp -p ${srcdir}/cygwin/csh.cshrc ${DESTDIR}/etc/defaults/etc - cp -p ${srcdir}/cygwin/csh.login ${DESTDIR}/etc/defaults/etc - cp -p ${srcdir}/cygwin/bindkey.tcsh ${DESTDIR}/etc/defaults/etc/profile.d - cp -p ${srcdir}/complete.tcsh ${DESTDIR}/etc/defaults/etc/profile.d - cp -p ${srcdir}/cygwin/postinstall.sh ${DESTDIR}/etc/postinstall/tcsh.sh - cp -p ${srcdir}/cygwin/preremove.sh ${DESTDIR}/etc/preremove/tcsh.sh - clean: clean.catalogs ${RM} -f a.out strings x.c xs.c tcsh$(EXEEXT) tcsh.a _MAKE_LOG gethost ${RM} -f *.${SUF} *.i *.s @@ -748,11 +729,11 @@ ftp: tcsh-${VERSION}.tar.Z tcsh.tahoe-${ autoconfigure: $(srcdir)/configure $(srcdir)/config.h.in -$(srcdir)/configure: $(srcdir)/configure.in +$(srcdir)/configure: $(srcdir)/configure.ac cd $(srcdir) && autoconf $(srcdir)/config.h.in: $(srcdir)/stamp-h.in -$(srcdir)/stamp-h.in: $(srcdir)/configure.in +$(srcdir)/stamp-h.in: $(srcdir)/configure.ac cd $(srcdir) && autoheader @echo timestamp > $(srcdir)/stamp-h.in @@ -787,6 +768,9 @@ ${TWOBJS} ${TWINC}: ${TWH} # glob.h glob.${SUF} sh.glob.${SUF}: glob.h +# dotlock.h +dotlock.${SUF}: dotlock.h + # ed.defns.h EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF} ${EDOBJS} ${EDDINC}: ed.defns.h Modified: stable/10/contrib/tcsh/Makefile.std ============================================================================== --- stable/10/contrib/tcsh/Makefile.std Sat Apr 15 11:13:11 2017 (r316957) +++ stable/10/contrib/tcsh/Makefile.std Sat Apr 15 11:16:11 2017 (r316958) @@ -1,4 +1,4 @@ -# $tcsh: Makefile.std,v 1.97 2006/03/02 18:46:44 christos Exp $ +# $tcsh: Makefile.std,v 1.100 2015/08/24 20:09:04 kim Exp $ # Makefile.std 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile @@ -287,14 +287,14 @@ ASSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \ sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \ sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h -PSSRCS= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \ +PSSRCS= sh.decls.h glob.c glob.h dotlock.c dotlock.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \ vms.termcap.c SHSRCS= ${ASSRCS} ${PSSRCS} SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \ sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \ sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \ sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \ - sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} \ + sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} dotlock.${SUF} \ mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF} TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \ @@ -321,7 +321,8 @@ AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThin WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.in configure config.h.in + host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} @@ -424,7 +425,7 @@ tc.const.h: tc.const.c sh.char.h config. ${CPP} $(INCLUDES) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\ $(srcdir)/tc.const.c | grep 'Char STR' | \ sed -e 's/Char \([a-zA-Z0-9_]*\) *\[ *\].*/extern Char \1[];/' | \ - sort >> $@ + LC_COLLATE=C sort >> $@ @echo '#endif /* _h_tc_const */' >> $@ csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF} @@ -584,11 +585,11 @@ ftp: tcsh-${VERSION}.tar.Z tcsh.tahoe-${ autoconfigure: $(srcdir)/configure $(srcdir)/config.h.in -$(srcdir)/configure: $(srcdir)/configure.in +$(srcdir)/configure: $(srcdir)/configure.ac cd $(srcdir) && autoconf $(srcdir)/config.h.in: $(srcdir)/stamp-h.in -$(srcdir)/stamp-h.in: $(srcdir)/configure.in +$(srcdir)/stamp-h.in: $(srcdir)/configure.ac cd $(srcdir) && autoheader @echo timestamp > $(srcdir)/stamp-h.in @@ -620,6 +621,9 @@ ${TWOBJS} ${TWINC}: ${TWH} # glob.h glob.${SUF} sh.glob.${SUF}: glob.h +# dotlock.h +dotlock.${SUF}: dotlock.h + # ed.defns.h EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF} ${EDOBJS} ${EDDINC}: ed.defns.h Modified: stable/10/contrib/tcsh/Makefile.vms ============================================================================== --- stable/10/contrib/tcsh/Makefile.vms Sat Apr 15 11:13:11 2017 (r316957) +++ stable/10/contrib/tcsh/Makefile.vms Sat Apr 15 11:16:11 2017 (r316958) @@ -1,4 +1,4 @@ -# $tcsh: Makefile.vms,v 1.39 2006/03/02 18:46:44 christos Exp $ +# $tcsh: Makefile.vms,v 1.40 2014/07/07 20:34:58 christos Exp $ # Makefile.vms 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile @@ -299,7 +299,7 @@ AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThin WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.in + host.defs gethost.c tcsh.man2html configure.ac aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} Modified: stable/10/contrib/tcsh/README ============================================================================== --- stable/10/contrib/tcsh/README Sat Apr 15 11:13:11 2017 (r316957) +++ stable/10/contrib/tcsh/README Sat Apr 15 11:16:11 2017 (r316958) @@ -1,4 +1,4 @@ -This is tcsh version 6.18.01. Tcsh is a version of the Berkeley +This is tcsh version 6.20.00. Tcsh is a version of the Berkeley C-Shell, with the addition of: a command line editor, command and file name completion, listing, etc. and a bunch of small additions to the shell itself. Modified: stable/10/contrib/tcsh/complete.tcsh ============================================================================== --- stable/10/contrib/tcsh/complete.tcsh Sat Apr 15 11:13:11 2017 (r316957) +++ stable/10/contrib/tcsh/complete.tcsh Sat Apr 15 11:16:11 2017 (r316958) @@ -1,5 +1,5 @@ # -# $tcsh: complete.tcsh,v 1.52 2010/05/07 17:54:13 christos Exp $ +# $tcsh: complete.tcsh,v 1.56 2015/07/03 16:52:47 christos Exp $ # example file using the new completion code # # Debian GNU/Linux @@ -20,1209 +20,1262 @@ # Cleanup by Martin A. Godisch . onintr - -if (! $?prompt) goto end +if ( ! $?prompt ) goto end -if ($?tcsh) then - if ($tcsh != 1) then - set rev=$tcsh:r - set rel=$rev:e - set pat=$tcsh:e - set rev=$rev:r +if ( $?tcsh ) then + if ( $tcsh != 1 ) then + set rev=$tcsh:r:r + set rel=$tcsh:r:e + if ( $rev > 6 || ( $rev > 5 && $rel > 1 ) ) then + set _has_complete=1 endif - if ($rev > 5 && $rel > 1) then - set _complete=1 - endif - unset rev rel pat + endif + unset rev rel endif -if ($?_complete) then - set noglob - if ( ! $?hosts ) set hosts - foreach f ("$HOME/.hosts" /usr/local/etc/csh.hosts "$HOME/.rhosts" /etc/hosts.equiv) - if ( -r "$f" ) then - set hosts = ($hosts `grep -v "+" "$f" | grep -E -v "^#" | tr -s " " " " | cut -f 1`) - endif - end - if ( -r "$HOME/.netrc" ) then - set f=`awk '/machine/ { print $2 }' < "$HOME/.netrc"` >& /dev/null - set hosts=($hosts $f) - endif - if ( -r "$HOME/.ssh/known_hosts" ) then - set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ ` >& /dev/null - set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ | sed -e 's/,/ /g'` >& /dev/null - set hosts=($hosts $f) - endif - unset f - if ( ! $?hosts ) then - set hosts=(hyperion.ee.cornell.edu phaeton.ee.cornell.edu \ - guillemin.ee.cornell.edu vangogh.cs.berkeley.edu \ - ftp.uu.net prep.ai.mit.edu export.lcs.mit.edu \ - labrea.stanford.edu sumex-aim.stanford.edu \ - tut.cis.ohio-state.edu) - endif +if ( ! $?_has_complete ) goto end - complete ywho n/*/\$hosts/ # argument from list in $hosts - complete rsh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ - complete ssh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ - complete xrsh p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ - complete rlogin p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ - complete telnet p/1/\$hosts/ p/2/x:''/ n/*/n/ - - complete cd p/1/d/ # Directories only - complete chdir p/1/d/ - complete pushd p/1/d/ - complete popd p/1/d/ - complete pu p/1/d/ - complete po p/1/d/ - complete complete p/1/X/ # Completions only - complete uncomplete n/*/X/ - complete exec p/1/c/ # Commands only - complete trace p/1/c/ - complete strace p/1/c/ - complete which n/*/c/ - complete where n/*/c/ - complete skill p/1/c/ - complete dde p/1/c/ - complete adb c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/ - complete sdb p/1/c/ - complete dbx c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/ - complete xdb p/1/c/ - complete gdb n/-d/d/ n/*/c/ - complete ups p/1/c/ - complete set 'c/*=/f/' 'p/1/s/=' 'n/=/f/' - complete unset n/*/s/ - complete alias p/1/a/ # only aliases are valid - complete unalias n/*/a/ - complete xdvi n/*/f:*.dvi/ # Only files that match *.dvi - complete dvips n/*/f:*.dvi/ - if ($?traditional_complete) then - complete tex n/*/f:*.tex/ # Only files that match *.tex - else - complete tex n/*/f:*.{tex,texi}/ # Files that match *.tex and *.texi - endif - complete latex n/*/f:*.{tex,ltx}/ - complete su c/--/"(login fast preserve-environment command shell \ - help version)"/ c/-/"(f l m p c s -)"/ \ - n/{-c,--command}/c/ \ - n@{-s,--shell}@'`cat /etc/shells`'@ n/*/u/ - complete cc c/-[IL]/d/ \ - c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \ - c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/ - complete acc c/-[IL]/d/ \ - c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \ - c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/ - complete gcc c/-[IL]/d/ \ - c/-f/"(caller-saves cse-follow-jumps delayed-branch \ - elide-constructors expensive-optimizations \ - float-store force-addr force-mem inline \ - inline-functions keep-inline-functions \ - memoize-lookups no-default-inline \ - no-defer-pop no-function-cse omit-frame-pointer \ - rerun-cse-after-loop schedule-insns \ - schedule-insns2 strength-reduce \ - thread-jumps unroll-all-loops \ - unroll-loops syntax-only all-virtual \ - cond-mismatch dollars-in-identifiers \ - enum-int-equiv no-asm no-builtin \ - no-strict-prototype signed-bitfields \ - signed-char this-is-variable unsigned-bitfields \ - unsigned-char writable-strings call-saved-reg \ - call-used-reg fixed-reg no-common \ - no-gnu-binutils nonnull-objects \ - pcc-struct-return pic PIC shared-data \ - short-enums short-double volatile)"/ \ - c/-W/"(all aggregate-return cast-align cast-qual \ - comment conversion enum-clash error format \ - id-clash-len implicit missing-prototypes \ - no-parentheses pointer-arith return-type shadow \ - strict-prototypes switch uninitialized unused \ - write-strings)"/ \ - c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd \ - short c68000 c68020 soft-float g gnu unix fpu \ - no-epilogue)"/ \ - c/-d/"(D M N)"/ \ - c/-/"(f W vspec v vpath ansi traditional \ - traditional-cpp trigraphs pedantic x o l c g L \ - I D U O O2 C E H B b V M MD MM i dynamic \ - nodtdlib static nostdinc undef)"/ \ - c/-l/f:*.a/ \ - n/*/f:*.{c,C,cc,o,a,s,i}/ - complete g++ n/*/f:*.{C,cc,o,s,i}/ - complete CC n/*/f:*.{C,cc,cpp,o,s,i}/ - complete rm c/--/"(directory force interactive verbose \ - recursive help version)"/ c/-/"(d f i v r R -)"/ \ - n/*/f:^*.{c,cc,C,h,in}/ # Protect precious files - complete vi n/*/f:^*.[oa]/ - complete bindkey N/-a/b/ N/-c/c/ n/-[ascr]/'x:'/ \ - n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/\ - n/-k/"(left right up down)"/ p/2-/b/ \ - p/1/'x:'/ - - complete find n/-fstype/"(nfs 4.2)"/ n/-name/f/ \ - n/-type/"(c b d f p l s)"/ n/-user/u/ n/-group/g/ \ - n/-exec/c/ n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \ - c/-/"(fstype name perm prune type user nouser \ - group nogroup size inum atime mtime ctime exec \ - ok print ls cpio ncpio newer xdev depth \ - daystart follow maxdepth mindepth noleaf version \ - anewer cnewer amin cmin mmin true false uid gid \ - ilname iname ipath iregex links lname empty path \ - regex used xtype fprint fprint0 fprintf \ - print0 printf not a and o or)"/ \ - n/*/d/ - - complete -%* c/%/j/ # fill in the jobs builtin - complete {fg,bg,stop} c/%/j/ p/1/"(%)"// - - complete limit c/-/"(h)"/ n/*/l/ - complete unlimit c/-/"(h)"/ n/*/l/ - - complete -co* p/0/"(compress)"/ # make compress completion - # not ambiguous - if ($?traditional_complete) then - complete zcat n/*/f:*.Z/ - else - # "zcat" may be linked to "compress" or "gzip" - if (-X zcat) then - zcat --version >& /dev/null - if ($status != 0) then - complete zcat n/*/f:*.Z/ - else - complete zcat c/--/"(force help license quiet version)"/ \ - c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/ - endif - endif - endif +if ( ! $?noglob ) set noglob _unset_noglob - complete finger c/*@/\$hosts/ n/*/u/@ - complete ping p/1/\$hosts/ - complete traceroute p/1/\$hosts/ - - complete {talk,ntalk,phone} p/1/'`users | tr " " "\012" | uniq`'/ \ - n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/ - - complete ftp c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/ - - # this one is simple... - #complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/: - # From Michael Schroeder - # This one will rsh to the file to fetch the list of files! - complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@' 'n/*/$hosts/:' - - complete dd c/--/"(help version)"/ c/[io]f=/f/ \ - c/conv=*,/"(ascii ebcdic ibm block unblock \ - lcase notrunc ucase swab noerror sync)"/,\ - c/conv=/"(ascii ebcdic ibm block unblock \ - lcase notrunc ucase swab noerror sync)"/,\ - c/*=/x:''/ \ - n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/= - - complete nslookup p/1/x:''/ p/2/\$hosts/ - - complete ar c/[dmpqrtx]/"(c l o u v a b i)"/ p/1/"(d m p q r t x)"// \ - p/2/f:*.a/ p/*/f:*.o/ - - # these should be merged with the MH completion hacks below - jgotts - complete {refile,sprev,snext,scan,pick,rmm,inc,folder,show} \ - "c@+@F:$HOME/Mail/@" - - # these and interrupt handling from Jaap Vermeulen - complete {rexec,rxexec,rxterm,rmterm} \ - 'p/1/$hosts/' 'c/-/(l L E)/' 'n/-l/u/' 'n/-L/f/' \ - 'n/-E/e/' 'n/*/c/' - complete kill 'c/-/S/' 'c/%/j/' \ - 'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/' - - # these from Marc Horowitz - complete attach 'n/-mountpoint/d/' 'n/-m/d/' 'n/-type/(afs nfs rvd ufs)/' \ - 'n/-t/(afs nfs rvd ufs)/' 'n/-user/u/' 'n/-U/u/' \ - 'c/-/(verbose quiet force printpath lookup debug map \ - nomap remap zephyr nozephyr readonly write \ - mountpoint noexplicit explicit type mountoptions \ - nosetuid setuid override skipfsck lock user host)/' \ - 'n/-e/f/' 'n/*/()/' - complete hesinfo 'p/1/u/' \ - 'p/2/(passwd group uid grplist pcap pobox cluster \ - filsys sloc service)/' - - # these from E. Jay Berkenbilt - # = isn't always followed by a filename or a path anymore - jgotts - if ($?traditional_complete) then - complete ./configure \ - 'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\ - bindir,sbindir,libexecdir,datadir,\ - sysconfdir,sharedstatedir,localstatedir,\ - libdir,includedir,oldincludedir,infodir,\ - mandir,srcdir}/(=)//' \ - 'c/--/(cache-file verbose prefix exec-prefix bindir \ - sbindir libexecdir datadir sysconfdir \ - sharedstatedir localstatedir libdir \ - includedir oldincludedir infodir mandir \ - srcdir)//' - else - complete ./configure \ - 'c@--{prefix,exec-prefix,bindir,sbindir,libexecdir,datadir,sysconfdir,sharedstatedir,localstatedir,infodir,mandir,srcdir,x-includes,x-libraries}=*@x:'@ \ - 'c/--cachefile=*/x:/' \ - 'c/--{enable,disable,with}-*/x://' \ - 'c/--*=/x://' \ - 'c/--/(prefix= exec-prefix= bindir= \ - sbindir= libexecdir= datadir= sysconfdir= \ - sharedstatedir= localstatedir= infodir= \ - mandir= srcdir= x-includes= x-libraries= cachefile= \ - enable- disable- with- \ - help no-create quiet silent version verbose )//' - endif - complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \ - dfaxhigh dfaxlow laserjet ljet4 sparc pbm \ - pbmraw pgm pgmraw ppm ppmraw bit)/' \ - 'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \ - 'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/' - complete perl 'n/-S/c/' - complete printenv 'n/*/e/' - complete sccs p/1/"(admin cdc check clean comb deledit delget \ - delta diffs edit enter fix get help info \ - print prs prt rmdel sccsdiff tell unedit \ - unget val what)"/ - complete setenv 'p/1/e/' 'c/*:/f/' - - # these and method of setting hosts from Kimmo Suominen - if ( -f "$HOME/.mh_profile" && -x "`which folders`" ) then - - if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`" - if ( ! $?MHA ) setenv MHA "`ali | sed -e '/^ /d' -e 's/:.*//'`" - - set folders = ( $FOLDERS ) - set mha = ( $MHA ) - - complete ali \ - 'c/-/(alias nolist list nonormalize normalize nouser user help)/' \ - 'n,-alias,f,' - - complete anno \ - 'c/-/(component noinplace inplace nodate date text help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete burst \ - 'c/-/(noinplace inplace noquiet quiet noverbose verbose help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete comp \ - 'c/-/(draftfolder draftmessage nodraftfolder editor noedit file form nouse use whatnowproc nowhatnowproc help)/' \ - 'c,+,$folders,' \ - 'n,-whatnowproc,c,' \ - 'n,-file,f,'\ - 'n,-form,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete dist \ - 'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit form noinplace inplace whatnowproc nowhatnowproc help)/' \ - 'c,+,$folders,' \ - 'n,-whatnowproc,c,' \ - 'n,-form,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete folder \ - 'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete folders \ - 'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete forw \ - 'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit filter form noformat format noinplace inplace digest issue volume whatnowproc nowhatnowproc help)/' \ - 'c,+,$folders,' \ - 'n,-whatnowproc,c,' \ - 'n,-filter,f,'\ - 'n,-form,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete inc \ - 'c/-/(audit file noaudit nochangecur changecur file form format nosilent silent notruncate truncate width help)/' \ - 'c,+,$folders,' \ - 'n,-audit,f,'\ - 'n,-form,f,' - - complete mark \ - 'c/-/(add delete list sequence nopublic public nozero zero help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete mhmail \ - 'c/-/(body cc from subject help)/' \ - 'n,-cc,$mha,' \ - 'n,-from,$mha,' \ - 'n/*/$mha/' - - complete mhpath \ - 'c/-/(help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete msgchk \ - 'c/-/(nodate date nonotify notify help)/' - - complete msh \ - 'c/-/(prompt noscan scan notopcur topcur help)/' - - complete next \ - 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \ - 'c,+,$folders,' \ - 'n,-moreproc,c,' \ - 'n,-showproc,c,' \ - 'n,-form,f,' - - complete packf \ - 'c/-/(file help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete pick \ - 'c/-/(and or not lbrace rbrace cc date from search subject to othercomponent after before datefield sequence nopublic public nozero zero nolist list help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete prev \ - 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \ - 'c,+,$folders,' \ - 'n,-moreproc,c,' \ - 'n,-showproc,c,' \ - 'n,-form,f,' - - complete prompter \ - 'c/-/(erase kill noprepend prepend norapid rapid nodoteof doteof help)/' - - complete refile \ - 'c/-/(draft nolink link nopreserve preserve src file help)/' \ - 'c,+,$folders,' \ - 'n,-file,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete rmf \ - 'c/-/(nointeractive interactive help)/' \ - 'c,+,$folders,' - - complete rmm \ - 'c/-/(help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete scan \ - 'c/-/(noclear clear form format noheader header width noreverse reverse file help)/' \ - 'c,+,$folders,' \ - 'n,-form,f,'\ - 'n,-file,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete send \ - 'c/-/(alias draft draftfolder draftmessage nodraftfolder filter nofilter noformat format noforward forward nomsgid msgid nopush push noverbose verbose nowatch watch width help)/' \ - 'n,-alias,f,'\ - 'n,-filter,f,' - - complete show \ - 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \ - 'c,+,$folders,' \ - 'n,-moreproc,c,' \ - 'n,-showproc,c,' \ - 'n,-form,f,'\ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete sortm \ - 'c/-/(datefield textfield notextfield limit nolimit noverbose verbose help)/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete vmh \ - 'c/-/(prompt vmhproc novmhproc help)/' \ - 'n,-vmhproc,c,' - - complete whatnow \ - 'c/-/(draftfolder draftmessage nodraftfolder editor noedit prompt help)/' - - complete whom \ - 'c/-/(alias nocheck check draft draftfolder draftmessage nodraftfolder help)/' \ - 'n,-alias,f,' - - complete plum \ - 'c/-/()/' \ - 'c,+,$folders,' \ - 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,' - - complete mail \ - 'c/-/()/' \ - 'n/*/$mha/' +# Old TCSH versions don't define OSTYPE. +# Use a close approximation instead. - endif +if ( ! $?OSTYPE ) then + setenv OSTYPE `echo "$HOSTTYPE" | sed -e 's/^(i[3456]86|(amd|x86_)64)-//'` +endif - #from Dan Nicolaescu - if ( $?MODULESHOME ) then - alias Compl_module 'find ${MODULEPATH:as/:/ /} -name .version -o -name .modulea\* -prune -o -print | sed `echo "-e s@${MODULEPATH:as%:%/\*@@g -e s@%}/\*@@g"`' - complete module 'p%1%(add load unload switch display avail use unuse update purge list clear help initadd initrm initswitch initlist initclear)%' \ - 'n%{unl*,sw*,inits*}%`echo "$LOADEDMODULES:as/:/ /"`%' \ - 'n%{lo*,di*,he*,inita*,initr*}%`eval Compl_module`%' \ - 'N%{sw*,initsw*}%`eval Compl_module`%' 'C%-%(-append)%' 'n%{use,unu*,av*}%d%' 'n%-append%d%' \ - 'C%[^-]*%`eval Compl_module`%' - endif +if ( ! $?hosts ) set hosts + +foreach f ( "$HOME/."{,r,ssh/known_}hosts* \ + /usr/local/etc/csh.hosts /etc/hosts.equiv ) + if ( -r "$f" ) then + set hosts=($hosts `sed \ + -e 's/#.*//' \ + -e '/^[+-]@/d' \ + -e 's/^[-+]//' \ + -e 's/[[:space:]].*//' \ + -e 's/,/\n/g' "$f" \ + | sed -e '/^[.:[:xdigit:][:space:]]*$/d'`) + endif +end +unset f + +if ( -r "$HOME/.netrc" ) then + set hosts=($hosts `awk '$1 == "machine" { print $2 }' "$HOME/.netrc"`) +endif + +set hosts=(`echo $hosts | tr ' ' '\012' | sort -u`) + +if ( ! $#hosts ) then + # This is just a hint for the user. + set hosts=(ftp.funet.fi ftp.gnu.org ftp.uu.net) +endif + +complete ywho n/*/\$hosts/ # argument from list in $hosts +complete rsh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ +complete ssh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ +complete xrsh p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/ +complete rlogin p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ +complete telnet p/1/\$hosts/ p/2/x:''/ n/*/n/ + +complete cd p/1/d/ # Directories only +complete chdir p/1/d/ +complete pushd p/1/d/ +complete popd p/1/d/ +complete pu p/1/d/ +complete po p/1/d/ +complete complete p/1/X/ # Completions only +complete uncomplete n/*/X/ +complete exec p/1/c/ # Commands only +complete trace p/1/c/ +complete strace p/1/c/ +complete which n/*/c/ +complete where n/*/c/ +complete skill p/1/c/ +complete dde p/1/c/ +complete adb c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/ +complete sdb p/1/c/ +complete dbx c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/ +complete xdb p/1/c/ +complete gdb n/-d/d/ n/*/c/ +complete ups p/1/c/ +complete set 'c/*=/f/' 'p/1/s/=' 'n/=/f/' +complete unset n/*/s/ +complete alias p/1/a/ # only aliases are valid +complete unalias n/*/a/ +complete xdvi n/*/f:*.dvi/ +complete dvips n/*/f:*.dvi/ +complete tex n/*/f:*.{tex,texi}/ +complete latex n/*/f:*.{tex,ltx}/ + +complete su \ + c/--/"(login fast preserve-environment command shell help version)"/ \ + c/-/"(f l m p c s -)"/ \ + n/{-c,--command}/c/ \ + n@{-s,--shell}@'`cat /etc/shells`'@ \ + n/*/u/ +complete cc \ + c/-[IL]/d/ \ + c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \ + c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/ +complete acc \ + c/-[IL]/d/ \ + c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \ + c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/ +complete gcc \ + c/-[IL]/d/ \ + c/-f/"(caller-saves cse-follow-jumps delayed-branch elide-constructors \ + expensive-optimizations float-store force-addr force-mem inline \ + inline-functions keep-inline-functions memoize-lookups \ + no-default-inline no-defer-pop no-function-cse omit-frame-pointer \ + rerun-cse-after-loop schedule-insns schedule-insns2 strength-reduce \ + thread-jumps unroll-all-loops unroll-loops syntax-only all-virtual \ + cond-mismatch dollars-in-identifiers enum-int-equiv no-asm no-builtin \ + no-strict-prototype signed-bitfields signed-char this-is-variable \ + unsigned-bitfields unsigned-char writable-strings call-saved-reg \ + call-used-reg fixed-reg no-common no-gnu-binutils nonnull-objects \ + pcc-struct-return pic PIC shared-data short-enums short-double \ + volatile)"/ \ + c/-W/"(all aggregate-return cast-align cast-qual comment conversion \ + enum-clash error format id-clash-len implicit missing-prototypes \ + no-parentheses pointer-arith return-type shadow strict-prototypes \ + switch uninitialized unused write-strings)"/ \ + c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd short c68000 c68020 \ + soft-float g gnu unix fpu no-epilogue)"/ \ + c/-d/"(D M N)"/ \ + c/-/"(f W vspec v vpath ansi traditional traditional-cpp trigraphs pedantic \ + x o l c g L I D U O O2 C E H B b V M MD MM i dynamic nodtdlib static \ + nostdinc undef)"/ \ + c/-l/f:*.a/ \ + n/*/f:*.{c,C,cc,o,a,s,i}/ +complete g++ n/*/f:*.{C,cc,o,s,i}/ +complete CC n/*/f:*.{C,cc,cpp,o,s,i}/ +complete rm \ + c/--/"(directory force interactive verbose recursive help version)"/ \ + c/-/"(d f i v r R -)"/ \ + n/*/f:^*.{c,cc,C,h,in}/ + # Protect precious files +complete vi n/*/f:^*.[oa]/ +complete bindkey \ + N/-a/b/ N/-c/c/ n/-[ascr]/'x:'/ \ + n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/ \ + n/-k/"(left right up down)"/ p/2-/b/ \ + p/1/'x:'/ + +complete find \ + n/-fstype/"(nfs 4.2)"/ \ + n/-name/f/ \ + n/-type/"(c b d f p l s)"/ \ + n/-user/u/ \ + n/-group/g/ \ + n/-exec/c/ \ + n/-ok/c/ \ + n/-cpio/f/ \ + n/-ncpio/f/ \ + n/-newer/f/ \ + c/-/"(fstype name perm prune type user nouser group nogroup size inum \ + atime mtime ctime exec ok print ls cpio ncpio newer xdev depth \ + daystart follow maxdepth mindepth noleaf version anewer cnewer \ + amin cmin mmin true false uid gid ilname iname ipath iregex links \ + lname empty path regex used xtype fprint fprint0 fprintf print0 \ + printf not a and o or)"/ \ + n/*/d/ + +complete -%* c/%/j/ # fill in the jobs builtin +complete {fg,bg,stop} c/%/j/ p/1/"(%)"// + +complete limit c/-/"(h)"/ n/*/l/ +complete unlimit c/-/"(h)"/ n/*/l/ + +#complete -co* p/0/"(compress)"/ # make compress completion +# # not ambiguous + +# "zcat" may be linked to "compress" or "gzip" +if (-X zcat) then + zcat --version >& /dev/null + if ($status != 0) then + complete zcat n/*/f:*.Z/ + else + complete zcat c/--/"(force help license quiet version)"/ \ + c/-/"(f h L q V -)"/ \ + n/*/f:*.{gz,Z,z,zip}/ + endif +endif + +complete finger c/*@/\$hosts/ n/*/u/@ +complete ping p/1/\$hosts/ +complete traceroute p/1/\$hosts/ + +complete {talk,ntalk,phone} \ + p/1/'`users | tr " " "\012" | uniq`'/ \ + n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/ + +complete ftp c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/ + +# this one is simple... +#complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/: +# From Michael Schroeder *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Apr 15 13:02:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE1D3D3E510; Sat, 15 Apr 2017 13:02:24 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A269EB59; Sat, 15 Apr 2017 13:02:24 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id D47D8393F; Sat, 15 Apr 2017 13:02:23 +0000 (UTC) Date: Sat, 15 Apr 2017 13:02:23 +0000 From: Alexey Dokuchaev To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316953 - head/sbin/savecore Message-ID: <20170415130223.GB97090@FreeBSD.org> References: <201704150653.v3F6r7hJ081000@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704150653.v3F6r7hJ081000@repo.freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 13:02:24 -0000 On Sat, Apr 15, 2017 at 06:53:07AM +0000, Ngie Cooper wrote: > New Revision: 316953 > URL: https://svnweb.freebsd.org/changeset/base/316953 > > Log: > Switch back to non-IEC units for 1024 bytes > > I was swayed a little too quickly when I saw the wiki page discussing > kB vs KiB. Switch back as none of the code in base openly uses > IEC units via humanize_number(3) (which was my next step), and there's > a large degree of dislike with IEC vs more SI-like units. > ... > @@ -322,7 +322,7 @@ check_space(const char *savedir, off_t d > if (available < needed) { > syslog(LOG_WARNING, > "no dump: not enough free space on device (need at least " > - "%jdKiB for dump; %jdKiB available; %jdKiB reserved)", > + "%jdkB for dump; %jdkB available; %jdkB reserved)", Thank you. For once, the sanity had won. ./danfe From owner-svn-src-all@freebsd.org Sat Apr 15 13:05:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44CDED3E5D4; Sat, 15 Apr 2017 13:05:26 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FAC0D01; Sat, 15 Apr 2017 13:05:26 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-transfer-encoding:Content-type:Mime-version:In-Reply-To: References:Message-ID:CC:To:From:Subject:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=B2dMYJKB7nMj+Rhw4omfBFG8Ncss7Y1GUoYV48kCRJc=; b=A5wx3+NWPqoCpScqNI1Auaip2d ZLLG61nAXg29aTpCnmzaUSYxbkDQKEpP5zDMGWBf8bg6QjgTmIRdKc2zNS4PudcPVmOY8a3ZVsH9F 8e1Ho+6FVZncgJHwnC/+LHAU3aEaSQn+glJxqlK8m5YGvOqrSuBg0rpwNNABJOs84hhI=; Received: from [47.220.164.50] (port=52564 helo=[192.168.200.198]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1czNOG-000NiA-PI; Sat, 15 Apr 2017 08:05:24 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Sat, 15 Apr 2017 08:05:23 -0500 Subject: Re: svn commit: r316874 - head/sys/kern From: Larry Rosenman To: Maxim Sobolev , Peter Wemm CC: src-committers , , Hiroki Sato , Hiren Panchasara , , "Ngie Cooper (yaneurabeya)" Message-ID: <5B7F917E-EA2A-4DB4-B032-48BBBEDD7556@lerctr.org> Thread-Topic: svn commit: r316874 - head/sys/kern References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <2109294.KVn8xeR1jZ@overcee.wemm.org> <11221477.gRA6BXfcIE@overcee.wemm.org> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 13:05:26 -0000 On 4/15/17, 6:00 AM, "Maxim Sobolev" wrote: Peter, Ngie, none of this stuff is really directly related to the shutdown(2) change, so I'll probably let Hiroki to clean it up. =20 -Max =20 I=E2=80=99ve backed off to my previous root. Is someone working on this? It=E2=80=99s= PAINFUL. From owner-svn-src-all@freebsd.org Sat Apr 15 13:33:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10E7CD3E16C; Sat, 15 Apr 2017 13:33:29 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E48B3D5D; Sat, 15 Apr 2017 13:33:28 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 15B7C3DFB; Sat, 15 Apr 2017 13:33:28 +0000 (UTC) Date: Sat, 15 Apr 2017 13:33:28 +0000 From: Alexey Dokuchaev To: rgrimes@freebsd.org Cc: Slawa Olhovchenkov , "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , "Ngie Cooper (yaneurabeya)" , Larry Rosenman , "svn-src-head@freebsd.org" , Ngie Cooper Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170415133328.GD97090@FreeBSD.org> References: <20170414204642.GC70430@zxy.spb.ru> <201704150141.v3F1fWn1009236@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704150141.v3F1fWn1009236@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 13:33:29 -0000 On Fri, Apr 14, 2017 at 06:41:32PM -0700, Rodney W. Grimes wrote: > On Apr 14, 2017, at 13:46, Slawa Olhovchenkov wrote: > > On Fri, Apr 14, 2017 at 01:45:22PM -0700, Ngie Cooper (yaneurabeya) wrote: > > > > On Apr 14, 2017, at 13:42, Slawa Olhovchenkov wrote: > > > > ... > > > > No, something like: > > > > % swapinfo > > > > Device 1K-blocks Used Avail Capacity > > > > /dev/ada0p2 33554432 0 33554432 0% > > > > /dev/ada1p2 33554432 0 33554432 0% > > > > Total 67108864 0 67108864 0% > > > > > > Striping dumps across multiple swap devices isn't supported. Sorry. It's kind of funny how many emails required to understand what people ask for while it seemed quite obvious up-front. :-) (This is one of the most desired feature for me as well). > > What about support in the future? > > Added to my project list at people.freebsd.org/~rgrimes. No promises, > but I'll look at it while I am doing the other work. Thanks Rod, appreciate and glad to hear this. ./danfe From owner-svn-src-all@freebsd.org Sat Apr 15 13:37:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CB8AD3E263; Sat, 15 Apr 2017 13:37:36 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FD4BF19; Sat, 15 Apr 2017 13:37:36 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 3A3053F55; Sat, 15 Apr 2017 13:37:35 +0000 (UTC) Date: Sat, 15 Apr 2017 13:37:35 +0000 From: Alexey Dokuchaev To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316854 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20170415133735.GE97090@FreeBSD.org> References: <201704141535.v3EFZ7BY096442@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704141535.v3EFZ7BY096442@repo.freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 13:37:36 -0000 On Fri, Apr 14, 2017 at 03:35:07PM +0000, Andriy Gapon wrote: > New Revision: 316854 > URL: https://svnweb.freebsd.org/changeset/base/316854 > > Log: > rename vfs.zfs.debug_flags to vfs.zfs.debugflags > > While the former name is easier to read, the "_flags" suffix has a > special meaning for loader(8) and, thus, it was impossible to set the > knob via loader.conf(5). Nice, it also makes it consistent with `kern.geom.debugflags'. ./danfe From owner-svn-src-all@freebsd.org Sat Apr 15 13:57:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2013FD3E7A8; Sat, 15 Apr 2017 13:57:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E470A1AB7; Sat, 15 Apr 2017 13:57:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FDvaeJ051104; Sat, 15 Apr 2017 13:57:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FDvZFW051101; Sat, 15 Apr 2017 13:57:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704151357.v3FDvZFW051101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 13:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316959 - head/usr.bin/diff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 13:57:37 -0000 Author: bapt Date: Sat Apr 15 13:57:35 2017 New Revision: 316959 URL: https://svnweb.freebsd.org/changeset/base/316959 Log: Clean up headers declaration Modified: head/usr.bin/diff/diff.c head/usr.bin/diff/diffdir.c head/usr.bin/diff/diffreg.c Modified: head/usr.bin/diff/diff.c ============================================================================== --- head/usr.bin/diff/diff.c Sat Apr 15 11:16:11 2017 (r316958) +++ head/usr.bin/diff/diff.c Sat Apr 15 13:57:35 2017 (r316959) @@ -27,11 +27,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include -#include #include #include #include Modified: head/usr.bin/diff/diffdir.c ============================================================================== --- head/usr.bin/diff/diffdir.c Sat Apr 15 11:16:11 2017 (r316958) +++ head/usr.bin/diff/diffdir.c Sat Apr 15 13:57:35 2017 (r316959) @@ -28,17 +28,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include -#include #include #include "diff.h" -#include "xmalloc.h" static int selectfile(const struct dirent *); static void diffit(struct dirent *, char *, size_t, char *, size_t, int); Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Sat Apr 15 11:16:11 2017 (r316958) +++ head/usr.bin/diff/diffreg.c Sat Apr 15 13:57:35 2017 (r316959) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Sat Apr 15 14:01:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38D76D3E92C; Sat, 15 Apr 2017 14:01:09 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F164C1E42; Sat, 15 Apr 2017 14:01:08 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3FE0vnT012251; Sat, 15 Apr 2017 07:00:57 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3FE0vXk012250; Sat, 15 Apr 2017 07:00:57 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704151400.v3FE0vXk012250@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <20170415083952.GA83631@zxy.spb.ru> To: Slawa Olhovchenkov Date: Sat, 15 Apr 2017 07:00:57 -0700 (PDT) CC: Mark Johnston , Xin LI , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 14:01:09 -0000 > On Fri, Apr 14, 2017 at 03:05:25PM -0700, Mark Johnston wrote: > > > > And with textdumps available, the benefit > > > of having compression is limited because we can request for minidump > > > or full dumps only when the textdumps are not good enough for > > > diagnosing the kernel bug. > > > > Sure, but in this case the compression may be vital. > > > > > > > > I don't think security (e.g. leaking information because of the use of > > > compression) is a very big concern in this context because in order > > > for the potential attacker to read the raw material needs a > > > compromised system (unlike an attack from the network, where someone > > > who controls the network would have access to the raw material); the > > > dump is usually quite large, and measuring downtime would be hard at > > > that scale. > > > > Ok. > > > > > > > > By the way (not meant to bikeshed) if I was to do this I'd prefer > > > using lz4 or something that compresses faster than zlib. > > > > I agree, but I think the existing lz4 implementation in the kernel is > > not so well suited to running after a panic. It seems fixable, but > > compression speed also isn't hugely important here IMO. > > On production system this is downtime. > For may case, dumped about 32GB (from 256GB RAM). This is take several > minutes. Can compression increase this to hour? On productions systems the compression layer of dump may very well be a win situation depending on choosen algorith (you want something fairly fast, but still effective). If your rate to compress bytes is close to the disk write bandwith you have an over all win caused by writting less to disk. Someone who enjoys math should write an equation for given compression bandwidth cb and given disk bandwidth db and compression ratio cr what do the curves look like? IIRC we measure cpu/memory bandwidth in the 10'sG bytes/sec range, compression should be some place under that, and our disk bandwidth even on SSD is in the 500MB range, even the fastest 15k rpm spinning rust is in the <200MB range, we should be able to compress at a higher rate than this. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 14:07:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 860D7D3EB48; Sat, 15 Apr 2017 14:07:43 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67948150; Sat, 15 Apr 2017 14:07:43 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 980C54770; Sat, 15 Apr 2017 14:07:42 +0000 (UTC) Date: Sat, 15 Apr 2017 14:07:42 +0000 From: Alexey Dokuchaev To: rgrimes@freebsd.org Cc: Mark Johnston , "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Ngie Cooper Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170415140742.GF97090@FreeBSD.org> References: <20170415053729.GA76139@raichu> <201704150642.v3F6g41p010449@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704150642.v3F6g41p010449@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 14:07:43 -0000 On Fri, Apr 14, 2017 at 11:42:04PM -0700, Rodney W. Grimes wrote: > On Fri, Apr 14, 2017 at 10:37:29PM -0700, Mark Johnston wrote: > > ... > > Does "lkm" mean "loadable kernel module"? If so, why? > > Yes, so you dont have to reboot to write and debug new versions, so > you can have a kernel without minidump if you want, and I am sure > there are others. More importantly, why not? Modules are good, > staticially linked rarely used code is bad. That sounds pretty awesome, keep it up! ./danfe ("modularize everything" proponent) From owner-svn-src-all@freebsd.org Sat Apr 15 14:28:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F3AAD3F0DD; Sat, 15 Apr 2017 14:28:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CDC17C; Sat, 15 Apr 2017 14:28:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id E267D10A7B9; Sat, 15 Apr 2017 10:28:30 -0400 (EDT) From: John Baldwin To: "Ngie Cooper (yaneurabeya)" , src-committers Cc: rgrimes@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316938 - head/sbin/savecore Date: Sat, 15 Apr 2017 07:26:41 -0700 Message-ID: <1774031.vuxxQt1GW8@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <4CBF25DF-F407-4F50-8724-B73F64734E19@gmail.com> References: <201704150149.v3F1nu0D009274@pdx.rh.CN85.dnsmgr.net> <4CBF25DF-F407-4F50-8724-B73F64734E19@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Sat, 15 Apr 2017 10:28:31 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 14:28:33 -0000 On Friday, April 14, 2017 07:40:57 PM Ngie Cooper wrote: > > > On Apr 14, 2017, at 18:49, Rodney W. Grimes wrote: > > Do we use KiB, MiB, GiB,... any place else in the system? I cant think of > > a place we do this, so please, lets not start doing this here? The du manpage does at least. > humanize_number(3) from libutil uses IEC units. Note that it is optional though. You can use flags to decide what you want and the default is to not use IEC. ls -h uses humanize_number but not with IEC units. In particular, there are flags to control the scaling and prefixes used: HN_DIVISOR_1000 and HN_IEC_PREFIXES. The default is to use power-of-2 scaling with non-IEC prefixes (so KB == 1024 by default). Currently nothing in base uses HN_IEC_PREFIXES. (I see you already reverted the printf, just wanted to point out that the humanize_number behavior is configurable.) -- John Baldwin From owner-svn-src-all@freebsd.org Sat Apr 15 14:43:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FF7ED3F8F6; Sat, 15 Apr 2017 14:43:17 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60A55F0D; Sat, 15 Apr 2017 14:43:17 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1czOuv-0001T5-I8; Sat, 15 Apr 2017 17:43:13 +0300 Date: Sat, 15 Apr 2017 17:43:13 +0300 From: Slawa Olhovchenkov To: rgrimes@freebsd.org Cc: Mark Johnston , Xin LI , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170415144313.GG70430@zxy.spb.ru> References: <20170415083952.GA83631@zxy.spb.ru> <201704151400.v3FE0vXk012250@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704151400.v3FE0vXk012250@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 14:43:17 -0000 On Sat, Apr 15, 2017 at 07:00:57AM -0700, Rodney W. Grimes wrote: > > On Fri, Apr 14, 2017 at 03:05:25PM -0700, Mark Johnston wrote: > > > > > > And with textdumps available, the benefit > > > > of having compression is limited because we can request for minidump > > > > or full dumps only when the textdumps are not good enough for > > > > diagnosing the kernel bug. > > > > > > Sure, but in this case the compression may be vital. > > > > > > > > > > > I don't think security (e.g. leaking information because of the use of > > > > compression) is a very big concern in this context because in order > > > > for the potential attacker to read the raw material needs a > > > > compromised system (unlike an attack from the network, where someone > > > > who controls the network would have access to the raw material); the > > > > dump is usually quite large, and measuring downtime would be hard at > > > > that scale. > > > > > > Ok. > > > > > > > > > > > By the way (not meant to bikeshed) if I was to do this I'd prefer > > > > using lz4 or something that compresses faster than zlib. > > > > > > I agree, but I think the existing lz4 implementation in the kernel is > > > not so well suited to running after a panic. It seems fixable, but > > > compression speed also isn't hugely important here IMO. > > > > On production system this is downtime. > > For may case, dumped about 32GB (from 256GB RAM). This is take several > > minutes. Can compression increase this to hour? > > On productions systems the compression layer of dump may very well > be a win situation depending on choosen algorith (you want something > fairly fast, but still effective). If your rate to compress bytes > is close to the disk write bandwith you have an over all win caused > by writting less to disk. > > Someone who enjoys math should write an equation for given > compression bandwidth cb and given disk bandwidth db and > compression ratio cr what do the curves look like? > > IIRC we measure cpu/memory bandwidth in the 10'sG bytes/sec wrong. single thread cpu/memory bandwidth very different on i7 and e5 cpu (e5 less, about 6 GB/s). > range, compression should be some place under that, and > our disk bandwidth even on SSD is in the 500MB range, > even the fastest 15k rpm spinning rust is in the <200MB > range, we should be able to compress at a higher rate than > this. yes. From owner-svn-src-all@freebsd.org Sat Apr 15 15:08:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 710CBD3E2F0; Sat, 15 Apr 2017 15:08:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4251DF64; Sat, 15 Apr 2017 15:08:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FF8NCL079690; Sat, 15 Apr 2017 15:08:23 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FF8NY0079689; Sat, 15 Apr 2017 15:08:23 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151508.v3FF8NY0079689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316960 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:08:24 -0000 Author: dchagin Date: Sat Apr 15 15:08:23 2017 New Revision: 316960 URL: https://svnweb.freebsd.org/changeset/base/316960 Log: MFC r314647: Remove attribute __packed from some IPC struct definition since Linuxulator is x86 only. The only notable differences in algnment for an LP64 64-bit system when compared to a 32-bit system is an eight or large byte types alignment. Modified: stable/11/sys/compat/linux/linux_ipc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 13:57:35 2017 (r316959) +++ stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:08:23 2017 (r316960) @@ -130,7 +130,6 @@ linux_to_bsd_ipc_perm(struct l_ipc_perm bpp->seq = lpp->seq; } - static void bsd_to_linux_ipc_perm(struct ipc_perm *bpp, struct l_ipc_perm *lpp) { @@ -158,11 +157,7 @@ struct l_msqid_ds { l_ushort msg_qbytes; /* max number of bytes on queue */ l_pid_t msg_lspid; /* pid of last msgsnd */ l_pid_t msg_lrpid; /* last receive pid */ -} -#if defined(__amd64__) && defined(COMPAT_LINUX32) -__packed -#endif -; +}; struct l_semid_ds { struct l_ipc_perm sem_perm; @@ -173,11 +168,7 @@ struct l_semid_ds { l_uintptr_t sem_pending_last; l_uintptr_t undo; l_ushort sem_nsems; -} -#if defined(__amd64__) && defined(COMPAT_LINUX32) -__packed -#endif -; +}; struct l_shmid_ds { struct l_ipc_perm shm_perm; From owner-svn-src-all@freebsd.org Sat Apr 15 15:09:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E727D3E381; Sat, 15 Apr 2017 15:09:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09E5DF4; Sat, 15 Apr 2017 15:09:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FF9Oas079780; Sat, 15 Apr 2017 15:09:24 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FF9OFA079779; Sat, 15 Apr 2017 15:09:24 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151509.v3FF9OFA079779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316961 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:09:25 -0000 Author: dchagin Date: Sat Apr 15 15:09:23 2017 New Revision: 316961 URL: https://svnweb.freebsd.org/changeset/base/316961 Log: MFC r314648: Style(9). Modified: stable/11/sys/compat/linux/linux_ipc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:08:23 2017 (r316960) +++ stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:09:23 2017 (r316961) @@ -531,7 +531,7 @@ linux_semctl(struct thread *td, struct l cmd = IPC_SET; error = linux_semid_pullup(args->cmd & LINUX_IPC_64, &linux_semid, PTRIN(args->arg.buf)); - if (error) + if (error != 0) return (error); linux_to_bsd_semid_ds(&linux_semid, &semid); semun.buf = &semid; @@ -546,7 +546,7 @@ linux_semctl(struct thread *td, struct l semun.buf = &semid; error = kern_semctl(td, args->semid, args->semnum, cmd, &semun, &rval); - if (error) + if (error != 0) return (error); bsd_to_linux_semid_ds(&semid, &linux_semid); error = linux_semid_pushdown(args->cmd & LINUX_IPC_64, @@ -573,7 +573,7 @@ linux_semctl(struct thread *td, struct l */ error = copyout(&linux_seminfo, PTRIN(args->arg.buf), sizeof(linux_seminfo)); - if (error) + if (error != 0) return (error); td->td_retval[0] = seminfo.semmni; return (0); /* No need for __semctl call */ @@ -690,7 +690,7 @@ linux_msgctl(struct thread *td, struct l case LINUX_IPC_SET: error = linux_msqid_pullup(args->cmd & LINUX_IPC_64, &linux_msqid, PTRIN(args->buf)); - if (error) + if (error != 0) return (error); linux_to_bsd_msqid_ds(&linux_msqid, &bsd_msqid); break; @@ -788,7 +788,7 @@ linux_shmctl(struct thread *td, struct l /* Perform shmctl wanting removed segments lookup */ error = kern_shmctl(td, args->shmid, IPC_INFO, (void *)&bsd_shminfo, NULL); - if (error) + if (error != 0) return (error); bsd_to_linux_shminfo(&bsd_shminfo, &linux_shminfo); @@ -803,7 +803,7 @@ linux_shmctl(struct thread *td, struct l /* Perform shmctl wanting removed segments lookup */ error = kern_shmctl(td, args->shmid, SHM_INFO, (void *)&bsd_shm_info, NULL); - if (error) + if (error != 0) return (error); bsd_to_linux_shm_info(&bsd_shm_info, &linux_shm_info); @@ -816,9 +816,9 @@ linux_shmctl(struct thread *td, struct l /* Perform shmctl wanting removed segments lookup */ error = kern_shmctl(td, args->shmid, IPC_STAT, (void *)&bsd_shmid, NULL); - if (error) + if (error != 0) return (error); - + bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid); return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64, @@ -828,9 +828,9 @@ linux_shmctl(struct thread *td, struct l /* Perform shmctl wanting removed segments lookup */ error = kern_shmctl(td, args->shmid, IPC_STAT, (void *)&bsd_shmid, NULL); - if (error) + if (error != 0) return (error); - + bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid); return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64, @@ -839,7 +839,7 @@ linux_shmctl(struct thread *td, struct l case LINUX_IPC_SET: error = linux_shmid_pullup(args->cmd & LINUX_IPC_64, &linux_shmid, PTRIN(args->buf)); - if (error) + if (error != 0) return (error); linux_to_bsd_shmid_ds(&linux_shmid, &bsd_shmid); @@ -856,7 +856,7 @@ linux_shmctl(struct thread *td, struct l else { error = linux_shmid_pullup(args->cmd & LINUX_IPC_64, &linux_shmid, PTRIN(args->buf)); - if (error) + if (error != 0) return (error); linux_to_bsd_shmid_ds(&linux_shmid, &bsd_shmid); buf = (void *)&bsd_shmid; From owner-svn-src-all@freebsd.org Sat Apr 15 15:11:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35988D3E455; Sat, 15 Apr 2017 15:11:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCC3E859; Sat, 15 Apr 2017 15:11:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FFBOpg083431; Sat, 15 Apr 2017 15:11:24 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FFBNKs083426; Sat, 15 Apr 2017 15:11:23 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151511.v3FFBNKs083426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316962 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:11:25 -0000 Author: dchagin Date: Sat Apr 15 15:11:23 2017 New Revision: 316962 URL: https://svnweb.freebsd.org/changeset/base/316962 Log: MFC r314866: Reduce code duplication between MD Linux code by moving SYSV IPC 64-bit related struct definitions out into the MI path. Invert the native ipc structs to the Linux ipc structs convesion logic. Since 64-bit variant of ipc structs has more precision convert native ipc structs to the 64-bit Linux ipc structs and then truncate 64-bit values into the non 64-bit if needed. Unlike Linux, return EOVERFLOW if the values do not fit. Fix SYSV IPC for 64-bit Linuxulator which never sets IPC_64 bit. Added: stable/11/sys/compat/linux/linux_ipc64.h - copied unchanged from r314866, head/sys/compat/linux/linux_ipc64.h Deleted: stable/11/sys/amd64/linux/linux_ipc64.h stable/11/sys/amd64/linux32/linux32_ipc64.h stable/11/sys/i386/linux/linux_ipc64.h Modified: stable/11/sys/amd64/linux/linux.h stable/11/sys/amd64/linux32/linux.h stable/11/sys/compat/linux/linux_ipc.c stable/11/sys/i386/linux/linux.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux.h ============================================================================== --- stable/11/sys/amd64/linux/linux.h Sat Apr 15 15:09:23 2017 (r316961) +++ stable/11/sys/amd64/linux/linux.h Sat Apr 15 15:11:23 2017 (r316962) @@ -69,7 +69,9 @@ typedef l_long l_clock_t; typedef l_int l_daddr_t; typedef l_ulong l_dev_t; typedef l_uint l_gid_t; +typedef l_ushort l_gid16_t; typedef l_uint l_uid_t; +typedef l_ushort l_uid16_t; typedef l_ulong l_ino_t; typedef l_int l_key_t; typedef l_long l_loff_t; @@ -381,16 +383,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_ipc_perm { - l_key_t key; - l_uid_t uid; - l_gid_t gid; - l_uid_t cuid; - l_gid_t cgid; - l_ushort mode; - l_ushort seq; -}; - /* * Socket defines */ Modified: stable/11/sys/amd64/linux32/linux.h ============================================================================== --- stable/11/sys/amd64/linux32/linux.h Sat Apr 15 15:09:23 2017 (r316961) +++ stable/11/sys/amd64/linux32/linux.h Sat Apr 15 15:11:23 2017 (r316962) @@ -474,16 +474,6 @@ union l_semun { l_uintptr_t __pad; } __packed; -struct l_ipc_perm { - l_key_t key; - l_uid16_t uid; - l_gid16_t gid; - l_uid16_t cuid; - l_gid16_t cgid; - l_ushort mode; - l_ushort seq; -}; - /* * Socket defines */ Modified: stable/11/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:09:23 2017 (r316961) +++ stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:11:23 2017 (r316962) @@ -44,15 +44,27 @@ __FBSDID("$FreeBSD$"); #ifdef COMPAT_LINUX32 #include #include -#include #else #include #include -#include #endif #include +#include #include +/* + * old, pre 2.4 kernel + */ +struct l_ipc_perm { + l_key_t key; + l_uid16_t uid; + l_gid16_t gid; + l_uid16_t cuid; + l_gid16_t cgid; + l_ushort mode; + l_ushort seq; +}; + struct l_seminfo { l_int semmap; l_int semmni; @@ -95,7 +107,7 @@ struct l_msginfo { }; static void -bsd_to_linux_shminfo( struct shminfo *bpp, struct l_shminfo *lpp) +bsd_to_linux_shminfo( struct shminfo *bpp, struct l_shminfo64 *lpp) { lpp->shmmax = bpp->shmmax; @@ -109,16 +121,16 @@ static void bsd_to_linux_shm_info( struct shm_info *bpp, struct l_shm_info *lpp) { - lpp->used_ids = bpp->used_ids ; - lpp->shm_tot = bpp->shm_tot ; - lpp->shm_rss = bpp->shm_rss ; - lpp->shm_swp = bpp->shm_swp ; - lpp->swap_attempts = bpp->swap_attempts ; - lpp->swap_successes = bpp->swap_successes ; + lpp->used_ids = bpp->used_ids; + lpp->shm_tot = bpp->shm_tot; + lpp->shm_rss = bpp->shm_rss; + lpp->shm_swp = bpp->shm_swp; + lpp->swap_attempts = bpp->swap_attempts; + lpp->swap_successes = bpp->swap_successes; } static void -linux_to_bsd_ipc_perm(struct l_ipc_perm *lpp, struct ipc_perm *bpp) +linux_to_bsd_ipc_perm(struct l_ipc64_perm *lpp, struct ipc_perm *bpp) { bpp->key = lpp->key; @@ -131,7 +143,7 @@ linux_to_bsd_ipc_perm(struct l_ipc_perm } static void -bsd_to_linux_ipc_perm(struct ipc_perm *bpp, struct l_ipc_perm *lpp) +bsd_to_linux_ipc_perm(struct ipc_perm *bpp, struct l_ipc64_perm *lpp) { lpp->key = bpp->key; @@ -185,29 +197,27 @@ struct l_shmid_ds { }; static void -linux_to_bsd_semid_ds(struct l_semid_ds *lsp, struct semid_ds *bsp) +linux_to_bsd_semid_ds(struct l_semid64_ds *lsp, struct semid_ds *bsp) { linux_to_bsd_ipc_perm(&lsp->sem_perm, &bsp->sem_perm); bsp->sem_otime = lsp->sem_otime; bsp->sem_ctime = lsp->sem_ctime; bsp->sem_nsems = lsp->sem_nsems; - bsp->sem_base = PTRIN(lsp->sem_base); } static void -bsd_to_linux_semid_ds(struct semid_ds *bsp, struct l_semid_ds *lsp) +bsd_to_linux_semid_ds(struct semid_ds *bsp, struct l_semid64_ds *lsp) { bsd_to_linux_ipc_perm(&bsp->sem_perm, &lsp->sem_perm); lsp->sem_otime = bsp->sem_otime; lsp->sem_ctime = bsp->sem_ctime; lsp->sem_nsems = bsp->sem_nsems; - lsp->sem_base = PTROUT(bsp->sem_base); } static void -linux_to_bsd_shmid_ds(struct l_shmid_ds *lsp, struct shmid_ds *bsp) +linux_to_bsd_shmid_ds(struct l_shmid64_ds *lsp, struct shmid_ds *bsp) { linux_to_bsd_ipc_perm(&lsp->shm_perm, &bsp->shm_perm); @@ -221,28 +231,21 @@ linux_to_bsd_shmid_ds(struct l_shmid_ds } static void -bsd_to_linux_shmid_ds(struct shmid_ds *bsp, struct l_shmid_ds *lsp) +bsd_to_linux_shmid_ds(struct shmid_ds *bsp, struct l_shmid64_ds *lsp) { bsd_to_linux_ipc_perm(&bsp->shm_perm, &lsp->shm_perm); - if (bsp->shm_segsz > INT_MAX) - lsp->shm_segsz = INT_MAX; - else - lsp->shm_segsz = bsp->shm_segsz; + lsp->shm_segsz = bsp->shm_segsz; lsp->shm_lpid = bsp->shm_lpid; lsp->shm_cpid = bsp->shm_cpid; - if (bsp->shm_nattch > SHRT_MAX) - lsp->shm_nattch = SHRT_MAX; - else - lsp->shm_nattch = bsp->shm_nattch; + lsp->shm_nattch = bsp->shm_nattch; lsp->shm_atime = bsp->shm_atime; lsp->shm_dtime = bsp->shm_dtime; lsp->shm_ctime = bsp->shm_ctime; - lsp->private3 = 0; } static void -linux_to_bsd_msqid_ds(struct l_msqid_ds *lsp, struct msqid_ds *bsp) +linux_to_bsd_msqid_ds(struct l_msqid64_ds *lsp, struct msqid_ds *bsp) { linux_to_bsd_ipc_perm(&lsp->msg_perm, &bsp->msg_perm); @@ -257,7 +260,7 @@ linux_to_bsd_msqid_ds(struct l_msqid_ds } static void -bsd_to_linux_msqid_ds(struct msqid_ds *bsp, struct l_msqid_ds *lsp) +bsd_to_linux_msqid_ds(struct msqid_ds *bsp, struct l_msqid64_ds *lsp) { bsd_to_linux_ipc_perm(&bsp->msg_perm, &lsp->msg_perm); @@ -271,11 +274,10 @@ bsd_to_linux_msqid_ds(struct msqid_ds *b lsp->msg_ctime = bsp->msg_ctime; } -static void -linux_ipc_perm_to_ipc64_perm(struct l_ipc_perm *in, struct l_ipc64_perm *out) +static int +linux_ipc64_perm_to_ipc_perm(struct l_ipc64_perm *in, struct l_ipc_perm *out) { - /* XXX: do we really need to do something here? */ out->key = in->key; out->uid = in->uid; out->gid = in->gid; @@ -283,186 +285,222 @@ linux_ipc_perm_to_ipc64_perm(struct l_ip out->cgid = in->cgid; out->mode = in->mode; out->seq = in->seq; + + /* Linux does not check overflow */ + if (out->uid != in->uid || out->gid != in->gid || + out->cuid != in->cuid || out->cgid != in->cgid || + out->mode != in->mode) + return (EOVERFLOW); + else + return (0); } static int -linux_msqid_pullup(l_int ver, struct l_msqid_ds *linux_msqid, caddr_t uaddr) +linux_msqid_pullup(l_int ver, struct l_msqid64_ds *linux_msqid64, caddr_t uaddr) { - struct l_msqid64_ds linux_msqid64; + struct l_msqid_ds linux_msqid; int error; - if (ver == LINUX_IPC_64) { - error = copyin(uaddr, &linux_msqid64, sizeof(linux_msqid64)); + if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) + return (copyin(uaddr, linux_msqid64, sizeof(*linux_msqid64))); + else { + error = copyin(uaddr, &linux_msqid, sizeof(linux_msqid)); if (error != 0) return (error); - bzero(linux_msqid, sizeof(*linux_msqid)); - - linux_msqid->msg_perm.uid = linux_msqid64.msg_perm.uid; - linux_msqid->msg_perm.gid = linux_msqid64.msg_perm.gid; - linux_msqid->msg_perm.mode = linux_msqid64.msg_perm.mode; + bzero(linux_msqid64, sizeof(*linux_msqid64)); - if (linux_msqid64.msg_qbytes > USHRT_MAX) - linux_msqid->msg_lqbytes = linux_msqid64.msg_qbytes; + linux_msqid64->msg_perm.uid = linux_msqid.msg_perm.uid; + linux_msqid64->msg_perm.gid = linux_msqid.msg_perm.gid; + linux_msqid64->msg_perm.mode = linux_msqid.msg_perm.mode; + if (linux_msqid.msg_qbytes == 0) + linux_msqid64->msg_qbytes = linux_msqid.msg_lqbytes; else - linux_msqid->msg_qbytes = linux_msqid64.msg_qbytes; - } else - error = copyin(uaddr, linux_msqid, sizeof(*linux_msqid)); - - return (error); + linux_msqid64->msg_qbytes = linux_msqid.msg_qbytes; + return (0); + } } static int -linux_msqid_pushdown(l_int ver, struct l_msqid_ds *linux_msqid, caddr_t uaddr) +linux_msqid_pushdown(l_int ver, struct l_msqid64_ds *linux_msqid64, caddr_t uaddr) { - struct l_msqid64_ds linux_msqid64; + struct l_msqid_ds linux_msqid; + int error; - if (ver == LINUX_IPC_64) { - bzero(&linux_msqid64, sizeof(linux_msqid64)); + if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) + return (copyout(linux_msqid64, uaddr, sizeof(*linux_msqid64))); + else { + bzero(&linux_msqid, sizeof(linux_msqid)); - linux_ipc_perm_to_ipc64_perm(&linux_msqid->msg_perm, - &linux_msqid64.msg_perm); + error = linux_ipc64_perm_to_ipc_perm(&linux_msqid64->msg_perm, + &linux_msqid.msg_perm); + if (error != 0) + return (error); - linux_msqid64.msg_stime = linux_msqid->msg_stime; - linux_msqid64.msg_rtime = linux_msqid->msg_rtime; - linux_msqid64.msg_ctime = linux_msqid->msg_ctime; + linux_msqid.msg_stime = linux_msqid64->msg_stime; + linux_msqid.msg_rtime = linux_msqid64->msg_rtime; + linux_msqid.msg_ctime = linux_msqid64->msg_ctime; - if (linux_msqid->msg_cbytes == 0) - linux_msqid64.msg_cbytes = linux_msqid->msg_lcbytes; + if (linux_msqid64->msg_cbytes > USHRT_MAX) + linux_msqid.msg_cbytes = USHRT_MAX; else - linux_msqid64.msg_cbytes = linux_msqid->msg_cbytes; - - linux_msqid64.msg_qnum = linux_msqid->msg_qnum; - - if (linux_msqid->msg_qbytes == 0) - linux_msqid64.msg_qbytes = linux_msqid->msg_lqbytes; + linux_msqid.msg_cbytes = linux_msqid64->msg_cbytes; + linux_msqid.msg_lcbytes = linux_msqid64->msg_cbytes; + if (linux_msqid64->msg_qnum > USHRT_MAX) + linux_msqid.msg_qnum = linux_msqid64->msg_qnum; else - linux_msqid64.msg_qbytes = linux_msqid->msg_qbytes; - - linux_msqid64.msg_lspid = linux_msqid->msg_lspid; - linux_msqid64.msg_lrpid = linux_msqid->msg_lrpid; + linux_msqid.msg_qnum = linux_msqid64->msg_qnum; + if (linux_msqid64->msg_qbytes > USHRT_MAX) + linux_msqid.msg_qbytes = linux_msqid64->msg_qbytes; + else + linux_msqid.msg_qbytes = linux_msqid64->msg_qbytes; + linux_msqid.msg_lqbytes = linux_msqid64->msg_qbytes; + linux_msqid.msg_lspid = linux_msqid64->msg_lspid; + linux_msqid.msg_lrpid = linux_msqid64->msg_lrpid; + + /* Linux does not check overflow */ + if (linux_msqid.msg_stime != linux_msqid64->msg_stime || + linux_msqid.msg_rtime != linux_msqid64->msg_rtime || + linux_msqid.msg_ctime != linux_msqid64->msg_ctime) + return (EOVERFLOW); - return (copyout(&linux_msqid64, uaddr, sizeof(linux_msqid64))); - } else - return (copyout(linux_msqid, uaddr, sizeof(*linux_msqid))); + return (copyout(&linux_msqid, uaddr, sizeof(linux_msqid))); + } } static int -linux_semid_pullup(l_int ver, struct l_semid_ds *linux_semid, caddr_t uaddr) +linux_semid_pullup(l_int ver, struct l_semid64_ds *linux_semid64, caddr_t uaddr) { - struct l_semid64_ds linux_semid64; + struct l_semid_ds linux_semid; int error; - if (ver == LINUX_IPC_64) { - error = copyin(uaddr, &linux_semid64, sizeof(linux_semid64)); + if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) + return (copyin(uaddr, linux_semid64, sizeof(*linux_semid64))); + else { + error = copyin(uaddr, &linux_semid, sizeof(linux_semid)); if (error != 0) return (error); - bzero(linux_semid, sizeof(*linux_semid)); - - linux_semid->sem_perm.uid = linux_semid64.sem_perm.uid; - linux_semid->sem_perm.gid = linux_semid64.sem_perm.gid; - linux_semid->sem_perm.mode = linux_semid64.sem_perm.mode; - } else - error = copyin(uaddr, linux_semid, sizeof(*linux_semid)); + bzero(linux_semid64, sizeof(*linux_semid64)); - return (error); + linux_semid64->sem_perm.uid = linux_semid.sem_perm.uid; + linux_semid64->sem_perm.gid = linux_semid.sem_perm.gid; + linux_semid64->sem_perm.mode = linux_semid.sem_perm.mode; + return (0); + } } static int -linux_semid_pushdown(l_int ver, struct l_semid_ds *linux_semid, caddr_t uaddr) +linux_semid_pushdown(l_int ver, struct l_semid64_ds *linux_semid64, caddr_t uaddr) { - struct l_semid64_ds linux_semid64; + struct l_semid_ds linux_semid; + int error; + + if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) + return (copyout(linux_semid64, uaddr, sizeof(*linux_semid64))); + else { + bzero(&linux_semid, sizeof(linux_semid)); + + error = linux_ipc64_perm_to_ipc_perm(&linux_semid64->sem_perm, + &linux_semid.sem_perm); + if (error != 0) + return (error); - if (ver == LINUX_IPC_64) { - bzero(&linux_semid64, sizeof(linux_semid64)); + linux_semid.sem_otime = linux_semid64->sem_otime; + linux_semid.sem_ctime = linux_semid64->sem_ctime; + linux_semid.sem_nsems = linux_semid64->sem_nsems; - linux_ipc_perm_to_ipc64_perm(&linux_semid->sem_perm, - &linux_semid64.sem_perm); + /* Linux does not check overflow */ + if (linux_semid.sem_otime != linux_semid64->sem_otime || + linux_semid.sem_ctime != linux_semid64->sem_ctime || + linux_semid.sem_nsems != linux_semid64->sem_nsems) + return (EOVERFLOW); - linux_semid64.sem_otime = linux_semid->sem_otime; - linux_semid64.sem_ctime = linux_semid->sem_ctime; - linux_semid64.sem_nsems = linux_semid->sem_nsems; - - return (copyout(&linux_semid64, uaddr, sizeof(linux_semid64))); - } else - return (copyout(linux_semid, uaddr, sizeof(*linux_semid))); + return (copyout(&linux_semid, uaddr, sizeof(linux_semid))); + } } static int -linux_shmid_pullup(l_int ver, struct l_shmid_ds *linux_shmid, caddr_t uaddr) +linux_shmid_pullup(l_int ver, struct l_shmid64_ds *linux_shmid64, caddr_t uaddr) { - struct l_shmid64_ds linux_shmid64; + struct l_shmid_ds linux_shmid; int error; - if (ver == LINUX_IPC_64) { - error = copyin(uaddr, &linux_shmid64, sizeof(linux_shmid64)); + if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) + return (copyin(uaddr, linux_shmid64, sizeof(*linux_shmid64))); + else { + error = copyin(uaddr, &linux_shmid, sizeof(linux_shmid)); if (error != 0) return (error); - bzero(linux_shmid, sizeof(*linux_shmid)); + bzero(linux_shmid64, sizeof(*linux_shmid64)); - linux_shmid->shm_perm.uid = linux_shmid64.shm_perm.uid; - linux_shmid->shm_perm.gid = linux_shmid64.shm_perm.gid; - linux_shmid->shm_perm.mode = linux_shmid64.shm_perm.mode; - } else - error = copyin(uaddr, linux_shmid, sizeof(*linux_shmid)); - - return (error); + linux_shmid64->shm_perm.uid = linux_shmid.shm_perm.uid; + linux_shmid64->shm_perm.gid = linux_shmid.shm_perm.gid; + linux_shmid64->shm_perm.mode = linux_shmid.shm_perm.mode; + return (0); + } } static int -linux_shmid_pushdown(l_int ver, struct l_shmid_ds *linux_shmid, caddr_t uaddr) +linux_shmid_pushdown(l_int ver, struct l_shmid64_ds *linux_shmid64, caddr_t uaddr) { - struct l_shmid64_ds linux_shmid64; + struct l_shmid_ds linux_shmid; + int error; - /* - * XXX: This is backwards and loses information in shm_nattch - * and shm_segsz. We should probably either expose the BSD - * shmid structure directly and convert it to either the - * non-64 or 64 variant directly or the code should always - * convert to the 64 variant and then truncate values into the - * non-64 variant if needed since the 64 variant has more - * precision. - */ - if (ver == LINUX_IPC_64) { - bzero(&linux_shmid64, sizeof(linux_shmid64)); + if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) + return (copyout(linux_shmid64, uaddr, sizeof(*linux_shmid64))); + else { + bzero(&linux_shmid, sizeof(linux_shmid)); + + error = linux_ipc64_perm_to_ipc_perm(&linux_shmid64->shm_perm, + &linux_shmid.shm_perm); + if (error != 0) + return (error); - linux_ipc_perm_to_ipc64_perm(&linux_shmid->shm_perm, - &linux_shmid64.shm_perm); + linux_shmid.shm_segsz = linux_shmid64->shm_segsz; + linux_shmid.shm_atime = linux_shmid64->shm_atime; + linux_shmid.shm_dtime = linux_shmid64->shm_dtime; + linux_shmid.shm_ctime = linux_shmid64->shm_ctime; + linux_shmid.shm_cpid = linux_shmid64->shm_cpid; + linux_shmid.shm_lpid = linux_shmid64->shm_lpid; + linux_shmid.shm_nattch = linux_shmid64->shm_nattch; + + /* Linux does not check overflow */ + if (linux_shmid.shm_segsz != linux_shmid64->shm_segsz || + linux_shmid.shm_atime != linux_shmid64->shm_atime || + linux_shmid.shm_dtime != linux_shmid64->shm_dtime || + linux_shmid.shm_ctime != linux_shmid64->shm_ctime || + linux_shmid.shm_cpid != linux_shmid64->shm_cpid || + linux_shmid.shm_lpid != linux_shmid64->shm_lpid || + linux_shmid.shm_nattch != linux_shmid64->shm_nattch) + return (EOVERFLOW); - linux_shmid64.shm_segsz = linux_shmid->shm_segsz; - linux_shmid64.shm_atime = linux_shmid->shm_atime; - linux_shmid64.shm_dtime = linux_shmid->shm_dtime; - linux_shmid64.shm_ctime = linux_shmid->shm_ctime; - linux_shmid64.shm_cpid = linux_shmid->shm_cpid; - linux_shmid64.shm_lpid = linux_shmid->shm_lpid; - linux_shmid64.shm_nattch = linux_shmid->shm_nattch; - - return (copyout(&linux_shmid64, uaddr, sizeof(linux_shmid64))); - } else - return (copyout(linux_shmid, uaddr, sizeof(*linux_shmid))); + return (copyout(&linux_shmid, uaddr, sizeof(linux_shmid))); + } } static int -linux_shminfo_pushdown(l_int ver, struct l_shminfo *linux_shminfo, +linux_shminfo_pushdown(l_int ver, struct l_shminfo64 *linux_shminfo64, caddr_t uaddr) { - struct l_shminfo64 linux_shminfo64; + struct l_shminfo linux_shminfo; - if (ver == LINUX_IPC_64) { - bzero(&linux_shminfo64, sizeof(linux_shminfo64)); + if (ver == LINUX_IPC_64 || SV_CURPROC_FLAG(SV_LP64)) + return (copyout(linux_shminfo64, uaddr, + sizeof(*linux_shminfo64))); + else { + bzero(&linux_shminfo, sizeof(linux_shminfo)); + + linux_shminfo.shmmax = linux_shminfo64->shmmax; + linux_shminfo.shmmin = linux_shminfo64->shmmin; + linux_shminfo.shmmni = linux_shminfo64->shmmni; + linux_shminfo.shmseg = linux_shminfo64->shmseg; + linux_shminfo.shmall = linux_shminfo64->shmall; - linux_shminfo64.shmmax = linux_shminfo->shmmax; - linux_shminfo64.shmmin = linux_shminfo->shmmin; - linux_shminfo64.shmmni = linux_shminfo->shmmni; - linux_shminfo64.shmseg = linux_shminfo->shmseg; - linux_shminfo64.shmall = linux_shminfo->shmall; - - return (copyout(&linux_shminfo64, uaddr, - sizeof(linux_shminfo64))); - } else - return (copyout(linux_shminfo, uaddr, sizeof(*linux_shminfo))); + return (copyout(&linux_shminfo, uaddr, + sizeof(linux_shminfo))); + } } int @@ -500,7 +538,7 @@ linux_semget(struct thread *td, struct l int linux_semctl(struct thread *td, struct linux_semctl_args *args) { - struct l_semid_ds linux_semid; + struct l_semid64_ds linux_semid64; struct l_seminfo linux_seminfo; struct semid_ds semid; union semun semun; @@ -530,29 +568,35 @@ linux_semctl(struct thread *td, struct l case LINUX_IPC_SET: cmd = IPC_SET; error = linux_semid_pullup(args->cmd & LINUX_IPC_64, - &linux_semid, PTRIN(args->arg.buf)); + &linux_semid64, PTRIN(args->arg.buf)); if (error != 0) return (error); - linux_to_bsd_semid_ds(&linux_semid, &semid); + linux_to_bsd_semid_ds(&linux_semid64, &semid); semun.buf = &semid; return (kern_semctl(td, args->semid, args->semnum, cmd, &semun, td->td_retval)); case LINUX_IPC_STAT: + cmd = IPC_STAT; + semun.buf = &semid; + error = kern_semctl(td, args->semid, args->semnum, cmd, &semun, + &rval); + if (error != 0) + return (error); + bsd_to_linux_semid_ds(&semid, &linux_semid64); + return (linux_semid_pushdown(args->cmd & LINUX_IPC_64, + &linux_semid64, PTRIN(args->arg.buf))); case LINUX_SEM_STAT: - if ((args->cmd & ~LINUX_IPC_64) == LINUX_IPC_STAT) - cmd = IPC_STAT; - else - cmd = SEM_STAT; + cmd = SEM_STAT; semun.buf = &semid; error = kern_semctl(td, args->semid, args->semnum, cmd, &semun, &rval); if (error != 0) return (error); - bsd_to_linux_semid_ds(&semid, &linux_semid); + bsd_to_linux_semid_ds(&semid, &linux_semid64); error = linux_semid_pushdown(args->cmd & LINUX_IPC_64, - &linux_semid, PTRIN(args->arg.buf)); + &linux_semid64, PTRIN(args->arg.buf)); if (error == 0) - td->td_retval[0] = (cmd == SEM_STAT) ? rval : 0; + td->td_retval[0] = rval; return (error); case LINUX_IPC_INFO: case LINUX_SEM_INFO: @@ -575,15 +619,18 @@ linux_semctl(struct thread *td, struct l PTRIN(args->arg.buf), sizeof(linux_seminfo)); if (error != 0) return (error); + /* + * TODO: Linux return the last assigned id, not the semmni. + */ td->td_retval[0] = seminfo.semmni; - return (0); /* No need for __semctl call */ + return (0); case LINUX_GETALL: cmd = GETALL; - semun.val = args->arg.val; + semun.array = PTRIN(args->arg.array); break; case LINUX_SETALL: cmd = SETALL; - semun.val = args->arg.val; + semun.array = PTRIN(args->arg.array); break; default: linux_msg(td, "ipc type %d is not implemented", @@ -649,7 +696,7 @@ int linux_msgctl(struct thread *td, struct linux_msgctl_args *args) { int error, bsd_cmd; - struct l_msqid_ds linux_msqid; + struct l_msqid64_ds linux_msqid64; struct msqid_ds bsd_msqid; bsd_cmd = args->cmd & ~LINUX_IPC_64; @@ -689,10 +736,10 @@ linux_msgctl(struct thread *td, struct l case LINUX_IPC_SET: error = linux_msqid_pullup(args->cmd & LINUX_IPC_64, - &linux_msqid, PTRIN(args->buf)); + &linux_msqid64, PTRIN(args->buf)); if (error != 0) return (error); - linux_to_bsd_msqid_ds(&linux_msqid, &bsd_msqid); + linux_to_bsd_msqid_ds(&linux_msqid64, &bsd_msqid); break; case LINUX_IPC_RMID: @@ -705,14 +752,17 @@ linux_msgctl(struct thread *td, struct l } error = kern_msgctl(td, args->msqid, bsd_cmd, &bsd_msqid); - if (error != 0) + if (error != 0) { + if (bsd_cmd == LINUX_IPC_RMID && error == EACCES) + return (EPERM); if (bsd_cmd != LINUX_IPC_RMID || error != EINVAL) return (error); + } if (bsd_cmd == LINUX_IPC_STAT) { - bsd_to_linux_msqid_ds(&bsd_msqid, &linux_msqid); + bsd_to_linux_msqid_ds(&bsd_msqid, &linux_msqid64); return (linux_msqid_pushdown(args->cmd & LINUX_IPC_64, - &linux_msqid, PTRIN(args->buf))); + &linux_msqid64, PTRIN(args->buf))); } return (0); @@ -774,8 +824,8 @@ linux_shmget(struct thread *td, struct l int linux_shmctl(struct thread *td, struct linux_shmctl_args *args) { - struct l_shmid_ds linux_shmid; - struct l_shminfo linux_shminfo; + struct l_shmid64_ds linux_shmid64; + struct l_shminfo64 linux_shminfo64; struct l_shm_info linux_shm_info; struct shmid_ds bsd_shmid; int error; @@ -791,10 +841,10 @@ linux_shmctl(struct thread *td, struct l if (error != 0) return (error); - bsd_to_linux_shminfo(&bsd_shminfo, &linux_shminfo); + bsd_to_linux_shminfo(&bsd_shminfo, &linux_shminfo64); return (linux_shminfo_pushdown(args->cmd & LINUX_IPC_64, - &linux_shminfo, PTRIN(args->buf))); + &linux_shminfo64, PTRIN(args->buf))); } case LINUX_SHM_INFO: { @@ -819,10 +869,10 @@ linux_shmctl(struct thread *td, struct l if (error != 0) return (error); - bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid); + bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid64); return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64, - &linux_shmid, PTRIN(args->buf))); + &linux_shmid64, PTRIN(args->buf))); case LINUX_SHM_STAT: /* Perform shmctl wanting removed segments lookup */ @@ -831,18 +881,18 @@ linux_shmctl(struct thread *td, struct l if (error != 0) return (error); - bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid); + bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid64); return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64, - &linux_shmid, PTRIN(args->buf))); + &linux_shmid64, PTRIN(args->buf))); case LINUX_IPC_SET: error = linux_shmid_pullup(args->cmd & LINUX_IPC_64, - &linux_shmid, PTRIN(args->buf)); + &linux_shmid64, PTRIN(args->buf)); if (error != 0) return (error); - linux_to_bsd_shmid_ds(&linux_shmid, &bsd_shmid); + linux_to_bsd_shmid_ds(&linux_shmid64, &bsd_shmid); /* Perform shmctl wanting removed segments lookup */ return (kern_shmctl(td, args->shmid, IPC_SET, @@ -855,10 +905,10 @@ linux_shmctl(struct thread *td, struct l buf = NULL; else { error = linux_shmid_pullup(args->cmd & LINUX_IPC_64, - &linux_shmid, PTRIN(args->buf)); + &linux_shmid64, PTRIN(args->buf)); if (error != 0) return (error); - linux_to_bsd_shmid_ds(&linux_shmid, &bsd_shmid); + linux_to_bsd_shmid_ds(&linux_shmid64, &bsd_shmid); buf = (void *)&bsd_shmid; } return (kern_shmctl(td, args->shmid, IPC_RMID, buf, NULL)); Copied: stable/11/sys/compat/linux/linux_ipc64.h (from r314866, head/sys/compat/linux/linux_ipc64.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/compat/linux/linux_ipc64.h Sat Apr 15 15:11:23 2017 (r316962, copy of r314866, head/sys/compat/linux/linux_ipc64.h) @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 2002 Maxim Sobolev + * 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 + * in this position and unchanged. + * 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. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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$ + */ + +#ifndef _LINUX_IPC64_H_ +#define _LINUX_IPC64_H_ + +/* + * The generic ipc64_perm structure. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 32-bit mode_t on architectures that only had 16 bit + * - 32-bit seq + * - 2 miscellaneous 32-bit values + */ +struct l_ipc64_perm +{ + l_key_t key; + l_uid_t uid; + l_gid_t gid; + l_uid_t cuid; + l_gid_t cgid; + l_mode_t mode; + /* pad if mode_t is ushort: */ + unsigned char __pad1[sizeof(l_int) - sizeof(l_mode_t)]; + l_ushort seq; + l_ushort __pad2; + l_ulong __unused1; + l_ulong __unused2; +}; + +/* + * The generic msqid64_ds structure fro x86 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ + +struct l_msqid64_ds { + struct l_ipc64_perm msg_perm; + l_time_t msg_stime; /* last msgsnd time */ +#if !defined(__LP64__) || defined(COMPAT_LINUX32) + l_ulong __unused1; +#endif + l_time_t msg_rtime; /* last msgrcv time */ +#if !defined(__LP64__) || defined(COMPAT_LINUX32) + l_ulong __unused2; +#endif + l_time_t msg_ctime; /* last change time */ +#if !defined(__LP64__) || defined(COMPAT_LINUX32) + l_ulong __unused3; +#endif + l_ulong msg_cbytes; /* current number of bytes on queue */ + l_ulong msg_qnum; /* number of messages in queue */ + l_ulong msg_qbytes; /* max number of bytes on queue */ + l_pid_t msg_lspid; /* pid of last msgsnd */ + l_pid_t msg_lrpid; /* last receive pid */ + l_ulong __unused4; + l_ulong __unused5; +}; + +/* + * The generic semid64_ds structure for x86 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ + +struct l_semid64_ds { + struct l_ipc64_perm sem_perm; /* permissions */ + l_time_t sem_otime; /* last semop time */ + l_ulong __unused1; + l_time_t sem_ctime; /* last change time */ + l_ulong __unused2; + l_ulong sem_nsems; /* no. of semaphores in array */ + l_ulong __unused3; + l_ulong __unused4; +}; + +/* + * The generic shmid64_ds structure for x86 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ + +struct l_shmid64_ds { + struct l_ipc64_perm shm_perm; /* operation perms */ + l_size_t shm_segsz; /* size of segment (bytes) */ + l_time_t shm_atime; /* last attach time */ +#if !defined(__LP64__) || defined(COMPAT_LINUX32) + l_ulong __unused1; +#endif + l_time_t shm_dtime; /* last detach time */ +#if !defined(__LP64__) || defined(COMPAT_LINUX32) + l_ulong __unused2; +#endif + l_time_t shm_ctime; /* last change time */ +#if !defined(__LP64__) || defined(COMPAT_LINUX32) + l_ulong __unused3; +#endif + l_pid_t shm_cpid; /* pid of creator */ + l_pid_t shm_lpid; /* pid of last operator */ + l_ulong shm_nattch; /* no. of current attaches */ + l_ulong __unused4; + l_ulong __unused5; +}; + +struct l_shminfo64 { + l_ulong shmmax; + l_ulong shmmin; + l_ulong shmmni; + l_ulong shmseg; + l_ulong shmall; + l_ulong __unused1; + l_ulong __unused2; + l_ulong __unused3; + l_ulong __unused4; +}; + +#endif /* !LINUX_IPC64_H_ */ Modified: stable/11/sys/i386/linux/linux.h ============================================================================== --- stable/11/sys/i386/linux/linux.h Sat Apr 15 15:09:23 2017 (r316961) +++ stable/11/sys/i386/linux/linux.h Sat Apr 15 15:11:23 2017 (r316962) @@ -453,16 +453,6 @@ union l_semun { void *__pad; }; -struct l_ipc_perm { - l_key_t key; - l_uid16_t uid; - l_gid16_t gid; - l_uid16_t cuid; - l_gid16_t cgid; - l_ushort mode; - l_ushort seq; -}; - /* * Socket defines */ From owner-svn-src-all@freebsd.org Sat Apr 15 15:11:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5CD8D3E43D; Sat, 15 Apr 2017 15:11:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 8E409852; Sat, 15 Apr 2017 15:11:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id AFB501A2009; Sun, 16 Apr 2017 01:11:20 +1000 (AEST) Date: Sun, 16 Apr 2017 01:11:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: "Ngie Cooper (yaneurabeya)" , src-committers , rgrimes@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <1774031.vuxxQt1GW8@ralph.baldwin.cx> Message-ID: <20170416003716.I2908@besplex.bde.org> References: <201704150149.v3F1nu0D009274@pdx.rh.CN85.dnsmgr.net> <4CBF25DF-F407-4F50-8724-B73F64734E19@gmail.com> <1774031.vuxxQt1GW8@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=iKhvJSA4AAAA:8 a=BJNNuotrTlMSYgykdtQA:9 a=wmQd6wXe6-s_8t1q:21 a=HpH15m97YzivtNej:21 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:11:22 -0000 On Sat, 15 Apr 2017, John Baldwin wrote: > On Friday, April 14, 2017 07:40:57 PM Ngie Cooper wrote: >> >>> On Apr 14, 2017, at 18:49, Rodney W. Grimes wrote: >>> Do we use KiB, MiB, GiB,... any place else in the system? I cant think of >>> a place we do this, so please, lets not start doing this here? > > The du manpage does at least. > >> humanize_number(3) from libutil uses IEC units. > > Note that it is optional though. You can use flags to decide what you want > and the default is to not use IEC. ls -h uses humanize_number but not with > IEC units. In particular, there are flags to control the scaling and > prefixes used: HN_DIVISOR_1000 and HN_IEC_PREFIXES. The default is to use > power-of-2 scaling with non-IEC prefixes (so KB == 1024 by default). > Currently nothing in base uses HN_IEC_PREFIXES. > > (I see you already reverted the printf, just wanted to point out that the > humanize_number behavior is configurable.) There is already the environment variable BLOCKSIZE to turn off bogus units in a for places. I think most uses set this to 1 real K and barely remember how bad the defaults are without it until they somehow run a shell without it set (perhaps in single-user mode). Its designers didn't forsee IEC mistakes, else it would with be more than a single number, and have meta-info to turn off bogus unit names. ls(1) and df(1) don't properly document that -h (or whatever IEC mistakes might be in it) have precedence over BLOCKSIZE. du(1) does document this properly. Bruce From owner-svn-src-all@freebsd.org Sat Apr 15 15:12:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E41E5D3E691; Sat, 15 Apr 2017 15:12:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3F7FB96; Sat, 15 Apr 2017 15:12:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FFCPgj083518; Sat, 15 Apr 2017 15:12:25 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FFCPoR083517; Sat, 15 Apr 2017 15:12:25 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151512.v3FFCPoR083517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316963 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:12:27 -0000 Author: dchagin Date: Sat Apr 15 15:12:25 2017 New Revision: 316963 URL: https://svnweb.freebsd.org/changeset/base/316963 Log: MFC r314867: Linux kernel does not export to the user space ipc_perm.mode values other than S_IRWXUGO (0777). Modified: stable/11/sys/compat/linux/linux_ipc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:11:23 2017 (r316962) +++ stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:12:25 2017 (r316963) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "opt_compat.h" @@ -151,7 +152,7 @@ bsd_to_linux_ipc_perm(struct ipc_perm *b lpp->gid = bpp->gid; lpp->cuid = bpp->cuid; lpp->cgid = bpp->cgid; - lpp->mode = bpp->mode; + lpp->mode = bpp->mode & (S_IRWXU|S_IRWXG|S_IRWXO); lpp->seq = bpp->seq; } From owner-svn-src-all@freebsd.org Sat Apr 15 15:13:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CB4BD3E787; Sat, 15 Apr 2017 15:13:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0933D4B; Sat, 15 Apr 2017 15:13:55 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FFDs0H083626; Sat, 15 Apr 2017 15:13:54 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FFDsBg083625; Sat, 15 Apr 2017 15:13:54 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151513.v3FFDsBg083625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316964 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:13:56 -0000 Author: dchagin Date: Sat Apr 15 15:13:54 2017 New Revision: 316964 URL: https://svnweb.freebsd.org/changeset/base/316964 Log: MFC r314868: Linux semop system call return EINVAL in case when the invalid nsops or semid values specified. Modified: stable/11/sys/compat/linux/linux_ipc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:12:25 2017 (r316963) +++ stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:13:54 2017 (r316964) @@ -513,6 +513,8 @@ linux_semop(struct thread *td, struct li int nsops; } */ bsd_args; + if (args->nsops < 1 || args->semid < 0) + return (EINVAL); bsd_args.semid = args->semid; bsd_args.sops = PTRIN(args->tsops); bsd_args.nsops = args->nsops; From owner-svn-src-all@freebsd.org Sat Apr 15 15:15:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B09D9D3E89C; Sat, 15 Apr 2017 15:15:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80411F98; Sat, 15 Apr 2017 15:15:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FFFgrF083763; Sat, 15 Apr 2017 15:15:42 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FFFgZj083762; Sat, 15 Apr 2017 15:15:42 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151515.v3FFFgZj083762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316965 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:15:43 -0000 Author: dchagin Date: Sat Apr 15 15:15:42 2017 New Revision: 316965 URL: https://svnweb.freebsd.org/changeset/base/316965 Log: MFC r316599: Prevent ushort values overflow when convert new Linux 64-bit ipc struct to the old Linux ipc struct. Modified: stable/11/sys/compat/linux/linux_ipc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:13:54 2017 (r316964) +++ stable/11/sys/compat/linux/linux_ipc.c Sat Apr 15 15:15:42 2017 (r316965) @@ -348,11 +348,11 @@ linux_msqid_pushdown(l_int ver, struct l linux_msqid.msg_cbytes = linux_msqid64->msg_cbytes; linux_msqid.msg_lcbytes = linux_msqid64->msg_cbytes; if (linux_msqid64->msg_qnum > USHRT_MAX) - linux_msqid.msg_qnum = linux_msqid64->msg_qnum; + linux_msqid.msg_qnum = USHRT_MAX; else linux_msqid.msg_qnum = linux_msqid64->msg_qnum; if (linux_msqid64->msg_qbytes > USHRT_MAX) - linux_msqid.msg_qbytes = linux_msqid64->msg_qbytes; + linux_msqid.msg_qbytes = USHRT_MAX; else linux_msqid.msg_qbytes = linux_msqid64->msg_qbytes; linux_msqid.msg_lqbytes = linux_msqid64->msg_qbytes; From owner-svn-src-all@freebsd.org Sat Apr 15 15:29:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328FED3EBFE; Sat, 15 Apr 2017 15:29:18 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBBE1806; Sat, 15 Apr 2017 15:29:17 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FFTHJT088093; Sat, 15 Apr 2017 15:29:17 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FFTHJp088092; Sat, 15 Apr 2017 15:29:17 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151529.v3FFTHJp088092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316966 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:29:18 -0000 Author: dchagin Date: Sat Apr 15 15:29:16 2017 New Revision: 316966 URL: https://svnweb.freebsd.org/changeset/base/316966 Log: MFC r315498: Check for negative nanoseconds. Linux do that in timespec_valid(). Modified: stable/11/sys/compat/linux/linux_time.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_time.c ============================================================================== --- stable/11/sys/compat/linux/linux_time.c Sat Apr 15 15:15:42 2017 (r316965) +++ stable/11/sys/compat/linux/linux_time.c Sat Apr 15 15:29:16 2017 (r316966) @@ -142,7 +142,7 @@ linux_to_native_timespec(struct timespec LIN_SDT_PROBE2(time, linux_to_native_timespec, entry, ntp, ltp); - if (ltp->tv_sec < 0 || ltp->tv_nsec > (l_long)999999999L) { + if (ltp->tv_sec < 0 || (l_ulong)ltp->tv_nsec > 999999999L) { LIN_SDT_PROBE1(time, linux_to_native_timespec, return, EINVAL); return (EINVAL); } From owner-svn-src-all@freebsd.org Sat Apr 15 15:30:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35591D3EC94; Sat, 15 Apr 2017 15:30:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0449F94B; Sat, 15 Apr 2017 15:30:29 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FFUTAQ088211; Sat, 15 Apr 2017 15:30:29 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FFUTot088210; Sat, 15 Apr 2017 15:30:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151530.v3FFUTot088210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316967 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:30:30 -0000 Author: dchagin Date: Sat Apr 15 15:30:28 2017 New Revision: 316967 URL: https://svnweb.freebsd.org/changeset/base/316967 Log: MFC r316393: As noted by bde@ negative tv_sec values are not checked for overflow, so overflow can still occur. Fix that. Also remove the extra check for tv_sec size as under COMPAT_LINUX32 it is always true. Modified: stable/11/sys/compat/linux/linux_time.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_time.c ============================================================================== --- stable/11/sys/compat/linux/linux_time.c Sat Apr 15 15:29:16 2017 (r316966) +++ stable/11/sys/compat/linux/linux_time.c Sat Apr 15 15:30:28 2017 (r316967) @@ -125,8 +125,7 @@ native_to_linux_timespec(struct l_timesp LIN_SDT_PROBE2(time, native_to_linux_timespec, entry, ltp, ntp); #ifdef COMPAT_LINUX32 - if (ntp->tv_sec > INT_MAX && - sizeof(ltp->tv_sec) != sizeof(ntp->tv_sec)) + if (ntp->tv_sec > INT_MAX || ntp->tv_sec < INT_MIN) return (EOVERFLOW); #endif ltp->tv_sec = ntp->tv_sec; From owner-svn-src-all@freebsd.org Sat Apr 15 15:31:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E60B9D3EE4F; Sat, 15 Apr 2017 15:31:29 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B79A0C2D; Sat, 15 Apr 2017 15:31:29 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FFVS6k091260; Sat, 15 Apr 2017 15:31:28 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FFVSWp091259; Sat, 15 Apr 2017 15:31:28 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151531.v3FFVSWp091259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316968 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:31:30 -0000 Author: dchagin Date: Sat Apr 15 15:31:28 2017 New Revision: 316968 URL: https://svnweb.freebsd.org/changeset/base/316968 Log: MFC r316394: The value in the tv_nsec field should be in the range 0 to 999999999. Modified: stable/11/sys/compat/linux/linux_time.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_time.c ============================================================================== --- stable/11/sys/compat/linux/linux_time.c Sat Apr 15 15:30:28 2017 (r316967) +++ stable/11/sys/compat/linux/linux_time.c Sat Apr 15 15:31:28 2017 (r316968) @@ -141,7 +141,7 @@ linux_to_native_timespec(struct timespec LIN_SDT_PROBE2(time, linux_to_native_timespec, entry, ntp, ltp); - if (ltp->tv_sec < 0 || (l_ulong)ltp->tv_nsec > 999999999L) { + if (ltp->tv_sec < 0 || ltp->tv_nsec < 0 || ltp->tv_nsec > 999999999) { LIN_SDT_PROBE1(time, linux_to_native_timespec, return, EINVAL); return (EINVAL); } From owner-svn-src-all@freebsd.org Sat Apr 15 15:32:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18023D3EEDB; Sat, 15 Apr 2017 15:32:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDAC4E25; Sat, 15 Apr 2017 15:32:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FFWNZU092197; Sat, 15 Apr 2017 15:32:23 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FFWNlk092196; Sat, 15 Apr 2017 15:32:23 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151532.v3FFWNlk092196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316969 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:32:24 -0000 Author: dchagin Date: Sat Apr 15 15:32:22 2017 New Revision: 316969 URL: https://svnweb.freebsd.org/changeset/base/316969 Log: MFC r316395: Remove excess tv_nsec test as this is done by linux_to_native_timespec(). Modified: stable/11/sys/compat/linux/linux_futex.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_futex.c ============================================================================== --- stable/11/sys/compat/linux/linux_futex.c Sat Apr 15 15:31:28 2017 (r316968) +++ stable/11/sys/compat/linux/linux_futex.c Sat Apr 15 15:32:22 2017 (r316969) @@ -294,9 +294,6 @@ futex_copyin_timeout(int op, struct l_ti error = linux_to_native_timespec(ts, <s); if (error) return (error); - if (ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000) - return (EINVAL); - if (clockrt) { nanotime(&kts); timespecsub(ts, &kts); From owner-svn-src-all@freebsd.org Sat Apr 15 15:38:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69065D3F067; Sat, 15 Apr 2017 15:38:17 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D7E01104; Sat, 15 Apr 2017 15:38:17 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FFcGVs092506; Sat, 15 Apr 2017 15:38:16 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FFcGt3092502; Sat, 15 Apr 2017 15:38:16 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704151538.v3FFcGt3092502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 15 Apr 2017 15:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r316970 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:38:17 -0000 Author: dchagin Date: Sat Apr 15 15:38:15 2017 New Revision: 316970 URL: https://svnweb.freebsd.org/changeset/base/316970 Log: MFC r315501: To reduce code duplication move socket defines to the MI path. Modified: stable/11/sys/amd64/linux/linux.h stable/11/sys/amd64/linux32/linux.h stable/11/sys/compat/linux/linux_socket.h stable/11/sys/i386/linux/linux.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux.h ============================================================================== --- stable/11/sys/amd64/linux/linux.h Sat Apr 15 15:32:22 2017 (r316969) +++ stable/11/sys/amd64/linux/linux.h Sat Apr 15 15:38:15 2017 (r316970) @@ -383,50 +383,6 @@ union l_semun { l_uintptr_t __pad; }; -/* - * Socket defines - */ - -#define LINUX_SOL_SOCKET 1 -#define LINUX_SOL_IP 0 -#define LINUX_SOL_IPX 256 -#define LINUX_SOL_AX25 257 -#define LINUX_SOL_TCP 6 -#define LINUX_SOL_UDP 17 - -#define LINUX_SO_DEBUG 1 -#define LINUX_SO_REUSEADDR 2 -#define LINUX_SO_TYPE 3 -#define LINUX_SO_ERROR 4 -#define LINUX_SO_DONTROUTE 5 -#define LINUX_SO_BROADCAST 6 -#define LINUX_SO_SNDBUF 7 -#define LINUX_SO_RCVBUF 8 -#define LINUX_SO_KEEPALIVE 9 -#define LINUX_SO_OOBINLINE 10 -#define LINUX_SO_NO_CHECK 11 -#define LINUX_SO_PRIORITY 12 -#define LINUX_SO_LINGER 13 -#define LINUX_SO_PASSCRED 16 -#define LINUX_SO_PEERCRED 17 -#define LINUX_SO_RCVLOWAT 18 -#define LINUX_SO_SNDLOWAT 19 -#define LINUX_SO_RCVTIMEO 20 -#define LINUX_SO_SNDTIMEO 21 -#define LINUX_SO_TIMESTAMP 29 -#define LINUX_SO_ACCEPTCONN 30 - -#define LINUX_IP_TOS 1 -#define LINUX_IP_TTL 2 -#define LINUX_IP_HDRINCL 3 -#define LINUX_IP_OPTIONS 4 - -#define LINUX_IP_MULTICAST_IF 32 -#define LINUX_IP_MULTICAST_TTL 33 -#define LINUX_IP_MULTICAST_LOOP 34 -#define LINUX_IP_ADD_MEMBERSHIP 35 -#define LINUX_IP_DROP_MEMBERSHIP 36 - struct l_sockaddr { l_ushort sa_family; char sa_data[14]; Modified: stable/11/sys/amd64/linux32/linux.h ============================================================================== --- stable/11/sys/amd64/linux32/linux.h Sat Apr 15 15:32:22 2017 (r316969) +++ stable/11/sys/amd64/linux32/linux.h Sat Apr 15 15:38:15 2017 (r316970) @@ -474,37 +474,6 @@ union l_semun { l_uintptr_t __pad; } __packed; -/* - * Socket defines - */ -#define LINUX_SOL_SOCKET 1 -#define LINUX_SOL_IP 0 -#define LINUX_SOL_IPX 256 -#define LINUX_SOL_AX25 257 -#define LINUX_SOL_TCP 6 -#define LINUX_SOL_UDP 17 - -#define LINUX_SO_DEBUG 1 -#define LINUX_SO_REUSEADDR 2 -#define LINUX_SO_TYPE 3 -#define LINUX_SO_ERROR 4 -#define LINUX_SO_DONTROUTE 5 -#define LINUX_SO_BROADCAST 6 -#define LINUX_SO_SNDBUF 7 -#define LINUX_SO_RCVBUF 8 -#define LINUX_SO_KEEPALIVE 9 -#define LINUX_SO_OOBINLINE 10 -#define LINUX_SO_NO_CHECK 11 -#define LINUX_SO_PRIORITY 12 -#define LINUX_SO_LINGER 13 -#define LINUX_SO_PEERCRED 17 -#define LINUX_SO_RCVLOWAT 18 -#define LINUX_SO_SNDLOWAT 19 -#define LINUX_SO_RCVTIMEO 20 -#define LINUX_SO_SNDTIMEO 21 -#define LINUX_SO_TIMESTAMP 29 -#define LINUX_SO_ACCEPTCONN 30 - struct l_sockaddr { l_ushort sa_family; char sa_data[14]; Modified: stable/11/sys/compat/linux/linux_socket.h ============================================================================== --- stable/11/sys/compat/linux/linux_socket.h Sat Apr 15 15:32:22 2017 (r316969) +++ stable/11/sys/compat/linux/linux_socket.h Sat Apr 15 15:38:15 2017 (r316970) @@ -172,6 +172,39 @@ int linux_accept(struct thread *td, stru #define LINUX_SENDMMSG 20 #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +/* Socket defines */ +#define LINUX_SOL_SOCKET 1 +#define LINUX_SOL_IP 0 +#define LINUX_SOL_TCP 6 +#define LINUX_SOL_UDP 17 +#define LINUX_SOL_IPV6 41 +#define LINUX_SOL_IPX 256 +#define LINUX_SOL_AX25 257 + +#define LINUX_SO_DEBUG 1 +#define LINUX_SO_REUSEADDR 2 +#define LINUX_SO_TYPE 3 +#define LINUX_SO_ERROR 4 +#define LINUX_SO_DONTROUTE 5 +#define LINUX_SO_BROADCAST 6 +#define LINUX_SO_SNDBUF 7 +#define LINUX_SO_RCVBUF 8 +#define LINUX_SO_KEEPALIVE 9 +#define LINUX_SO_OOBINLINE 10 +#define LINUX_SO_NO_CHECK 11 +#define LINUX_SO_PRIORITY 12 +#define LINUX_SO_LINGER 13 +#ifndef LINUX_SO_PASSCRED /* powerpc differs */ +#define LINUX_SO_PASSCRED 16 +#define LINUX_SO_PEERCRED 17 +#define LINUX_SO_RCVLOWAT 18 +#define LINUX_SO_SNDLOWAT 19 +#define LINUX_SO_RCVTIMEO 20 +#define LINUX_SO_SNDTIMEO 21 +#endif +#define LINUX_SO_TIMESTAMP 29 +#define LINUX_SO_ACCEPTCONN 30 + /* Socket options */ #define LINUX_IP_TOS 1 #define LINUX_IP_TTL 2 Modified: stable/11/sys/i386/linux/linux.h ============================================================================== --- stable/11/sys/i386/linux/linux.h Sat Apr 15 15:32:22 2017 (r316969) +++ stable/11/sys/i386/linux/linux.h Sat Apr 15 15:38:15 2017 (r316970) @@ -453,37 +453,6 @@ union l_semun { void *__pad; }; -/* - * Socket defines - */ -#define LINUX_SOL_SOCKET 1 -#define LINUX_SOL_IP 0 -#define LINUX_SOL_IPX 256 -#define LINUX_SOL_AX25 257 -#define LINUX_SOL_TCP 6 -#define LINUX_SOL_UDP 17 - -#define LINUX_SO_DEBUG 1 -#define LINUX_SO_REUSEADDR 2 -#define LINUX_SO_TYPE 3 -#define LINUX_SO_ERROR 4 -#define LINUX_SO_DONTROUTE 5 -#define LINUX_SO_BROADCAST 6 -#define LINUX_SO_SNDBUF 7 -#define LINUX_SO_RCVBUF 8 -#define LINUX_SO_KEEPALIVE 9 -#define LINUX_SO_OOBINLINE 10 -#define LINUX_SO_NO_CHECK 11 -#define LINUX_SO_PRIORITY 12 -#define LINUX_SO_LINGER 13 -#define LINUX_SO_PEERCRED 17 -#define LINUX_SO_RCVLOWAT 18 -#define LINUX_SO_SNDLOWAT 19 -#define LINUX_SO_RCVTIMEO 20 -#define LINUX_SO_SNDTIMEO 21 -#define LINUX_SO_TIMESTAMP 29 -#define LINUX_SO_ACCEPTCONN 30 - struct l_sockaddr { l_ushort sa_family; char sa_data[14]; From owner-svn-src-all@freebsd.org Sat Apr 15 15:46:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 266D3D3F2FC; Sat, 15 Apr 2017 15:46:59 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E56D15CC; Sat, 15 Apr 2017 15:46:57 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([85.179.171.81]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MAxyW-1crkvh02o0-00A0f0; Sat, 15 Apr 2017 17:46:53 +0200 Date: Sat, 15 Apr 2017 17:46:44 +0200 From: "O. Hartmann" To: Larry Rosenman Cc: Maxim Sobolev , Peter Wemm , src-committers , svn-src-all@freebsd.org, Hiroki Sato , Hiren Panchasara , svn-src-head@freebsd.org, "Ngie Cooper \(yaneurabeya\)" Subject: Re: svn commit: r316874 - head/sys/kern Message-ID: <20170415174533.3dd6349a@thor.intern.walstatt.dynvpn.de> In-Reply-To: <5B7F917E-EA2A-4DB4-B032-48BBBEDD7556@lerctr.org> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <2109294.KVn8xeR1jZ@overcee.wemm.org> <11221477.gRA6BXfcIE@overcee.wemm.org> <5B7F917E-EA2A-4DB4-B032-48BBBEDD7556@lerctr.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/=_F=FZjbc/DcCH9liXt+hz/"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:WzbBZpRDiwEX31fM5Ti3ys1+3ArAhwHkdQ0DpG6aie5anbrDArD ikpWLC4Jop/ZUCfpTrXOp9ovvf/kOQEK5wjDAT6bx1TJig5j0cFOrtQUGQVnLOZ4D01U5T2 ggKKrmqaFWttgS8plDr3Uq6ei8QcrMvS69chRGqivb4tP0qH+ZLQYxpvWSML3iRmsAiRP34 mRXtg1rH9Fmo7oiDEYjoQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:qEocvc8zKEU=:MiQRwnkrofhrV1bfhKWCUU uSZq+UbwLyujli5ua8oHdjMS5OrICHgLjz14hBokUtB9yF8GCkiyZX2sSfgzWY/ANEKoPiTkc F01q0NMFFYnzj7AE5SN8HnjMppQ5syk18kdOxUIOVuRQQsoL+rrAWYbxct4VHVqoVNbcxLySd AojXKXmeCreZczqWGeeFRyu1yw6hy4J13Q3xtzuptTAKFUf71OFh7crinzHYyefns6HHhhYdG 6YLsszujTmgfVe4TfG7WRtH28dF/v/GqyPxFPNhgTzDohwcLRG1yIIePEPCbwV4WW4k6VsfQK BrtBAIBZUTVqHOD1PNWMRU+JET5apCGx25rjnw0t/cFLxRLM4a2IS+/YON7CiQRsIHGrVYVCo sXcoJsfHRyOBCJ9FdpnnnfzOJLkLnpkXeKSuOKvbmTdtWzhElvt962/EOLlxY5q4Ztkf7tNnv FINjA89ynL3hnFRJNzBLp+UL/fT15xqmxAxGTqOa/QrbAQdxwZB9zr7wjEtAK6Hdc6GgbzApF KgQtAmapUAHiE/Bn22pgbsS5XMMzXcgRAOyxo6Sf9vOVz3LeW6C5asELLQOSqQaUH7zAXQMiC esh5u4b7YaXzseZQobMIm0Y7CvY4EaXuKTSyn3UJlbtXPtfBx/PEyGegGna2xtHaMeMhVvKzc p5u42NEPe2gr1nbmi1lEJwl9s2VVD8FvDM9zL0mjy/VndyBi9nUUtpCprLPO+LZNFEdgTFpWt wLCcgwpslyp7BhSJZX87q0zq4HBJXb/XEKeX0Oy8GAWhXsz8whFdSwth2RQ= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:46:59 -0000 --Sig_/=_F=FZjbc/DcCH9liXt+hz/ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am Sat, 15 Apr 2017 08:05:23 -0500 Larry Rosenman schrieb: > On 4/15/17, 6:00 AM, "Maxim Sobolev" sobomax@freebsd.org> wrote: >=20 > Peter, Ngie, none of this stuff is really directly related to the > shutdown(2) change, so I'll probably let Hiroki to clean it up. > =20 > -Max > =20 >=20 > I=E2=80=99ve backed off to my previous root. Is someone working on this?= It=E2=80=99s PAINFUL. >=20 [...] Processes do not even hang when system is booting/spinning up. On my router project, I've running asterisk13 on a small appliance. Startin= g asterisk with "service asterisk start" starts the service, but then, stopping the se= rvice calling "service asterisk stop" reports Asterisk ending (0). but the process is still running as top reveals: PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU CO= MMAN 1352 asterisk 19 52 0 105M 25284K uwrlck 3 17:40 67.94% as= teri [...] This is weird :-( kill -9 1352 works. Finally. Regards, Oliver --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/=_F=FZjbc/DcCH9liXt+hz/ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWPJAZQAKCRDS528fyFhY lE6eAf9pMgModWiBT73rYEwmmSeARwGwL+3icTRsxU3rPpc3ZeOp+GPE0HYZ/nf3 ySmLLkfcjaRPV2rfGAbrIIBTw2JyAf99Da7f6EqyP9UzkZ7Fq/BXdojdho0rurtv EeVweRd+884SMk7ZEtLDKBIhGiur3g+5XV5tGbfpikTMUC3/aL9i =TTw+ -----END PGP SIGNATURE----- --Sig_/=_F=FZjbc/DcCH9liXt+hz/-- From owner-svn-src-all@freebsd.org Sat Apr 15 16:24:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF357D3F336; Sat, 15 Apr 2017 16:24:56 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C18CF636; Sat, 15 Apr 2017 16:24:56 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id c198so18918391pfc.0; Sat, 15 Apr 2017 09:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2yaTR6Gnn19Q6prbALa96dNw2DJuimhXJrBerbJngkA=; b=UAuJbTUg4t/bRt9rAWqxOc7jDH1OvJVZL7UGcsmU+O2ToIOWk+eYVCpoecvl1c7ioV /+TzHH60rG3k2YB6rRPsVBkKYg0WKNynudeH8Bf59UCg4jpoBpUVHMGtm1SqnP7yMMUl tQguPov9I4QFuEoJseB2RzPv0CHcqD4IrPqAEh6Owkq4fWseQZbTjpsdjPY2lG65DDw1 L9eNunnQQ4TezoZHr64uYcU/43Np+E3fjKdvOQkamZpxOR+aWQUf8rQCJpqWK6tOuHct MhbpLqa91wBNXHxN7K2lK+N0O4Ze2V5sLwmy+iDE94T6uaxSjM5Jl/IAHa2EKlbiNKNG dLLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=2yaTR6Gnn19Q6prbALa96dNw2DJuimhXJrBerbJngkA=; b=uXkFnbqPRBY8yOLcLPtgKso2B9JnQlULwXNTUuoJLsCNz/AyVKWKnzbcEDsYzF9vqe aQSJwmoT3S/7n1IQKvF+KVd1TESEfAszcB/h7POWhUhEUPst/kwiY8WagcQ1idXHqLsv dWjhQsxHqGTrzuycabryYUBfgoCRsICywBb4xdnMkZ4d2zE8yyG4OD0+kjSQ/1QTYpIr UKhOWUq/U2RANSOKqnwLFde13tCmav5MqYNuDi5FC8m35PEFtP5QNo5hobyMYYza5YEx W8KgHEFXRenWwnFGBXWx364w2gsqjGfq8ZNj7btVmPynpoKhtaYXMtzunMaAIC3zQSF8 pIoA== X-Gm-Message-State: AN3rC/6lxUFWP/WYFTnXJvtFSSCgfrqqGZivP0W7G4MOGKhvgLFi2qhy j+9OkJQAPSFPZg/lXLc= X-Received: by 10.99.114.80 with SMTP id c16mr3412472pgn.121.1492273496064; Sat, 15 Apr 2017 09:24:56 -0700 (PDT) Received: from raichu ([2604:4080:1102:0:ca60:ff:fe9d:3963]) by smtp.gmail.com with ESMTPSA id g5sm9370012pfe.12.2017.04.15.09.24.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Apr 2017 09:24:55 -0700 (PDT) Sender: Mark Johnston Date: Sat, 15 Apr 2017 09:24:51 -0700 From: Mark Johnston To: rgrimes@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170415162437.GA89653@raichu> References: <20170415053729.GA76139@raichu> <201704150642.v3F6g41p010449@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704150642.v3F6g41p010449@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 16:24:57 -0000 On Fri, Apr 14, 2017 at 11:42:04PM -0700, Rodney W. Grimes wrote: > > On Fri, Apr 14, 2017 at 06:30:17PM -0700, Rodney W. Grimes wrote: > > > > The patch to add compression support is here and should largely still > > > > work: > > > > https://people.freebsd.org/~markj/patches/core-compression/20141110-kern_dump.diff > > > > > > > > I've been hesitant about pushing it forward: > > > > - The dump_write* APIs need some simplification after the addition of > > > > encrypted dump support and support for dumping to 4Kn drives. > > > > - I'm not sure how encryption should compose with compression. It seems > > > > intuitively obvious that we should compress before encrypting if the > > > > compression is to be of any use, but I don't know enough to know > > > > whether the compression might somehow compromise the effectiveness of > > > > the encryption. > > > > > > > > If anyone has some insight on the second of these two points, I'd > > > > appreciate hearing it. > > > > > > I have a large amount of reworking and modulization of the dump code > > > incuding intergration of your (markj) compressed dumps. Layer isnt > > > implemented but is in the plan. I should not of held off on the net > > > dump code as it got smashed by encrypted dumps, then again by > > > the libif'ing for all the Intel drives that had been netdump modified. > > > > > > Basically now starting over :-( > > > > Could you post your patches somewhere? I've been sitting on this (and > > the netdump patches, for which I have quite a few modifications) for far > > too long, and would like to finish them and get them in soon. I'll note > > that the netdump code posted a few years ago had some problems that are > > fixed in Isilon's version, which I'm working on rebasing on HEAD. In > > Isnt the code I rebaed in December to -12 your code from Isiolon???? I don't know exactly what code you're referring to. > Or tell me you handed me your patches to upstream, and then continued > to evolved the code without letting me know? Are YOUR patckes some > place public? I dont think mine are, but I do have a link in > http://people.freebsd.org/~rgrimes pointing to the other Netdump version > that I think is an old version of your code. I haven't changed the compression patch since I posted it a long time ago: https://people.freebsd.org/~markj/patches/core-compression/20141110-kern_dump.diff I've made a fairly large set of changes to the netdump code linked on your page. Some of the changes were motivated by the objections raised to the original set of patches. I currently don't have a working copy of my netdump patches against HEAD, but here are some internal patches: https://people.freebsd.org/~markj/patches/netdump/ A recent revision of the netdumpd code is here: https://github.com/markjdb/netdumpd From owner-svn-src-all@freebsd.org Sat Apr 15 16:29:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1CFBD3F440; Sat, 15 Apr 2017 16:29:05 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E419AAE; Sat, 15 Apr 2017 16:29:05 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id i5so18850881pfc.3; Sat, 15 Apr 2017 09:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YhlFxMVUtSS8ZA3iuignQGEkCC7tEVx1WCCxemmcv0s=; b=hUTCK1TWX4aadTsDkOE8FOA72op7m0dmm6dE7moYdl7FlhqC4FTmw451/NGa54HVe4 zI657lQNHrWhE1QiZsxU96oPRPCKucEFiwtAMpwcXoJUkPZb5ElhO6INJj2JErr1qmXN vY1qyNSKFz4M9X70RFnENL8pllW6GCFNoWrTpe1vUjIUnJmVBRr1eRuwL3gQpCX7Uyiv v4MTsIyrHY/5YK92TQBoe5vhBjU5HUOZAkMrMnzDlTiQJN4oPFiHuA9KiC50ePW9ZWqf k7dEnbHfNQefYQ63Yp5+91WAtFnchqdc2QCdpgG922UIc3CYfwA2/gP/NSXzweuiK5Ta X06A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=YhlFxMVUtSS8ZA3iuignQGEkCC7tEVx1WCCxemmcv0s=; b=mOMQ6GtWcLtbvAAVnOgLcmOakFMZf1dQBIL+A+hC9sS+q8UeQVdJArHwsTwUrmyUbZ 3+64+HMUdcabnYrn1GoAG1MrkaFL7wTyYwkywm73sNpSXBNcE2A+6Dd97NkOLG3pf58F FW2S9hBJjUnI9M2ApUKnS8BzbrXD2FOWT66C6sOoO/E7CpQrDJpkcKcf3b6pXllKg7lm 2U0seLkN4z5z++JqO5+KbxiWGzSiMWoOce6AtwUA6agTL3hZ/tXBhalVJwNSGnoHbNCv ENTQqqRrwjuZRHeibbxRzsh7Hj5Wh59ZNgSpJiNVvroE3ifgrmkaqgLV/4pnntr+R5kx lsKg== X-Gm-Message-State: AN3rC/76sCgywPTXbLObcP9wQ2gV304lWoUw3JZquJ7dFfqw6XHcmEU7 1t3uh7udk+Ictw== X-Received: by 10.99.189.2 with SMTP id a2mr3449645pgf.85.1492273745123; Sat, 15 Apr 2017 09:29:05 -0700 (PDT) Received: from raichu ([2604:4080:1102:0:ca60:ff:fe9d:3963]) by smtp.gmail.com with ESMTPSA id 21sm9340692pfl.129.2017.04.15.09.29.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Apr 2017 09:29:04 -0700 (PDT) Sender: Mark Johnston Date: Sat, 15 Apr 2017 09:29:02 -0700 From: Mark Johnston To: Slawa Olhovchenkov Cc: Xin LI , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers Subject: Re: svn commit: r316938 - head/sbin/savecore Message-ID: <20170415162902.GB89653@raichu> References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414202918.GD5039@wkstn-mjohnston.west.isilon.com> <20170414220525.GF5039@wkstn-mjohnston.west.isilon.com> <20170415083952.GA83631@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170415083952.GA83631@zxy.spb.ru> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 16:29:05 -0000 On Sat, Apr 15, 2017 at 11:39:52AM +0300, Slawa Olhovchenkov wrote: > On Fri, Apr 14, 2017 at 03:05:25PM -0700, Mark Johnston wrote: > > > > And with textdumps available, the benefit > > > of having compression is limited because we can request for minidump > > > or full dumps only when the textdumps are not good enough for > > > diagnosing the kernel bug. > > > > Sure, but in this case the compression may be vital. > > > > > > > > I don't think security (e.g. leaking information because of the use of > > > compression) is a very big concern in this context because in order > > > for the potential attacker to read the raw material needs a > > > compromised system (unlike an attack from the network, where someone > > > who controls the network would have access to the raw material); the > > > dump is usually quite large, and measuring downtime would be hard at > > > that scale. > > > > Ok. > > > > > > > > By the way (not meant to bikeshed) if I was to do this I'd prefer > > > using lz4 or something that compresses faster than zlib. > > > > I agree, but I think the existing lz4 implementation in the kernel is > > not so well suited to running after a panic. It seems fixable, but > > compression speed also isn't hugely important here IMO. > > On production system this is downtime. > For may case, dumped about 32GB (from 256GB RAM). This is take several > minutes. Can compression increase this to hour? It would have to be tested. The compression also speeds up recovery somewhat since fewer bytes need to be transferred from the dump device to a filesystem. I should also point out that the feature implementation is not closely tied to the compression algorithm, which could be changed for something faster later. From owner-svn-src-all@freebsd.org Sat Apr 15 16:48:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A92D3FA7B; Sat, 15 Apr 2017 16:48:48 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A094A2B; Sat, 15 Apr 2017 16:48:48 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (58-7-95-3.dyn.iinet.net.au [58.7.95.3]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v3FGmYJr079447 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 15 Apr 2017 09:48:38 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r316938 - head/sbin/savecore To: Larry Rosenman , "Ngie Cooper (yaneurabeya)" References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> <0CAE4B1C-228B-4C71-86E9-4337753DFF74@lerctr.org> Cc: Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ngie Cooper , Alan Somers From: Julian Elischer Message-ID: Date: Sun, 16 Apr 2017 00:48:28 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 16:48:48 -0000 On 15/4/17 4:37 am, Larry Rosenman wrote: > On 4/14/17, 3:33 PM, "Ngie Cooper (yaneurabeya)" wrote: > > > > On Apr 14, 2017, at 13:26, Larry Rosenman wrote: > > > > On 4/14/17, 3:19 PM, "Ngie Cooper (yaneurabeya)" wrote: > > > >> On Apr 14, 2017, at 13:14, Slawa Olhovchenkov wrote: > >> > >> On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: > >> > >>> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: > >>>> Author: ngie > >>>> Date: Fri Apr 14 19:41:48 2017 > >>>> New Revision: 316938 > >>>> URL: https://svnweb.freebsd.org/changeset/base/316938 > >>>> > >>>> Log: > >>>> savecore: fix space calculation with respect to `minfree` in check_space(..) > >>>> > >>>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the > >>>> representable data to INT_MAX. Check the values received from > >>>> strtoll(3), trimming trailing whitespace off the end to maintain > >>>> POLA. > >>>> - Use `KiB` instead of `kB` when describing free space, total space, > >>>> etc. I am now fully aware of `KiB` being the IEC standard for 1024 > >>>> bytes and `kB` being the IEC standard for 1000 bytes. > >>>> - Store available number of KiB in `available` so it can be more > >>>> easily queried and compared to ensure that there are enough KiB to > >>>> store the dump image on disk. > >>>> - Print out the reserved space on disk, per `minfree`, so end-users > >>>> can troubleshoot why check_space(..) is reporting that there isn't > >>>> enough free space. > >>>> > >>>> MFC after: 7 weeks > >>>> Reviewed by: Anton Rang (earlier diff), cem (earlier diff) > >>>> Tested with: positive/negative cases (see review); make tinderbox > >>>> Sponsored by: Dell EMC Isilon > >>>> Differential Revision: D10379 > >>> > >>> The free space calculation is still uselessly conservative, because it > >>> doesn't account for the fact that core dumps will always be either > >>> spare or compressed. The result is that savecore will frequently > >>> refuse to save corefiles even when there's plenty of space. I > >>> proposed removing the space check altogether in > >>> https://reviews.freebsd.org/D2587. However, I agreed to wait until > >>> after the compressed core dump feature was merged, because then mostly > >>> accurate space checks will be possible. AFAIK the compressed core > >>> dump feature still hasn't been finished. > >> > >> Is posible (in the future) to use multiple swaps (on multiple disks) > >> for save core dumps? > > > > Multiple swap devices is already handled by savecore(8), if one uses fstab(5) or dumpon(8). Otherwise, you must invoke savecore(8) on individual devices. > > > > As far as saving to multiple disks is concerned, I would hope that one is using a redundancy capable filesystem (zfs) or RAID-like technology (gmirror, graid, LSI Fusion’s RAID product line) to stripe and/or mirror the data across multiple disks. > > … > > > How do I use multiple devices to have the system dump on all of my swap? I got a message about not enough space, but there (I think) was enough between multiple drives…. > > Something like: > > - Create a zpool > - Mount zpool to /crashdumps > - Change dumpdir in /etc/rc.conf to be /crashdumps, e.g., echo ‘dumpdir=/crashdumps’ > > ? > HTH, > -Ngie > > PS The issue with lack of space might be the issue that Alan brought up earlier with compressed dumps and overly conservative free space checks, or it might be the fact that dumpdir (default: /var/crash) is full. > > > I was talking about the actual crashdump to swap by the system. /var/crash has 10T of space (my root pool). > > > > > > > PAnzura have kernel changes to allow the dumpdev to be a list of devices and it will write the core dump across the devices in the order specified. It's a bit "private code" quality, but I think we'd be happy to share it if soemone would be interested in polishing it. we have multiple 24G swap devices but 64G of ramso a full dump goes a cross the first 3 devices. We also do both a text dump AND a real dump one after the other. From owner-svn-src-all@freebsd.org Sat Apr 15 16:55:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D947FD3FCC6; Sat, 15 Apr 2017 16:55:47 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CCE9FBF; Sat, 15 Apr 2017 16:55:47 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (58-7-95-3.dyn.iinet.net.au [58.7.95.3]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v3FGh0xj079418 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 15 Apr 2017 09:43:03 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r316938 - head/sbin/savecore To: Slawa Olhovchenkov , Alan Somers References: <201704141941.v3EJfmCW003347@repo.freebsd.org> <20170414201431.GF20974@zxy.spb.ru> Cc: Ngie Cooper , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: Julian Elischer Message-ID: Date: Sun, 16 Apr 2017 00:42:54 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170414201431.GF20974@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 16:55:48 -0000 On 15/4/17 4:14 am, Slawa Olhovchenkov wrote: > On Fri, Apr 14, 2017 at 01:49:51PM -0600, Alan Somers wrote: > >> On Fri, Apr 14, 2017 at 1:41 PM, Ngie Cooper wrote: >>> Author: ngie >>> Date: Fri Apr 14 19:41:48 2017 >>> New Revision: 316938 >>> URL: https://svnweb.freebsd.org/changeset/base/316938 >>> >>> Log: >>> savecore: fix space calculation with respect to `minfree` in check_space(..) >>> >>> - Use strtoll(3) instead of atoi(3), because atoi(3) limits the >>> representable data to INT_MAX. Check the values received from >>> strtoll(3), trimming trailing whitespace off the end to maintain >>> POLA. >>> - Use `KiB` instead of `kB` when describing free space, total space, >>> etc. I am now fully aware of `KiB` being the IEC standard for 1024 >>> bytes and `kB` being the IEC standard for 1000 bytes. >>> - Store available number of KiB in `available` so it can be more >>> easily queried and compared to ensure that there are enough KiB to >>> store the dump image on disk. >>> - Print out the reserved space on disk, per `minfree`, so end-users >>> can troubleshoot why check_space(..) is reporting that there isn't >>> enough free space. >>> >>> MFC after: 7 weeks >>> Reviewed by: Anton Rang (earlier diff), cem (earlier diff) >>> Tested with: positive/negative cases (see review); make tinderbox >>> Sponsored by: Dell EMC Isilon >>> Differential Revision: D10379 >> The free space calculation is still uselessly conservative, because it >> doesn't account for the fact that core dumps will always be either >> spare or compressed. The result is that savecore will frequently >> refuse to save corefiles even when there's plenty of space. I >> proposed removing the space check altogether in >> https://reviews.freebsd.org/D2587. However, I agreed to wait until >> after the compressed core dump feature was merged, because then mostly >> accurate space checks will be possible. AFAIK the compressed core >> dump feature still hasn't been finished. > Is posible (in the future) to use multiple swaps (on multiple disks) > for save core dumps? We ($JOB) already have code that does this. dumpon can be called multiple times and the coredump code will span multiple devices, From owner-svn-src-all@freebsd.org Sat Apr 15 17:00:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A588D3FFF8; Sat, 15 Apr 2017 17:00:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54E70640; Sat, 15 Apr 2017 17:00:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FH0ohI027340; Sat, 15 Apr 2017 17:00:50 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FH0oCd027337; Sat, 15 Apr 2017 17:00:50 GMT (envelope-from np@FreeBSD.org) Message-Id: <201704151700.v3FH0oCd027337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 15 Apr 2017 17:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316971 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 17:00:51 -0000 Author: np Date: Sat Apr 15 17:00:50 2017 New Revision: 316971 URL: https://svnweb.freebsd.org/changeset/base/316971 Log: cxgbe: Add a tunable to configure the SGE time scaler, which is available starting with T6. The values in the timer holdoff registers are multiplied by the scaling factor before use. dev...holdoff_timers shows the final values of the timers in microseconds. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Sat Apr 15 15:38:15 2017 (r316970) +++ head/sys/dev/cxgbe/common/common.h Sat Apr 15 17:00:50 2017 (r316971) @@ -210,7 +210,7 @@ struct tp_rdma_stats { }; struct sge_params { - int timer_val[SGE_NTIMERS]; + int timer_val[SGE_NTIMERS]; /* final, scaled values */ int counter_val[SGE_NCOUNTERS]; int fl_starve_threshold; int fl_starve_threshold2; Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sat Apr 15 15:38:15 2017 (r316970) +++ head/sys/dev/cxgbe/common/t4_hw.c Sat Apr 15 17:00:50 2017 (r316971) @@ -7907,7 +7907,7 @@ int t4_init_sge_params(struct adapter *a { u32 r; struct sge_params *sp = &adapter->params.sge; - unsigned i; + unsigned i, tscale = 1; r = t4_read_reg(adapter, A_SGE_INGRESS_RX_THRESHOLD); sp->counter_val[0] = G_THRESHOLD_0(r); @@ -7915,15 +7915,24 @@ int t4_init_sge_params(struct adapter *a sp->counter_val[2] = G_THRESHOLD_2(r); sp->counter_val[3] = G_THRESHOLD_3(r); + if (chip_id(adapter) >= CHELSIO_T6) { + r = t4_read_reg(adapter, A_SGE_ITP_CONTROL); + tscale = G_TSCALE(r); + if (tscale == 0) + tscale = 1; + else + tscale += 2; + } + r = t4_read_reg(adapter, A_SGE_TIMER_VALUE_0_AND_1); - sp->timer_val[0] = core_ticks_to_us(adapter, G_TIMERVALUE0(r)); - sp->timer_val[1] = core_ticks_to_us(adapter, G_TIMERVALUE1(r)); + sp->timer_val[0] = core_ticks_to_us(adapter, G_TIMERVALUE0(r)) * tscale; + sp->timer_val[1] = core_ticks_to_us(adapter, G_TIMERVALUE1(r)) * tscale; r = t4_read_reg(adapter, A_SGE_TIMER_VALUE_2_AND_3); - sp->timer_val[2] = core_ticks_to_us(adapter, G_TIMERVALUE2(r)); - sp->timer_val[3] = core_ticks_to_us(adapter, G_TIMERVALUE3(r)); + sp->timer_val[2] = core_ticks_to_us(adapter, G_TIMERVALUE2(r)) * tscale; + sp->timer_val[3] = core_ticks_to_us(adapter, G_TIMERVALUE3(r)) * tscale; r = t4_read_reg(adapter, A_SGE_TIMER_VALUE_4_AND_5); - sp->timer_val[4] = core_ticks_to_us(adapter, G_TIMERVALUE4(r)); - sp->timer_val[5] = core_ticks_to_us(adapter, G_TIMERVALUE5(r)); + sp->timer_val[4] = core_ticks_to_us(adapter, G_TIMERVALUE4(r)) * tscale; + sp->timer_val[5] = core_ticks_to_us(adapter, G_TIMERVALUE5(r)) * tscale; r = t4_read_reg(adapter, A_SGE_CONM_CTRL); sp->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Apr 15 15:38:15 2017 (r316970) +++ head/sys/dev/cxgbe/t4_sge.c Sat Apr 15 17:00:50 2017 (r316971) @@ -150,6 +150,13 @@ TUNABLE_INT("hw.cxgbe.largest_rx_cluster static int safest_rx_cluster = PAGE_SIZE; TUNABLE_INT("hw.cxgbe.safest_rx_cluster", &safest_rx_cluster); +/* + * The interrupt holdoff timers are multiplied by this value on T6+. + * 1 and 3-17 (both inclusive) are legal values. + */ +static int tscale = 1; +TUNABLE_INT("hw.cxgbe.tscale", &tscale); + struct txpkts { u_int wr_type; /* type 0 or type 1 */ u_int npkt; /* # of packets in this work request */ @@ -391,6 +398,12 @@ t4_sge_modload(void) cong_drop = 0; } + if (tscale != 1 && (tscale < 3 || tscale > 17)) { + printf("Invalid hw.cxgbe.tscale value (%d)," + " using 1 instead.\n", tscale); + tscale = 1; + } + extfree_refs = counter_u64_alloc(M_WAITOK); extfree_rels = counter_u64_alloc(M_WAITOK); counter_u64_zero(extfree_refs); @@ -583,6 +596,15 @@ t4_tweak_chip_settings(struct adapter *s V_TIMERVALUE5(us_to_core_ticks(sc, intr_timer[5])); t4_write_reg(sc, A_SGE_TIMER_VALUE_4_AND_5, v); + if (chip_id(sc) >= CHELSIO_T6) { + m = V_TSCALE(M_TSCALE); + if (tscale == 1) + v = 0; + else + v = V_TSCALE(tscale - 2); + t4_set_reg_field(sc, A_SGE_ITP_CONTROL, m, v); + } + /* 4K, 16K, 64K, 256K DDP "page sizes" for TDDP */ v = V_HPZ0(0) | V_HPZ1(2) | V_HPZ2(4) | V_HPZ3(6); t4_write_reg(sc, A_ULP_RX_TDDP_PSZ, v); From owner-svn-src-all@freebsd.org Sat Apr 15 17:02:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE5C4D3E4BD; Sat, 15 Apr 2017 17:02:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80703BBE; Sat, 15 Apr 2017 17:02:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FH2WvX029053; Sat, 15 Apr 2017 17:02:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FH2W3j029052; Sat, 15 Apr 2017 17:02:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704151702.v3FH2W3j029052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 15 Apr 2017 17:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316972 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 17:02:33 -0000 Author: ian Date: Sat Apr 15 17:02:32 2017 New Revision: 316972 URL: https://svnweb.freebsd.org/changeset/base/316972 Log: Add support for the imx6ul SoC. Modified: head/sys/arm/freescale/imx/imx_gpt.c Modified: head/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpt.c Sat Apr 15 17:00:50 2017 (r316971) +++ head/sys/arm/freescale/imx/imx_gpt.c Sat Apr 15 17:02:32 2017 (r316972) @@ -118,6 +118,7 @@ static struct resource_spec imx_gpt_spec static struct ofw_compat_data compat_data[] = { {"fsl,imx6dl-gpt", 1}, {"fsl,imx6q-gpt", 1}, + {"fsl,imx6ul-gpt", 1}, {"fsl,imx53-gpt", 1}, {"fsl,imx51-gpt", 1}, {"fsl,imx31-gpt", 1}, @@ -133,6 +134,15 @@ imx_gpt_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); + /* + * We only support a single unit, because the only thing this driver + * does with the complex timer hardware is supply the system + * timecounter and eventtimer. There is nothing useful we can do with + * the additional device instances that exist in some chips. + */ + if (device_get_unit(dev) > 0) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { device_set_desc(dev, "Freescale i.MX GPT timer"); return (BUS_PROBE_DEFAULT); From owner-svn-src-all@freebsd.org Sat Apr 15 17:03:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C3B3D3E56D; Sat, 15 Apr 2017 17:03:17 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A79DD0B; Sat, 15 Apr 2017 17:03:16 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (58-7-95-3.dyn.iinet.net.au [58.7.95.3]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v3FH3AXw079539 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 15 Apr 2017 10:03:13 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r316930 - vendor-sys/illumos/dist/uts/common/fs/zfs To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org References: <201704141843.v3EIhAA2079997@repo.freebsd.org> From: Julian Elischer Message-ID: Date: Sun, 16 Apr 2017 01:03:04 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201704141843.v3EIhAA2079997@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 17:03:17 -0000 MFCs to 11 and 10 for all this stuff you've done? On 15/4/17 2:43 am, Andriy Gapon wrote: > Author: avg > Date: Fri Apr 14 18:43:10 2017 > New Revision: 316930 > URL: https://svnweb.freebsd.org/changeset/base/316930 > > Log: > 5814 bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. > > illumos/illumos-gate@b67dde11a73a9455d641403cbbb65ec2add41b41 > https://github.com/illumos/illumos-gate/commit/b67dde11a73a9455d641403cbbb65ec2add41b41 > > https://www.illumos.org/issues/5814 > Lets pull in this patch from freebsd: > http://svnweb.freebsd.org/base?view=revision&revision=271781 > bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. > If bpobj_space() returned non-zero here, the sublist would have been > left open, along with the bonus buffer hold it requires. This call > does not invoke any calls to bpobj_close() itself. > This bug doesn't have any known vector, but was found on inspection. > MFC after: 1 week > Sponsored by: Spectra Logic > Affects: All ZFS versions starting 21 May 2010 (illumos cde58dbc) > MFSpectraBSD: r1050998 on 2014/03/26 > Fix bpobj_iterate_impl() to properly call bpobj_close() if bpobj_space() > returns an error. > > Reviewed by: Prakash Surya > Reviewed by: Matthew Ahrens > Reviewed by: Paul Dagnelie > Reviewed by: Simon Klinkert > Approved by: Gordon Ross > Author: Will Andrews > > Modified: > vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c > > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c > ============================================================================== > --- vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Fri Apr 14 18:41:37 2017 (r316929) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Fri Apr 14 18:43:10 2017 (r316930) > @@ -301,8 +301,10 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_i > if (free) { > err = bpobj_space(&sublist, > &used_before, &comp_before, &uncomp_before); > - if (err) > + if (err != 0) { > + bpobj_close(&sublist); > break; > + } > } > err = bpobj_iterate_impl(&sublist, func, arg, tx, free); > if (free) { > > From owner-svn-src-all@freebsd.org Sat Apr 15 17:43:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39AE9D3F31D; Sat, 15 Apr 2017 17:43:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D33586C7; Sat, 15 Apr 2017 17:43:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA13764; Sat, 15 Apr 2017 20:43:29 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1czRjN-000GqS-OH; Sat, 15 Apr 2017 20:43:29 +0300 Subject: Re: svn commit: r316930 - vendor-sys/illumos/dist/uts/common/fs/zfs To: Julian Elischer , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-vendor@FreeBSD.org References: <201704141843.v3EIhAA2079997@repo.freebsd.org> From: Andriy Gapon Message-ID: Date: Sat, 15 Apr 2017 20:42:33 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 17:43:42 -0000 On 15/04/2017 20:03, Julian Elischer wrote: > MFCs to 11 and 10 for all this stuff you've done? Come on, it's not even in head yet! Seriously, any help with that would be greatly appreciated. > On 15/4/17 2:43 am, Andriy Gapon wrote: >> Author: avg >> Date: Fri Apr 14 18:43:10 2017 >> New Revision: 316930 >> URL: https://svnweb.freebsd.org/changeset/base/316930 >> >> Log: >> 5814 bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. >> illumos/illumos-gate@b67dde11a73a9455d641403cbbb65ec2add41b41 >> >> https://github.com/illumos/illumos-gate/commit/b67dde11a73a9455d641403cbbb65ec2add41b41 >> >> https://www.illumos.org/issues/5814 >> Lets pull in this patch from freebsd: >> http://svnweb.freebsd.org/base?view=revision&revision=271781 >> bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. >> If bpobj_space() returned non-zero here, the sublist would have been >> left open, along with the bonus buffer hold it requires. This call >> does not invoke any calls to bpobj_close() itself. >> This bug doesn't have any known vector, but was found on inspection. >> MFC after: 1 week >> Sponsored by: Spectra Logic >> Affects: All ZFS versions starting 21 May 2010 (illumos cde58dbc) >> MFSpectraBSD: r1050998 on 2014/03/26 >> Fix bpobj_iterate_impl() to properly call bpobj_close() if bpobj_space() >> returns an error. >> Reviewed by: Prakash Surya >> Reviewed by: Matthew Ahrens >> Reviewed by: Paul Dagnelie >> Reviewed by: Simon Klinkert >> Approved by: Gordon Ross >> Author: Will Andrews >> >> Modified: >> vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c >> >> Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c >> ============================================================================== >> --- vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Fri Apr 14 18:41:37 >> 2017 (r316929) >> +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Fri Apr 14 18:43:10 >> 2017 (r316930) >> @@ -301,8 +301,10 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_i >> if (free) { >> err = bpobj_space(&sublist, >> &used_before, &comp_before, &uncomp_before); >> - if (err) >> + if (err != 0) { >> + bpobj_close(&sublist); >> break; >> + } >> } >> err = bpobj_iterate_impl(&sublist, func, arg, tx, free); >> if (free) { >> >> > -- Andriy Gapon From owner-svn-src-all@freebsd.org Sat Apr 15 18:20:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6238ED3FFAE; Sat, 15 Apr 2017 18:20:12 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 344501C62; Sat, 15 Apr 2017 18:20:12 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FIKBDW057771; Sat, 15 Apr 2017 18:20:11 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FIKBhM057770; Sat, 15 Apr 2017 18:20:11 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201704151820.v3FIKBhM057770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 15 Apr 2017 18:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316973 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 18:20:12 -0000 Author: sobomax Date: Sat Apr 15 18:20:11 2017 New Revision: 316973 URL: https://svnweb.freebsd.org/changeset/base/316973 Log: Fix another logic bug that came out of recent syslogd refactoring and exposed by the r316874: don't call shutdown(2) on all sockets, but only net ones, which seems to be the behaviour existed before that refactoring. Also don't call listen(2) in datagram sockets and fix misplaced debug messages while I am here. Reported by: peter Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Apr 15 17:02:32 2017 (r316972) +++ head/usr.sbin/syslogd/syslogd.c Sat Apr 15 18:20:11 2017 (r316973) @@ -3003,10 +3003,14 @@ socksetup(struct peer *pe) continue; } dprintf("new socket fd is %d\n", s); - listen(s, 5); + if (res->ai_socktype != SOCK_DGRAM) { + listen(s, 5); + } sl_recv = socklist_recv_sock; - dprintf("shutdown\n"); - if (SecureMode || res->ai_family == AF_LOCAL) { +#if defined(INET) || defined(INET6) + if (SecureMode && (res->ai_family == AF_INET || + res->ai_family == AF_INET6)) { + dprintf("shutdown\n"); /* Forbid communication in secure mode. */ if (shutdown(s, SHUT_RD) < 0 && errno != ENOTCONN) { @@ -3014,10 +3018,11 @@ socksetup(struct peer *pe) if (!Debug) die(0); } - dprintf("listening on socket\n"); sl_recv = NULL; } else - dprintf("sending on socket\n"); +#endif + dprintf("listening on socket\n"); + dprintf("sending on socket\n"); addsock(res->ai_addr, res->ai_addrlen, &(struct socklist){ .sl_socket = s, From owner-svn-src-all@freebsd.org Sat Apr 15 18:22:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32508D3F169 for ; Sat, 15 Apr 2017 18:22:42 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA5EEA8 for ; Sat, 15 Apr 2017 18:22:41 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-it0-x22a.google.com with SMTP id 70so8685769ita.0 for ; Sat, 15 Apr 2017 11:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=DLozSrGsXwdyk/MqJmwDFqPw9dg5VIzq8jG/L5FGoms=; b=kNOF65J3tOGwL2kJSDlPQu4qCzYLnfN5eUv45DixJoiSfKvRsSlIB8QKaKij1XzjLD R64OQ8Kl9omKvOTtsMGv3YdW9dWVU3tQlJ6bdMuU8fUL/+bdyeSc/9tmqlLhhOlLDYrp 75ZZl72rQbYQ9JXOu/KJ01l/WLrnsbuNne5GAOe3g1r7ZXwQP9WoiMo7oKlJf0A6igBA hK8hEZEJ2dsbJukMZpnMVBjDOKes3fDwMBjkDN4O25pCp8bWxik83g5zpyIAyiK+h4AQ a7hTcgo6Cvi9sDC76IpXePoumH4G1sQoG+z1rwBDdpdPIj0yx3mg0WlBiy2PAqJEcQUS cMZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=DLozSrGsXwdyk/MqJmwDFqPw9dg5VIzq8jG/L5FGoms=; b=rqCetWsI/1zT8QLMTqG93jFnb5hlBhVvEOowT7HsZ9CJeo/anmF3obihGQ5bcM2aWd ScH7YcyEo97N2OtGdgLyHe4z+JqUK2I4RrbC1eGOOYk+c+syMhJeWIcTmJ8exKWiQM1R Fz66yUj0fs/+Y7YH9oCbxnbMA2HI2DEgFfOjyMvA7y4T8FzA4VLhCgE6XQtIQhfFeJ0r aK6QMvDdv8v0xXVkgnA9tVTzP+ba5hAec+RjeHBbW7MtPYQMChE2dE7g45kJzzqs4H++ oNLs6ZgD7UiObk6WQLkINNycAIU6XZHqbFJv1TNnBsoRZBjlxa8KA75My35rK5ErsH0s aohA== X-Gm-Message-State: AN3rC/62/+c6YH3+JS0P/zx6MhVN+B2i8I+9YCuW2N3/GGj0obENZ+bU h3oMH/yeLrykGLjKw1/tBzG3sHiWyUoW X-Received: by 10.36.85.148 with SMTP id e142mr3941743itb.106.1492280561297; Sat, 15 Apr 2017 11:22:41 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.104.135 with HTTP; Sat, 15 Apr 2017 11:22:40 -0700 (PDT) In-Reply-To: <20170415174533.3dd6349a@thor.intern.walstatt.dynvpn.de> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <2109294.KVn8xeR1jZ@overcee.wemm.org> <11221477.gRA6BXfcIE@overcee.wemm.org> <5B7F917E-EA2A-4DB4-B032-48BBBEDD7556@lerctr.org> <20170415174533.3dd6349a@thor.intern.walstatt.dynvpn.de> From: Maxim Sobolev Date: Sat, 15 Apr 2017 11:22:40 -0700 X-Google-Sender-Auth: i4VUea8Gc_FzFWXmaK8nFNDdxTk Message-ID: Subject: Re: svn commit: r316874 - head/sys/kern To: "O. Hartmann" Cc: Larry Rosenman , Peter Wemm , src-committers , svn-src-all@freebsd.org, Hiroki Sato , Hiren Panchasara , svn-src-head@freebsd.org, "Ngie Cooper (yaneurabeya)" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 18:22:42 -0000 I've committed another fix for the syslogd code in question which should hopefully make it functional again. Peter, please let me know if you still having any issues. Thanks! -Max On Sat, Apr 15, 2017 at 8:46 AM, O. Hartmann wrote= : > Am Sat, 15 Apr 2017 08:05:23 -0500 > Larry Rosenman schrieb: > > > On 4/15/17, 6:00 AM, "Maxim Sobolev" behalf of > > sobomax@freebsd.org> wrote: > > > > Peter, Ngie, none of this stuff is really directly related to the > > shutdown(2) change, so I'll probably let Hiroki to clean it up. > > > > -Max > > > > > > I=E2=80=99ve backed off to my previous root. Is someone working on thi= s? It=E2=80=99s > PAINFUL. > > > [...] > > Processes do not even hang when system is booting/spinning up. > > On my router project, I've running asterisk13 on a small appliance. > Starting asterisk > with "service asterisk start" starts the service, but then, stopping the > service calling > "service asterisk stop" reports > > Asterisk ending (0). > > but the process is still running as top reveals: > > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU > COMMAN > 1352 asterisk 19 52 0 105M 25284K uwrlck 3 17:40 67.94% > asteri > [...] > > This is weird :-( > > kill -9 1352 works. Finally. > > Regards, > Oliver > -- > O. Hartmann > > Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr > Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Ab= s. 4 BDSG). > From owner-svn-src-all@freebsd.org Sat Apr 15 19:17:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C85CD3F372; Sat, 15 Apr 2017 19:17:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D105BF5; Sat, 15 Apr 2017 19:17:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3FJHGs3013258; Sat, 15 Apr 2017 12:17:16 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3FJHGSf013257; Sat, 15 Apr 2017 12:17:16 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704151917.v3FJHGSf013257@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <1774031.vuxxQt1GW8@ralph.baldwin.cx> To: John Baldwin Date: Sat, 15 Apr 2017 12:17:16 -0700 (PDT) CC: "Ngie Cooper (yaneurabeya)" , src-committers , rgrimes@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 19:17:20 -0000 > On Friday, April 14, 2017 07:40:57 PM Ngie Cooper wrote: > > > > > On Apr 14, 2017, at 18:49, Rodney W. Grimes wrote: > > > Do we use KiB, MiB, GiB,... any place else in the system? I cant think of > > > a place we do this, so please, lets not start doing this here? > > The du manpage does at least. Should that be reverted? My 5.4p8 man pages does not have any IEC units in it. Doesnt du -h print stuff in none IEC units, so this is kinda a man page vs actual code error. Oh wait, it is more errorful than that, using -h leaves off units and only prints scale of K/M/G/... and not KB/MB/GB :-(. > > humanize_number(3) from libutil uses IEC units. > > Note that it is optional though. You can use flags to decide what you want > and the default is to not use IEC. ls -h uses humanize_number but not with > IEC units. In particular, there are flags to control the scaling and > prefixes used: HN_DIVISOR_1000 and HN_IEC_PREFIXES. The default is to use > power-of-2 scaling with non-IEC prefixes (so KB == 1024 by default). > Currently nothing in base uses HN_IEC_PREFIXES. > > (I see you already reverted the printf, just wanted to point out that the > humanize_number behavior is configurable.) Yes, and it would be nice to round out this functional set fixing its lack of uint64_t support, fixing all the things Bruce pointed out and then to start using it. Oh, and probably add an environment control to get either IEC or non IEC and scale either 1024 or 1000. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 15 19:22:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B9FDD3F8AA; Sat, 15 Apr 2017 19:22:59 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D34E0152; Sat, 15 Apr 2017 19:22:58 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-type:Mime-version:In-Reply-To:References:Message-ID:CC: To:From:Subject:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=wP+DciefGgj4xRkt1sCRhDaoO4v7NvYvYXVVGjXYMGY=; b=DubvvxJHGUPagU6ZQgagDm5C9o 4lpEoR238CwWgIN0OlscPbtAUPAMS/BsQbcvl5Gnl+qjkcWUvtRJUZGXTlZ8gQgI79GwzlUTF8yHX +//rrVhgSoM4PdC3iCrJjRY8pEn4o1eC0+jjNIeKvy3DA5qvoBRHq6kSlKYqXAsqhnOc=; Received: from [47.220.164.50] (port=64281 helo=[192.168.200.198]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1czTHd-0009Y5-P5; Sat, 15 Apr 2017 14:22:57 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Sat, 15 Apr 2017 14:22:57 -0500 Subject: Re: svn commit: r316874 - head/sys/kern From: Larry Rosenman To: Maxim Sobolev , "O. Hartmann" CC: Peter Wemm , src-committers , , Hiroki Sato , Hiren Panchasara , , "Ngie Cooper (yaneurabeya)" Message-ID: <04DD11C2-A001-49C8-A91F-7B4119CAD16A@lerctr.org> Thread-Topic: svn commit: r316874 - head/sys/kern References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <2109294.KVn8xeR1jZ@overcee.wemm.org> <11221477.gRA6BXfcIE@overcee.wemm.org> <5B7F917E-EA2A-4DB4-B032-48BBBEDD7556@lerctr.org> <20170415174533.3dd6349a@thor.intern.walstatt.dynvpn.de> In-Reply-To: Mime-version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 19:22:59 -0000 This looks MUCH better, startup was it=E2=80=99s usual speedy self. =20 =20 --=20 Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281 =20 =20 =20 From: Maksym Sobolyev on behalf of Maxim Sobolev Date: Saturday, April 15, 2017 at 1:22 PM To: "O. Hartmann" Cc: Larry Rosenman , Peter Wemm , src-commi= tters , , Hiroki Sato <= hrs@freebsd.org>, Hiren Panchasara , , Ngie Cooper Subject: Re: svn commit: r316874 - head/sys/kern =20 I've committed another fix for the syslogd code in question which should ho= pefully make it functional again. Peter, please let me know if you still hav= ing any issues. Thanks! =20 -Max =20 On Sat, Apr 15, 2017 at 8:46 AM, O. Hartmann wrote= : Am Sat, 15 Apr 2017 08:05:23 -0500 Larry Rosenman schrieb: > On 4/15/17, 6:00 AM, "Maxim Sobolev" sobomax@freebsd.org> wrote: > > Peter, Ngie, none of this stuff is really directly related to the > shutdown(2) change, so I'll probably let Hiroki to clean it up. > > -Max > > > I=E2=80=99ve backed off to my previous root. Is someone working on this? It=E2=80= =99s PAINFUL. > [...] Processes do not even hang when system is booting/spinning up. On my router project, I've running asterisk13 on a small appliance. Startin= g asterisk with "service asterisk start" starts the service, but then, stopping the se= rvice calling "service asterisk stop" reports Asterisk ending (0). but the process is still running as top reveals: PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU CO= MMAN 1352 asterisk 19 52 0 105M 25284K uwrlck 3 17:40 67.94% as= teri [...] This is weird :-( kill -9 1352 works. Finally. Regards, Oliver -- O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs. 4 BDSG)= . =20 From owner-svn-src-all@freebsd.org Sat Apr 15 19:27:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E065D3FB16; Sat, 15 Apr 2017 19:27:40 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 788327D2; Sat, 15 Apr 2017 19:27:40 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FJRdSc085772; Sat, 15 Apr 2017 19:27:39 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FJRdiu085771; Sat, 15 Apr 2017 19:27:39 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704151927.v3FJRdiu085771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sat, 15 Apr 2017 19:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316974 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 19:27:40 -0000 Author: bde Date: Sat Apr 15 19:27:39 2017 New Revision: 316974 URL: https://svnweb.freebsd.org/changeset/base/316974 Log: Structure the mouse cursor data so that it is easier to switch, and access it via pointers (still to only 1 instance, now with a less generic name). Restructure the "and" and "or" masks as border and interior masks (where the "and" mask was for the union of the border and the interior). "and" and "or" were only a detail in a not very good implementation, and after fixing that the union was only used to calculate the border at runtime. Use the metric data in more places to clip to active pixels earlier. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Sat Apr 15 18:20:11 2017 (r316973) +++ head/sys/dev/syscons/scvgarndr.c Sat Apr 15 19:27:39 2017 (r316974) @@ -159,15 +159,19 @@ RENDERER_MODULE(vga, vga_set); #ifndef SC_NO_CUTPASTE #if !defined(SC_ALT_MOUSE_IMAGE) || defined(SC_PIXEL_MODE) -#define MOUSE_IMAGE_HEIGHT 13 -#define MOUSE_IMAGE_WIDTH 9 -static u_short mouse_and_mask[16] = { - 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, - 0xfe00, 0x1e00, 0x1f00, 0x0f00, 0x0f00, 0x0000, 0x0000, 0x0000 +struct mousedata { + u_short md_border[16]; + u_short md_interior[16]; + u_short md_width; + u_short md_height; }; -static u_short mouse_or_mask[16] = { + +static const struct mousedata mouse9x13 = { { + 0xc000, 0xa000, 0x9000, 0x8800, 0x8400, 0x8200, 0x8100, 0x9780, + 0xf200, 0x1200, 0x1900, 0x0900, 0x0f00, 0x0000, 0x0000, 0x0000, }, { 0x0000, 0x4000, 0x6000, 0x7000, 0x7800, 0x7c00, 0x7e00, 0x6800, - 0x0c00, 0x0c00, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000 + 0x0c00, 0x0c00, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, }, + 9, 13, }; #endif #endif @@ -404,6 +408,7 @@ draw_txtmouse(scr_stat *scp, int x, int { #ifndef SC_ALT_MOUSE_IMAGE if (ISMOUSEAVAIL(scp->sc->adp->va_flags)) { + const struct mousedata *mdp; u_char font_buf[128]; u_short cursor[32]; u_char c; @@ -412,6 +417,8 @@ draw_txtmouse(scr_stat *scp, int x, int int crtc_addr; int i; + mdp = &mouse9x13; + /* prepare mousepointer char's bitmaps */ pos = (y/scp->font_size - scp->yoff)*scp->xsize + x/8 - scp->xoff; bcopy(scp->font + sc_vtb_getc(&scp->scr, pos)*scp->font_size, @@ -434,8 +441,8 @@ draw_txtmouse(scr_stat *scp, int x, int yoffset = y%scp->font_size; for (i = 0; i < 16; ++i) { cursor[i + yoffset] = - (cursor[i + yoffset] & ~(mouse_and_mask[i] >> xoffset)) - | (mouse_or_mask[i] >> xoffset); + (cursor[i + yoffset] & ~(mdp->md_border[i] >> xoffset)) + | (mdp->md_interior[i] >> xoffset); } for (i = 0; i < scp->font_size; ++i) { font_buf[i] = (cursor[i] & 0xff00) >> 8; @@ -1026,6 +1033,7 @@ vga_pxlblink_planar(scr_stat *scp, int a static void draw_pxlmouse_planar(scr_stat *scp, int x, int y) { + const struct mousedata *mdp; vm_offset_t p; int line_width; int xoff, yoff; @@ -1034,10 +1042,11 @@ draw_pxlmouse_planar(scr_stat *scp, int int i, j, k; uint8_t m1; + mdp = &mouse9x13; line_width = scp->sc->adp->va_line_width; xoff = (x - scp->xoff*8)%8; yoff = y - rounddown(y, line_width); - ymax = imin(y + 16, scp->ypixel); + ymax = imin(y + mdp->md_height, scp->ypixel); outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0001); /* set/reset enable */ @@ -1045,7 +1054,7 @@ draw_pxlmouse_planar(scr_stat *scp, int outw(GDCIDX, 0x0803); /* data rotate/function select (and) */ p = scp->sc->adp->va_window + line_width*y + x/8; for (i = y, j = 0; i < ymax; ++i, ++j) { - m = ~((mouse_and_mask[j] & ~mouse_or_mask[j]) << 8 >> xoff); + m = ~(mdp->md_border[j] << 8 >> xoff); for (k = 0; k < 3; ++k) { m1 = m >> (8 * (2 - k)); if (m1 != 0xff && x + 8 * k < scp->xpixel) { @@ -1058,7 +1067,7 @@ draw_pxlmouse_planar(scr_stat *scp, int outw(GDCIDX, 0x1003); /* data rotate/function select (or) */ p = scp->sc->adp->va_window + line_width*y + x/8; for (i = y, j = 0; i < ymax; ++i, ++j) { - m = mouse_or_mask[j] << 8 >> xoff; + m = mdp->md_interior[j] << 8 >> xoff; for (k = 0; k < 3; ++k) { m1 = m >> (8 * (2 - k)); if (m1 != 0 && x + 8 * k < scp->xpixel) { @@ -1074,17 +1083,20 @@ draw_pxlmouse_planar(scr_stat *scp, int static void remove_pxlmouse_planar(scr_stat *scp, int x, int y) { + const struct mousedata *mdp; vm_offset_t p; int bx, by, i, line_width, xend, xoff, yend, yoff; + mdp = &mouse9x13; + /* * It is only necessary to remove the mouse image where it overlaps * the border. Determine the overlap, and do nothing if it is empty. */ bx = (scp->xoff + scp->xsize) * 8; by = (scp->yoff + scp->ysize) * scp->font_size; - xend = imin(x + MOUSE_IMAGE_WIDTH, scp->xpixel); - yend = imin(y + MOUSE_IMAGE_HEIGHT, scp->ypixel); + xend = imin(x + mdp->md_width, scp->xpixel); + yend = imin(y + mdp->md_height, scp->ypixel); if (xend <= bx && yend <= by) return; @@ -1108,6 +1120,7 @@ remove_pxlmouse_planar(scr_stat *scp, in static void vga_pxlmouse_direct(scr_stat *scp, int x, int y, int on) { + const struct mousedata *mdp; vm_offset_t p; int line_width, pixel_size; int xend, yend; @@ -1119,12 +1132,14 @@ vga_pxlmouse_direct(scr_stat *scp, int x uint8_t *u8; int bpp; + mdp = &mouse9x13; + /* * Determine overlap with the border and then if removing, do nothing * if the overlap is empty. */ - xend = imin(x + 16, scp->xpixel); - yend = imin(y + 16, scp->ypixel); + xend = imin(x + mdp->md_width, scp->xpixel); + yend = imin(y + mdp->md_height, scp->ypixel); if (!on && xend <= (scp->xoff + scp->xsize) * 8 && yend <= (scp->yoff + scp->ysize) * scp->font_size) return; @@ -1184,33 +1199,33 @@ do_on: case 32: u32 = (uint32_t*)(p + j * pixel_size); mouse_buf32[i * 16 + j] = *u32; - if (mouse_or_mask[i] & (1 << (15 - j))) + if (mdp->md_interior[i] & (1 << (15 - j))) writel(u32, vga_palette32[15]); - else if (mouse_and_mask[i] & (1 << (15 - j))) + else if (mdp->md_border[i] & (1 << (15 - j))) writel(u32, 0); break; case 16: u16 = (uint16_t*)(p + j * pixel_size); mouse_buf16[i * 16 + j] = *u16; - if (mouse_or_mask[i] & (1 << (15 - j))) + if (mdp->md_interior[i] & (1 << (15 - j))) writew(u16, vga_palette16[15]); - else if (mouse_and_mask[i] & (1 << (15 - j))) + else if (mdp->md_border[i] & (1 << (15 - j))) writew(u16, 0); break; case 15: u16 = (uint16_t*)(p + j * pixel_size); mouse_buf16[i * 16 + j] = *u16; - if (mouse_or_mask[i] & (1 << (15 - j))) + if (mdp->md_interior[i] & (1 << (15 - j))) writew(u16, vga_palette15[15]); - else if (mouse_and_mask[i] & (1 << (15 - j))) + else if (mdp->md_border[i] & (1 << (15 - j))) writew(u16, 0); break; case 8: u8 = (uint8_t*)(p + j * pixel_size); mouse_buf8[i * 16 + j] = *u8; - if (mouse_or_mask[i] & (1 << (15 - j))) + if (mdp->md_interior[i] & (1 << (15 - j))) writeb(u8, 15); - else if (mouse_and_mask[i] & (1 << (15 - j))) + else if (mdp->md_border[i] & (1 << (15 - j))) writeb(u8, 0); break; } From owner-svn-src-all@freebsd.org Sat Apr 15 19:47:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 970F2D3F0A7; Sat, 15 Apr 2017 19:47:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 318CAE5A; Sat, 15 Apr 2017 19:47:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FJlIZK094459; Sat, 15 Apr 2017 19:47:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FJlHl4094446; Sat, 15 Apr 2017 19:47:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704151947.v3FJlHl4094446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 19:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316975 - in vendor/zstd: . dist dist/build dist/build/VS2005 dist/build/VS2005/fullbench dist/build/VS2005/fuzzer dist/build/VS2005/zstd dist/build/VS2005/zstdlib dist/build/VS2008 dis... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 19:47:19 -0000 Author: bapt Date: Sat Apr 15 19:47:16 2017 New Revision: 316975 URL: https://svnweb.freebsd.org/changeset/base/316975 Log: Import zstd 1.1.4 Added: vendor/zstd/ vendor/zstd/dist/ vendor/zstd/dist/.buckconfig vendor/zstd/dist/.buckversion vendor/zstd/dist/.gitattributes vendor/zstd/dist/.gitignore vendor/zstd/dist/.travis.yml vendor/zstd/dist/CONTRIBUTING.md vendor/zstd/dist/LICENSE vendor/zstd/dist/LICENSE-examples vendor/zstd/dist/Makefile (contents, props changed) vendor/zstd/dist/NEWS vendor/zstd/dist/PATENTS vendor/zstd/dist/README.md vendor/zstd/dist/TESTING.md vendor/zstd/dist/appveyor.yml vendor/zstd/dist/build/ vendor/zstd/dist/build/.gitignore vendor/zstd/dist/build/README.md vendor/zstd/dist/build/VS2005/ vendor/zstd/dist/build/VS2005/fullbench/ vendor/zstd/dist/build/VS2005/fullbench/fullbench.vcproj vendor/zstd/dist/build/VS2005/fuzzer/ vendor/zstd/dist/build/VS2005/fuzzer/fuzzer.vcproj vendor/zstd/dist/build/VS2005/zstd/ vendor/zstd/dist/build/VS2005/zstd.sln vendor/zstd/dist/build/VS2005/zstd/zstd.vcproj vendor/zstd/dist/build/VS2005/zstdlib/ vendor/zstd/dist/build/VS2005/zstdlib/zstdlib.vcproj vendor/zstd/dist/build/VS2008/ vendor/zstd/dist/build/VS2008/fullbench/ vendor/zstd/dist/build/VS2008/fullbench/fullbench.vcproj vendor/zstd/dist/build/VS2008/fuzzer/ vendor/zstd/dist/build/VS2008/fuzzer/fuzzer.vcproj vendor/zstd/dist/build/VS2008/zstd/ vendor/zstd/dist/build/VS2008/zstd.sln vendor/zstd/dist/build/VS2008/zstd/zstd.vcproj vendor/zstd/dist/build/VS2008/zstdlib/ vendor/zstd/dist/build/VS2008/zstdlib/zstdlib.vcproj vendor/zstd/dist/build/VS2010/ vendor/zstd/dist/build/VS2010/CompileAsCpp.props vendor/zstd/dist/build/VS2010/datagen/ vendor/zstd/dist/build/VS2010/datagen/datagen.vcxproj vendor/zstd/dist/build/VS2010/fullbench/ vendor/zstd/dist/build/VS2010/fullbench-dll/ vendor/zstd/dist/build/VS2010/fullbench-dll/fullbench-dll.vcxproj vendor/zstd/dist/build/VS2010/fullbench/fullbench.vcxproj vendor/zstd/dist/build/VS2010/fuzzer/ vendor/zstd/dist/build/VS2010/fuzzer/fuzzer.vcxproj vendor/zstd/dist/build/VS2010/libzstd/ vendor/zstd/dist/build/VS2010/libzstd-dll/ vendor/zstd/dist/build/VS2010/libzstd-dll/libzstd-dll.rc vendor/zstd/dist/build/VS2010/libzstd-dll/libzstd-dll.vcxproj vendor/zstd/dist/build/VS2010/libzstd/libzstd.vcxproj vendor/zstd/dist/build/VS2010/zstd/ vendor/zstd/dist/build/VS2010/zstd.sln vendor/zstd/dist/build/VS2010/zstd/zstd.rc vendor/zstd/dist/build/VS2010/zstd/zstd.vcxproj vendor/zstd/dist/build/VS_scripts/ vendor/zstd/dist/build/VS_scripts/README.md vendor/zstd/dist/build/VS_scripts/build.VS2010.cmd vendor/zstd/dist/build/VS_scripts/build.VS2012.cmd vendor/zstd/dist/build/VS_scripts/build.VS2013.cmd vendor/zstd/dist/build/VS_scripts/build.VS2015.cmd vendor/zstd/dist/build/VS_scripts/build.generic.cmd vendor/zstd/dist/build/cmake/ vendor/zstd/dist/build/cmake/.gitignore vendor/zstd/dist/build/cmake/CMakeLists.txt (contents, props changed) vendor/zstd/dist/build/cmake/CMakeModules/ vendor/zstd/dist/build/cmake/CMakeModules/AddExtraCompilationFlags.cmake vendor/zstd/dist/build/cmake/cmake_uninstall.cmake.in (contents, props changed) vendor/zstd/dist/build/cmake/contrib/ vendor/zstd/dist/build/cmake/contrib/CMakeLists.txt (contents, props changed) vendor/zstd/dist/build/cmake/contrib/pzstd/ vendor/zstd/dist/build/cmake/contrib/pzstd/CMakeLists.txt (contents, props changed) vendor/zstd/dist/build/cmake/lib/ vendor/zstd/dist/build/cmake/lib/CMakeLists.txt (contents, props changed) vendor/zstd/dist/build/cmake/programs/ vendor/zstd/dist/build/cmake/programs/.gitignore vendor/zstd/dist/build/cmake/programs/CMakeLists.txt (contents, props changed) vendor/zstd/dist/build/cmake/tests/ vendor/zstd/dist/build/cmake/tests/.gitignore vendor/zstd/dist/build/cmake/tests/CMakeLists.txt (contents, props changed) vendor/zstd/dist/circle.yml vendor/zstd/dist/contrib/ vendor/zstd/dist/contrib/gen_html/ vendor/zstd/dist/contrib/gen_html/.gitignore vendor/zstd/dist/contrib/gen_html/Makefile (contents, props changed) vendor/zstd/dist/contrib/gen_html/README.md vendor/zstd/dist/contrib/gen_html/gen-zstd-manual.sh (contents, props changed) vendor/zstd/dist/contrib/gen_html/gen_html.cpp (contents, props changed) vendor/zstd/dist/contrib/meson/ vendor/zstd/dist/contrib/meson/README vendor/zstd/dist/contrib/meson/meson.build vendor/zstd/dist/contrib/meson/meson_options.txt (contents, props changed) vendor/zstd/dist/contrib/pzstd/ vendor/zstd/dist/contrib/pzstd/.gitignore vendor/zstd/dist/contrib/pzstd/BUCK vendor/zstd/dist/contrib/pzstd/ErrorHolder.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/Logging.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/Makefile (contents, props changed) vendor/zstd/dist/contrib/pzstd/Options.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/Options.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/Pzstd.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/Pzstd.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/README.md vendor/zstd/dist/contrib/pzstd/SkippableFrame.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/SkippableFrame.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/images/ vendor/zstd/dist/contrib/pzstd/images/Cspeed.png (contents, props changed) vendor/zstd/dist/contrib/pzstd/images/Dspeed.png (contents, props changed) vendor/zstd/dist/contrib/pzstd/main.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/test/ vendor/zstd/dist/contrib/pzstd/test/BUCK vendor/zstd/dist/contrib/pzstd/test/OptionsTest.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/test/PzstdTest.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/test/RoundTrip.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/test/RoundTripTest.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/ vendor/zstd/dist/contrib/pzstd/utils/BUCK vendor/zstd/dist/contrib/pzstd/utils/Buffer.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/FileSystem.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/Likely.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/Range.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/ResourcePool.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/ScopeGuard.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/ThreadPool.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/WorkQueue.h (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/test/ vendor/zstd/dist/contrib/pzstd/utils/test/BUCK vendor/zstd/dist/contrib/pzstd/utils/test/BufferTest.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/test/RangeTest.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/test/ResourcePoolTest.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/test/ScopeGuardTest.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/test/ThreadPoolTest.cpp (contents, props changed) vendor/zstd/dist/contrib/pzstd/utils/test/WorkQueueTest.cpp (contents, props changed) vendor/zstd/dist/doc/ vendor/zstd/dist/doc/README.md vendor/zstd/dist/doc/educational_decoder/ vendor/zstd/dist/doc/educational_decoder/README.md vendor/zstd/dist/doc/educational_decoder/harness.c (contents, props changed) vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c (contents, props changed) vendor/zstd/dist/doc/educational_decoder/zstd_decompress.h (contents, props changed) vendor/zstd/dist/doc/images/ vendor/zstd/dist/doc/images/Cspeed4.png (contents, props changed) vendor/zstd/dist/doc/images/DCspeed5.png (contents, props changed) vendor/zstd/dist/doc/images/Dspeed4.png (contents, props changed) vendor/zstd/dist/doc/images/dict-cr.png (contents, props changed) vendor/zstd/dist/doc/images/dict-cs.png (contents, props changed) vendor/zstd/dist/doc/images/dict-ds.png (contents, props changed) vendor/zstd/dist/doc/zstd_compression_format.md vendor/zstd/dist/doc/zstd_manual.html (contents, props changed) vendor/zstd/dist/examples/ vendor/zstd/dist/examples/.gitignore vendor/zstd/dist/examples/Makefile (contents, props changed) vendor/zstd/dist/examples/README.md vendor/zstd/dist/examples/dictionary_compression.c (contents, props changed) vendor/zstd/dist/examples/dictionary_decompression.c (contents, props changed) vendor/zstd/dist/examples/multiple_streaming_compression.c (contents, props changed) vendor/zstd/dist/examples/simple_compression.c (contents, props changed) vendor/zstd/dist/examples/simple_decompression.c (contents, props changed) vendor/zstd/dist/examples/streaming_compression.c (contents, props changed) vendor/zstd/dist/examples/streaming_decompression.c (contents, props changed) vendor/zstd/dist/lib/ vendor/zstd/dist/lib/.gitignore vendor/zstd/dist/lib/BUCK vendor/zstd/dist/lib/Makefile (contents, props changed) vendor/zstd/dist/lib/README.md vendor/zstd/dist/lib/common/ vendor/zstd/dist/lib/common/bitstream.h (contents, props changed) vendor/zstd/dist/lib/common/entropy_common.c (contents, props changed) vendor/zstd/dist/lib/common/error_private.c (contents, props changed) vendor/zstd/dist/lib/common/error_private.h (contents, props changed) vendor/zstd/dist/lib/common/fse.h (contents, props changed) vendor/zstd/dist/lib/common/fse_decompress.c (contents, props changed) vendor/zstd/dist/lib/common/huf.h (contents, props changed) vendor/zstd/dist/lib/common/mem.h (contents, props changed) vendor/zstd/dist/lib/common/pool.c (contents, props changed) vendor/zstd/dist/lib/common/pool.h (contents, props changed) vendor/zstd/dist/lib/common/threading.c (contents, props changed) vendor/zstd/dist/lib/common/threading.h (contents, props changed) vendor/zstd/dist/lib/common/xxhash.c (contents, props changed) vendor/zstd/dist/lib/common/xxhash.h (contents, props changed) vendor/zstd/dist/lib/common/zstd_common.c (contents, props changed) vendor/zstd/dist/lib/common/zstd_errors.h (contents, props changed) vendor/zstd/dist/lib/common/zstd_internal.h (contents, props changed) vendor/zstd/dist/lib/compress/ vendor/zstd/dist/lib/compress/fse_compress.c (contents, props changed) vendor/zstd/dist/lib/compress/huf_compress.c (contents, props changed) vendor/zstd/dist/lib/compress/zstd_compress.c (contents, props changed) vendor/zstd/dist/lib/compress/zstd_opt.h (contents, props changed) vendor/zstd/dist/lib/compress/zstdmt_compress.c (contents, props changed) vendor/zstd/dist/lib/compress/zstdmt_compress.h (contents, props changed) vendor/zstd/dist/lib/decompress/ vendor/zstd/dist/lib/decompress/huf_decompress.c (contents, props changed) vendor/zstd/dist/lib/decompress/zstd_decompress.c (contents, props changed) vendor/zstd/dist/lib/deprecated/ vendor/zstd/dist/lib/deprecated/zbuff.h (contents, props changed) vendor/zstd/dist/lib/deprecated/zbuff_common.c (contents, props changed) vendor/zstd/dist/lib/deprecated/zbuff_compress.c (contents, props changed) vendor/zstd/dist/lib/deprecated/zbuff_decompress.c (contents, props changed) vendor/zstd/dist/lib/dictBuilder/ vendor/zstd/dist/lib/dictBuilder/cover.c (contents, props changed) vendor/zstd/dist/lib/dictBuilder/divsufsort.c (contents, props changed) vendor/zstd/dist/lib/dictBuilder/divsufsort.h (contents, props changed) vendor/zstd/dist/lib/dictBuilder/zdict.c (contents, props changed) vendor/zstd/dist/lib/dictBuilder/zdict.h (contents, props changed) vendor/zstd/dist/lib/dll/ vendor/zstd/dist/lib/dll/example/ vendor/zstd/dist/lib/dll/example/Makefile (contents, props changed) vendor/zstd/dist/lib/dll/example/README.md vendor/zstd/dist/lib/dll/example/build_package.bat vendor/zstd/dist/lib/dll/example/fullbench-dll.sln vendor/zstd/dist/lib/dll/example/fullbench-dll.vcxproj vendor/zstd/dist/lib/dll/libzstd.def vendor/zstd/dist/lib/legacy/ vendor/zstd/dist/lib/legacy/zstd_legacy.h (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v01.c (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v01.h (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v02.c (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v02.h (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v03.c (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v03.h (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v04.c (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v04.h (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v05.c (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v05.h (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v06.c (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v06.h (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v07.c (contents, props changed) vendor/zstd/dist/lib/legacy/zstd_v07.h (contents, props changed) vendor/zstd/dist/lib/libzstd.pc.in (contents, props changed) vendor/zstd/dist/lib/zstd.h (contents, props changed) vendor/zstd/dist/programs/ vendor/zstd/dist/programs/.gitignore vendor/zstd/dist/programs/BUCK vendor/zstd/dist/programs/Makefile (contents, props changed) vendor/zstd/dist/programs/README.md vendor/zstd/dist/programs/bench.c (contents, props changed) vendor/zstd/dist/programs/bench.h (contents, props changed) vendor/zstd/dist/programs/datagen.c (contents, props changed) vendor/zstd/dist/programs/datagen.h (contents, props changed) vendor/zstd/dist/programs/dibio.c (contents, props changed) vendor/zstd/dist/programs/dibio.h (contents, props changed) vendor/zstd/dist/programs/fileio.c (contents, props changed) vendor/zstd/dist/programs/fileio.h (contents, props changed) vendor/zstd/dist/programs/platform.h (contents, props changed) vendor/zstd/dist/programs/util.h (contents, props changed) vendor/zstd/dist/programs/windres/ vendor/zstd/dist/programs/windres/generate_res.bat vendor/zstd/dist/programs/windres/verrsrc.h (contents, props changed) vendor/zstd/dist/programs/windres/zstd.rc vendor/zstd/dist/programs/windres/zstd32.res (contents, props changed) vendor/zstd/dist/programs/windres/zstd64.res (contents, props changed) vendor/zstd/dist/programs/zstd.1 (contents, props changed) vendor/zstd/dist/programs/zstdcli.c (contents, props changed) vendor/zstd/dist/programs/zstdgrep (contents, props changed) vendor/zstd/dist/programs/zstdless (contents, props changed) vendor/zstd/dist/tests/ vendor/zstd/dist/tests/.gitignore vendor/zstd/dist/tests/Makefile (contents, props changed) vendor/zstd/dist/tests/README.md vendor/zstd/dist/tests/datagencli.c (contents, props changed) vendor/zstd/dist/tests/decodecorpus.c (contents, props changed) vendor/zstd/dist/tests/fullbench.c (contents, props changed) vendor/zstd/dist/tests/fuzzer.c (contents, props changed) vendor/zstd/dist/tests/gzip/ vendor/zstd/dist/tests/gzip/Makefile (contents, props changed) vendor/zstd/dist/tests/gzip/gzip-env.sh (contents, props changed) vendor/zstd/dist/tests/gzip/helin-segv.sh (contents, props changed) vendor/zstd/dist/tests/gzip/help-version.sh (contents, props changed) vendor/zstd/dist/tests/gzip/hufts-segv.gz (contents, props changed) vendor/zstd/dist/tests/gzip/hufts.sh (contents, props changed) vendor/zstd/dist/tests/gzip/init.cfg vendor/zstd/dist/tests/gzip/init.sh (contents, props changed) vendor/zstd/dist/tests/gzip/keep.sh (contents, props changed) vendor/zstd/dist/tests/gzip/list.sh (contents, props changed) vendor/zstd/dist/tests/gzip/memcpy-abuse.sh (contents, props changed) vendor/zstd/dist/tests/gzip/mixed.sh (contents, props changed) vendor/zstd/dist/tests/gzip/null-suffix-clobber.sh (contents, props changed) vendor/zstd/dist/tests/gzip/stdin.sh (contents, props changed) vendor/zstd/dist/tests/gzip/test-driver.sh (contents, props changed) vendor/zstd/dist/tests/gzip/trailing-nul.sh (contents, props changed) vendor/zstd/dist/tests/gzip/unpack-invalid.sh (contents, props changed) vendor/zstd/dist/tests/gzip/z-suffix.sh (contents, props changed) vendor/zstd/dist/tests/gzip/zdiff.sh (contents, props changed) vendor/zstd/dist/tests/gzip/zgrep-context.sh (contents, props changed) vendor/zstd/dist/tests/gzip/zgrep-f.sh (contents, props changed) vendor/zstd/dist/tests/gzip/zgrep-signal.sh (contents, props changed) vendor/zstd/dist/tests/gzip/znew-k.sh (contents, props changed) vendor/zstd/dist/tests/invalidDictionaries.c (contents, props changed) vendor/zstd/dist/tests/legacy.c (contents, props changed) vendor/zstd/dist/tests/longmatch.c (contents, props changed) vendor/zstd/dist/tests/namespaceTest.c (contents, props changed) vendor/zstd/dist/tests/paramgrill.c (contents, props changed) vendor/zstd/dist/tests/playTests.sh (contents, props changed) vendor/zstd/dist/tests/pool.c (contents, props changed) vendor/zstd/dist/tests/roundTripCrash.c (contents, props changed) vendor/zstd/dist/tests/symbols.c (contents, props changed) vendor/zstd/dist/tests/test-zstd-speed.py (contents, props changed) vendor/zstd/dist/tests/test-zstd-versions.py (contents, props changed) vendor/zstd/dist/tests/zbufftest.c (contents, props changed) vendor/zstd/dist/tests/zstreamtest.c (contents, props changed) vendor/zstd/dist/zlibWrapper/ vendor/zstd/dist/zlibWrapper/.gitignore vendor/zstd/dist/zlibWrapper/BUCK vendor/zstd/dist/zlibWrapper/Makefile (contents, props changed) vendor/zstd/dist/zlibWrapper/README.md vendor/zstd/dist/zlibWrapper/examples/ vendor/zstd/dist/zlibWrapper/examples/example.c (contents, props changed) vendor/zstd/dist/zlibWrapper/examples/example_original.c (contents, props changed) vendor/zstd/dist/zlibWrapper/examples/fitblk.c (contents, props changed) vendor/zstd/dist/zlibWrapper/examples/fitblk_original.c (contents, props changed) vendor/zstd/dist/zlibWrapper/examples/minigzip.c (contents, props changed) vendor/zstd/dist/zlibWrapper/examples/zwrapbench.c (contents, props changed) vendor/zstd/dist/zlibWrapper/gzclose.c (contents, props changed) vendor/zstd/dist/zlibWrapper/gzcompatibility.h (contents, props changed) vendor/zstd/dist/zlibWrapper/gzguts.h (contents, props changed) vendor/zstd/dist/zlibWrapper/gzlib.c (contents, props changed) vendor/zstd/dist/zlibWrapper/gzread.c (contents, props changed) vendor/zstd/dist/zlibWrapper/gzwrite.c (contents, props changed) vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.c (contents, props changed) vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.h (contents, props changed) Added: vendor/zstd/dist/.buckconfig ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/.buckconfig Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,9 @@ +[cxx] + cppflags = -DXXH_NAMESPACE=ZSTD_ -DZSTD_LEGACY_SUPPORT=4 + cflags = -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef -Wpointer-arith + cxxppflags = -DXXH_NAMESPACE=ZSTD_ -DZSTD_LEGACY_SUPPORT=4 + cxxflags = -std=c++11 -Wno-deprecated-declarations + gtest_dep = //contrib/pzstd:gtest + +[httpserver] + port = 0 Added: vendor/zstd/dist/.buckversion ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/.buckversion Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1 @@ +c8dec2e8da52d483f6dd7c6cd2ad694e8e6fed2b Added: vendor/zstd/dist/.gitattributes ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/.gitattributes Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,24 @@ +# Set the default behavior +* text eol=lf + +# Explicitly declare source files +*.c text eol=lf +*.h text eol=lf + +# Denote files that should not be modified. +*.odt binary +*.png binary + +# Visual Studio +*.sln text eol=crlf +*.vcxproj* text eol=crlf +*.vcproj* text eol=crlf +*.suo binary +*.rc text eol=crlf + +# Windows +*.bat text eol=crlf +*.cmd text eol=crlf + +# .travis.yml merging +.travis.yml merge=ours Added: vendor/zstd/dist/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/.gitignore Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,41 @@ +# Object files +*.o +*.ko +*.dSYM + +# Libraries +*.lib +*.a + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +zstd +zstdmt +*.exe +*.out +*.app + +# Test artefacts +tmp* +dictionary* + +# Other files +.directory +_codelite/ +_zstdbench/ +.clang_complete +*.idea +*.swp +.DS_Store +googletest/ +*.d + +# Directories +bin/ +.buckd/ +buck-out/ Added: vendor/zstd/dist/.travis.yml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/.travis.yml Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,51 @@ +# Long tests: run on commits to master branch/cron builds + +language: c +sudo: required +dist: trusty +matrix: + include: + # Ubuntu 14.04 + - env: Cmd='make gcc6install && CC=gcc-6 make clean uasan-test' + - env: Cmd='make gcc6install libc6install && CC=gcc-6 make clean uasan-test32' + - env: Cmd='make clang38install && CC=clang-3.8 make clean msan-test' + - env: Cmd='make clang38install && CC=clang-3.8 make clean tsan-test-zstream' + - env: Cmd='make valgrindinstall && make -C tests clean valgrindTest' + + - env: Cmd='make arminstall && make armtest' + - env: Cmd='make arminstall && make aarch64test' + - env: Cmd='make ppcinstall && make ppctest' + - env: Cmd='make ppcinstall && make ppc64test' + + + - env: Cmd='make gpp6install valgrindinstall && make -C zlibWrapper test && make -C zlibWrapper valgrindTest' + - env: Cmd='make -C tests versionsTest' + - env: Cmd='make gpp6install && cd contrib/pzstd && make test-pzstd && make test-pzstd32 && make test-pzstd-tsan && make test-pzstd-asan' + install: + - export CXX="g++-6" CC="gcc-6" + - env: Cmd='make gcc6install && CC=gcc-6 make uasan-test-zstd-nolegacy' + - env: Cmd='make gcc6install && CC=gcc-6 make uasan-test-zbuff' + + # OS X Mavericks + - env: Cmd="make gnu90build && make clean && make test && make clean && make travis-install" + os: osx + +git: + depth: 1 + +branches: + only: + - dev + - master + +script: + - JOB_NUMBER=$(echo $TRAVIS_JOB_NUMBER | sed -e 's:[0-9][0-9]*\.\(.*\):\1:') + - echo JOB_NUMBER=$JOB_NUMBER TRAVIS_BRANCH=$TRAVIS_BRANCH TRAVIS_EVENT_TYPE=$TRAVIS_EVENT_TYPE TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST + - export FUZZERTEST=-T5mn; + export ZSTREAM_TESTTIME=-T5mn; + export DECODECORPUS_TESTTIME=-T1mn; + if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then + git fetch origin dev; + git checkout -f FETCH_HEAD; + fi; + sh -c "$Cmd" || travis_terminate 1; Added: vendor/zstd/dist/CONTRIBUTING.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/CONTRIBUTING.md Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,42 @@ +# Contributing to Zstandard +We want to make contributing to this project as easy and transparent as +possible. + +## Our Development Process +New versions are being developed in the "dev" branch, +or in their own feature branch. +When they are deemed ready for a release, they are merged into "master". + +As a consequences, all contributions must stage first through "dev" +or their own feature branch. + +## Pull Requests +We actively welcome your pull requests. + +1. Fork the repo and create your branch from `dev`. +2. If you've added code that should be tested, add tests. +3. If you've changed APIs, update the documentation. +4. Ensure the test suite passes. +5. Make sure your code lints. +6. If you haven't already, complete the Contributor License Agreement ("CLA"). + +## Contributor License Agreement ("CLA") +In order to accept your pull request, we need you to submit a CLA. You only need +to do this once to work on any of Facebook's open source projects. + +Complete your CLA here: + +## Issues +We use GitHub issues to track public bugs. Please ensure your description is +clear and has sufficient instructions to be able to reproduce the issue. + +Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe +disclosure of security bugs. In those cases, please go through the process +outlined on that page and do not file a public issue. + +## Coding Style +* 4 spaces for indentation rather than tabs + +## License +By contributing to Zstandard, you agree that your contributions will be licensed +under the [LICENSE](LICENSE) file in the root directory of this source tree. Added: vendor/zstd/dist/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/LICENSE Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,30 @@ +BSD License + +For Zstandard software + +Copyright (c) 2016-present, Facebook, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * 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. + + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. Added: vendor/zstd/dist/LICENSE-examples ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/LICENSE-examples Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,11 @@ +Copyright (c) 2016-present, Facebook, Inc. All rights reserved. + +The examples provided by Facebook are for non-commercial testing and evaluation +purposes only. Facebook reserves all rights not expressly granted. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Added: vendor/zstd/dist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/Makefile Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,315 @@ +# ################################################################ +# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. +# ################################################################ + +PRGDIR = programs +ZSTDDIR = lib +BUILDIR = build +ZWRAPDIR = zlibWrapper +TESTDIR = tests + +# Define nul output +VOID = /dev/null + +ifneq (,$(filter Windows%,$(OS))) +EXT =.exe +else +EXT = +endif + +.PHONY: default +default: lib-release zstd-release + +.PHONY: all +all: | allmost examples manual + +.PHONY: allmost +allmost: + $(MAKE) -C $(ZSTDDIR) all + $(MAKE) -C $(PRGDIR) all + $(MAKE) -C $(TESTDIR) all + $(MAKE) -C $(ZWRAPDIR) all + +#skip zwrapper, can't build that on alternate architectures without the proper zlib installed +.PHONY: allarch +allarch: + $(MAKE) -C $(ZSTDDIR) all + $(MAKE) -C $(PRGDIR) all + $(MAKE) -C $(TESTDIR) all + +.PHONY: all32 +all32: + $(MAKE) -C $(PRGDIR) zstd32 + $(MAKE) -C $(TESTDIR) all32 + +.PHONY: lib +lib: + @$(MAKE) -C $(ZSTDDIR) $@ + +.PHONY: lib-release +lib-release: + @$(MAKE) -C $(ZSTDDIR) + +.PHONY: zstd +zstd: + @$(MAKE) -C $(PRGDIR) $@ + cp $(PRGDIR)/zstd$(EXT) . + +.PHONY: zstd-release +zstd-release: + @$(MAKE) -C $(PRGDIR) + cp $(PRGDIR)/zstd$(EXT) . + +.PHONY: zstdmt +zstdmt: + @$(MAKE) -C $(PRGDIR) $@ + cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT) + +.PHONY: zlibwrapper +zlibwrapper: + $(MAKE) -C $(ZWRAPDIR) test + +.PHONY: shortest +shortest: + $(MAKE) -C $(TESTDIR) $@ + +.PHONY: test +test: + $(MAKE) -C $(TESTDIR) $@ + +.PHONY: examples +examples: + CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all + +.PHONY: manual +manual: + $(MAKE) -C contrib/gen_html $@ + +.PHONY: clean +clean: + @$(MAKE) -C $(ZSTDDIR) $@ > $(VOID) + @$(MAKE) -C $(PRGDIR) $@ > $(VOID) + @$(MAKE) -C $(TESTDIR) $@ > $(VOID) + @$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID) + @$(MAKE) -C examples/ $@ > $(VOID) + @$(MAKE) -C contrib/gen_html $@ > $(VOID) + @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* + @echo Cleaning completed + +#------------------------------------------------------------------------------ +# make install is validated only for Linux, OSX, Hurd and some BSD targets +#------------------------------------------------------------------------------ +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD)) +HOST_OS = POSIX +.PHONY: install uninstall travis-install clangtest gpptest armtest usan asan uasan + +install: + @$(MAKE) -C $(ZSTDDIR) $@ + @$(MAKE) -C $(PRGDIR) $@ + +uninstall: + @$(MAKE) -C $(ZSTDDIR) $@ + @$(MAKE) -C $(PRGDIR) $@ + +travis-install: + $(MAKE) install PREFIX=~/install_test_dir + +gppbuild: clean + g++ -v + CC=g++ $(MAKE) -C programs all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" + +gcc5build: clean + gcc-5 -v + CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror" + +gcc6build: clean + gcc-6 -v + CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror" + +clangbuild: clean + clang -v + CXX=clang++ CC=clang $(MAKE) all MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" + +m32build: clean + gcc -v + $(MAKE) all32 + +armbuild: clean + CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allarch + +aarch64build: clean + CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allarch + +ppcbuild: clean + CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allarch + +ppc64build: clean + CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allarch + +armfuzz: clean + CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" $(MAKE) -C $(TESTDIR) fuzztest + +aarch64fuzz: clean + CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" $(MAKE) -C $(TESTDIR) fuzztest + +ppcfuzz: clean + CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static" $(MAKE) -C $(TESTDIR) fuzztest + +ppc64fuzz: clean + CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" $(MAKE) -C $(TESTDIR) fuzztest + +gpptest: clean + CC=g++ $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" + +gcc5test: clean + gcc-5 -v + $(MAKE) all CC=gcc-5 MOREFLAGS="-Werror" + +gcc6test: clean + gcc-6 -v + $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror" + +clangtest: clean + clang -v + $(MAKE) all CXX=clang-++ CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" + +armtest: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" + +aarch64test: + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" + +ppctest: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" + +ppc64test: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" + +arm-ppc-compilation: + $(MAKE) -C $(PRGDIR) clean zstd CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" + +# run UBsan with -fsanitize-recover=signed-integer-overflow +# due to a bug in UBsan when doing pointer subtraction +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303 + +usan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined" + +asan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address" + +asan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address" $(MAKE) -C $(TESTDIR) $* + +msan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" # datagen.c fails this test for no obvious reason + +msan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" $(MAKE) -C $(TESTDIR) $* + +asan32: clean + $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address" + +uasan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" + +uasan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-Og -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $* + +tsan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* +apt-install: + sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES) + +apt-add-repo: + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update -y -qq + +ppcinstall: + APT_PACKAGES="qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu" $(MAKE) apt-install + +arminstall: + APT_PACKAGES="qemu-system-arm qemu-user-static gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross" $(MAKE) apt-install + +valgrindinstall: + APT_PACKAGES="valgrind" $(MAKE) apt-install + +libc6install: + APT_PACKAGES="libc6-dev-i386 gcc-multilib" $(MAKE) apt-install + +gcc6install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-6 gcc-6-multilib" $(MAKE) apt-install + +gpp6install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install + +clang38install: + APT_PACKAGES="clang-3.8" $(MAKE) apt-install + +endif + + +ifneq (,$(filter MSYS%,$(shell uname))) +HOST_OS = MSYS +CMAKE_PARAMS = -G"MSYS Makefiles" +endif + + +#------------------------------------------------------------------------ +#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets +#------------------------------------------------------------------------ +ifneq (,$(filter $(HOST_OS),MSYS POSIX)) +cmakebuild: + cmake --version + $(RM) -r $(BUILDIR)/cmake/build + mkdir $(BUILDIR)/cmake/build + cd $(BUILDIR)/cmake/build ; cmake -DPREFIX:STRING=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall + +c90build: clean + gcc -v + CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long` + +gnu90build: clean + gcc -v + CFLAGS="-std=gnu90" $(MAKE) allmost + +c99build: clean + gcc -v + CFLAGS="-std=c99" $(MAKE) allmost + +gnu99build: clean + gcc -v + CFLAGS="-std=gnu99" $(MAKE) allmost + +c11build: clean + gcc -v + CFLAGS="-std=c11" $(MAKE) allmost + +bmix64build: clean + gcc -v + CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test + +bmix32build: clean + gcc -v + CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test + +bmi32build: clean + gcc -v + CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test + +staticAnalyze: clean + gcc -v + CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all +endif Added: vendor/zstd/dist/NEWS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/NEWS Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,261 @@ +v1.1.4 +cli : new : can compress in *.gz format, using --format=gzip command, by Przemyslaw Skibinski +cli : new : advanced benchmark command --priority=rt +cli : fix : write on sparse-enabled file systems in 32-bits mode, by @ds77 +cli : fix : --rm remains silent when input is stdin +cli : experimental : xzstd, with support for xz/lzma decoding, by Przemyslaw Skibinski +speed : improved decompression speed in streaming mode for single shot scenarios (+5%) +memory : DDict (decompression dictionary) memory usage down from 150 KB to 20 KB +arch : 32-bits variant able to generate and decode very long matches (>32 MB), by Sean Purcell +API : new : ZSTD_findFrameCompressedSize(), ZSTD_getFrameContentSize(), ZSTD_findDecompressedSize() +API : changed : dropped support of legacy versions <= v0.3 (can be changed by modifying ZSTD_LEGACY_SUPPORT value) +build: new: meson build system in contrib/meson, by Dima Krasner +build: improved cmake script, by @Majlen +build: added -Wformat-security flag, as recommended by Padraig Brady +doc : new : educational decoder, by Sean Purcell + +v1.1.3 +cli : zstd can decompress .gz files (can be disabled with `make zstd-nogz` or `make HAVE_ZLIB=0`) +cli : new : experimental target `make zstdmt`, with multi-threading support +cli : new : improved dictionary builder "cover" (experimental), by Nick Terrell, based on prior work by Giuseppe Ottaviano. +cli : new : advanced commands for detailed parameters, by Przemyslaw Skibinski +cli : fix zstdless on Mac OS-X, by Andrew Janke +cli : fix #232 "compress non-files" +dictBuilder : improved dictionary generation quality, thanks to Nick Terrell +API : new : lib/compress/ZSTDMT_compress.h multithreading API (experimental) +API : new : ZSTD_create?Dict_byReference(), requested by Bartosz Taudul +API : new : ZDICT_finalizeDictionary() +API : fix : ZSTD_initCStream_usingCDict() properly writes dictID into frame header, by Gregory Szorc (#511) +API : fix : all symbols properly exposed in libzstd, by Nick Terrell +build : support for Solaris target, by Przemyslaw Skibinski +doc : clarified specification, by Sean Purcell + +v1.1.2 +API : streaming : decompression : changed : automatic implicit reset when chain-decoding new frames without init +API : experimental : added : dictID retrieval functions, and ZSTD_initCStream_srcSize() +API : zbuff : changed : prototypes now generate deprecation warnings +lib : improved : faster decompression speed at ultra compression settings and 32-bits mode +lib : changed : only public ZSTD_ symbols are now exposed +lib : changed : reduced usage of stack memory +lib : fixed : several corner case bugs, by Nick Terrell +cli : new : gzstd, experimental version able to decode .gz files, by Przemyslaw Skibinski +cli : new : preserve file attributes +cli : new : added zstdless and zstdgrep tools +cli : fixed : status displays total amount decoded, even for file consisting of multiple frames (like pzstd) +cli : fixed : zstdcat +zlib_wrapper : added support for gz* functions, by Przemyslaw Skibinski +install : better compatibility with FreeBSD, by Dimitry Andric +source tree : changed : zbuff source files moved to lib/deprecated + +v1.1.1 +New : command -M#, --memory=, --memlimit=, --memlimit-decompress= to limit allowed memory consumption +New : doc/zstd_manual.html, by Przemyslaw Skibinski +Improved : slightly better compression ratio at --ultra levels (>= 20) +Improved : better memory usage when using streaming compression API, thanks to @Rogier-5 report +Added : API : ZSTD_initCStream_usingCDict(), ZSTD_initDStream_usingDDict() (experimental section) +Added : example/multiple_streaming_compression.c +Changed : zstd_errors.h is now installed within /include (and replaces errors_public.h) +Updated man page +Fixed : zstd-small, zstd-compress and zstd-decompress compilation targets + +v1.1.0 +New : contrib/pzstd, parallel version of zstd, by Nick Terrell +added : NetBSD install target (#338) +Improved : speed for batches of small files +Improved : speed of zlib wrapper, by Przemyslaw Skibinski +Changed : libzstd on Windows supports legacy formats, by Christophe Chevalier +Fixed : CLI -d output to stdout by default when input is stdin (#322) +Fixed : CLI correctly detects console on Mac OS-X +Fixed : CLI supports recursive mode `-r` on Mac OS-X +Fixed : Legacy decoders use unified error codes, reported by benrg (#341), fixed by Przemyslaw Skibinski +Fixed : compatibility with OpenBSD, reported by Juan Francisco Cantero Hurtado (#319) +Fixed : compatibility with Hurd, by Przemyslaw Skibinski (#365) +Fixed : zstd-pgo, reported by octoploid (#329) + +v1.0.0 +Change Licensing, all project is now BSD, Copyright Facebook +Small decompression speed improvement +API : Streaming API supports legacy format +API : ZDICT_getDictID(), ZSTD_sizeof_{CCtx, DCtx, CStream, DStream}(), ZSTD_setDStreamParamter() +CLI supports legacy formats v0.4+ +Fixed : compression fails on certain huge files, reported by Jesse McGrew +Enhanced documentation, by Przemyslaw Skibinski + +v0.8.1 +New streaming API +Changed : --ultra now enables levels beyond 19 +Changed : -i# now selects benchmark time in second +Fixed : ZSTD_compress* can now compress > 4 GB in a single pass, reported by Nick Terrell +Fixed : speed regression on specific patterns (#272) +Fixed : support for Z_SYNC_FLUSH, by Dmitry Krot (#291) +Fixed : ICC compilation, by Przemyslaw Skibinski + +v0.8.0 +Improved : better speed on clang and gcc -O2, thanks to Eric Biggers +New : Build on FreeBSD and DragonFly, thanks to JrMarino +Changed : modified API : ZSTD_compressEnd() +Fixed : legacy mode with ZSTD_HEAPMODE=0, by Christopher Bergqvist +Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers +Fixed : large dictionaries (> 384 KB), reported by Ilona Papava +Fixed : checksum correctly checked in single-pass mode +Fixed : combined --test amd --rm, reported by Andreas M. Nilsson +Modified : minor compression level adaptations +Updated : compression format specification to v0.2.0 +changed : zstd.h moved to /lib directory + +v0.7.5 +Transition version, supporting decoding of v0.8.x + +v0.7.4 +Added : homebrew for Mac, by Daniel Cade +Added : more examples +Fixed : segfault when using small dictionaries, reported by Felix Handte +Modified : default compression level for CLI is now 3 +Updated : specification, to v0.1.1 + +v0.7.3 +New : compression format specification +New : `--` separator, stating that all following arguments are file names. Suggested by Chip Turner. +New : `ZSTD_getDecompressedSize()` +New : OpenBSD target, by Juan Francisco Cantero Hurtado +New : `examples` directory +fixed : dictBuilder using HC levels, reported by Bartosz Taudul +fixed : legacy support from ZSTD_decompress_usingDDict(), reported by Felix Handte +fixed : multi-blocks decoding with intermediate uncompressed blocks, reported by Greg Slazinski +modified : removed "mem.h" and "error_public.h" dependencies from "zstd.h" (experimental section) +modified : legacy functions no longer need magic number + +v0.7.2 +fixed : ZSTD_decompressBlock() using multiple consecutive blocks. Reported by Greg Slazinski. +fixed : potential segfault on very large files (many gigabytes). Reported by Chip Turner. +fixed : CLI displays system error message when destination file cannot be created (#231). Reported by Chip Turner. + +v0.7.1 +fixed : ZBUFF_compressEnd() called multiple times with too small `dst` buffer, reported by Christophe Chevalier +fixed : dictBuilder fails if first sample is too small, reported by РуÑлан Ковалёв +fixed : corruption issue, reported by cj +modified : checksum enabled by default in command line mode + +v0.7.0 +New : Support for directory compression, using `-r`, thanks to Przemyslaw Skibinski +New : Command `--rm`, to remove source file after successful de/compression +New : Visual build scripts, by Christophe Chevalier +New : Support for Sparse File-systems (do not use space for zero-filled sectors) +New : Frame checksum support +New : Support pass-through mode (when using `-df`) +API : more efficient Dictionary API : `ZSTD_compress_usingCDict()`, `ZSTD_decompress_usingDDict()` +API : create dictionary files from custom content, by Giuseppe Ottaviano +API : support for custom malloc/free functions +New : controllable Dictionary ID +New : Support for skippable frames + +v0.6.1 +New : zlib wrapper API, thanks to Przemyslaw Skibinski +New : Ability to compile compressor / decompressor separately +Changed : new lib directory structure +Fixed : Legacy codec v0.5 compatible with dictionary decompression +Fixed : Decoder corruption error (#173) +Fixed : null-string roundtrip (#176) +New : benchmark mode can select directory as input +Experimental : midipix support, VMS support + +v0.6.0 +Stronger high compression modes, thanks to Przemyslaw Skibinski +API : ZSTD_getFrameParams() provides size of decompressed content +New : highest compression modes require `--ultra` command to fully unleash their capacity +Fixed : zstd cli return error code > 0 and removes dst file artifact when decompression fails, thanks to Chip Turner + +v0.5.1 +New : Optimal parsing => Very high compression modes, thanks to Przemyslaw Skibinski +Changed : Dictionary builder integrated into libzstd and zstd cli +Changed (!) : zstd cli now uses "multiple input files" as default mode. See `zstd -h`. +Fix : high compression modes for big-endian platforms +New : zstd cli : `-t` | `--test` command + +v0.5.0 +New : dictionary builder utility +Changed : streaming & dictionary API +Improved : better compression of small data + +v0.4.7 +Improved : small compression speed improvement in HC mode +Changed : `zstd_decompress.c` has ZSTD_LEGACY_SUPPORT to 0 by default +fix : bt search bug + +v0.4.6 +fix : fast compression mode on Windows +New : cmake configuration file, thanks to Artyom Dymchenko +Improved : high compression mode on repetitive data +New : block-level API +New : ZSTD_duplicateCCtx() + +v0.4.5 +new : -m/--multiple : compress/decompress multiple files + +v0.4.4 +Fixed : high compression modes for Windows 32 bits +new : external dictionary API extended to buffered mode and accessible through command line +new : windows DLL project, thanks to Christophe Chevalier + +v0.4.3 : +new : external dictionary API +new : zstd-frugal + +v0.4.2 : +Generic minor improvements for small blocks +Fixed : big-endian compatibility, by Peter Harris (#85) + +v0.4.1 +Fixed : ZSTD_LEGACY_SUPPORT=0 build mode (reported by Luben) +removed `zstd.c` + +v0.4.0 +Command line utility compatible with high compression levels +Removed zstdhc => merged into zstd +Added : ZBUFF API (see zstd_buffered.h) +Rolling buffer support + +v0.3.6 +small blocks params + +v0.3.5 +minor generic compression improvements + +v0.3.4 +Faster fast cLevels + +v0.3.3 +Small compression ratio improvement + +v0.3.2 +Fixed Visual Studio + +v0.3.1 : +Small compression ratio improvement + +v0.3 +HC mode : compression levels 2-26 + +v0.2.2 +Fix : Visual Studio 2013 & 2015 release compilation, by Christophe Chevalier + +v0.2.1 +Fix : Read errors, advanced fuzzer tests, by Hanno Böck + +v0.2.0 +**Breaking format change** +Faster decompression speed +Can still decode v0.1 format + +v0.1.3 +fix uninitialization warning, reported by Evan Nemerson + +v0.1.2 +frame concatenation support + +v0.1.1 +fix compression bug +detects write-flush errors + +v0.1.0 +first release Added: vendor/zstd/dist/PATENTS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/PATENTS Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,33 @@ +Additional Grant of Patent Rights Version 2 + +"Software" means the Zstandard software distributed by Facebook, Inc. + +Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software +("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable +(subject to the termination provision below) license under any Necessary +Claims, to make, have made, use, sell, offer to sell, import, and otherwise +transfer the Software. For avoidance of doubt, no license is granted under +Facebook’s rights in any patent claims that are infringed by (i) modifications +to the Software made by you or any third party or (ii) the Software in +combination with any software or other technology. + +The license granted hereunder will terminate, automatically and without notice, +if you (or any of your subsidiaries, corporate affiliates or agents) initiate +directly or indirectly, or take a direct financial interest in, any Patent +Assertion: (i) against Facebook or any of its subsidiaries or corporate +affiliates, (ii) against any party if such Patent Assertion arises in whole or +in part from any software, technology, product or service of Facebook or any of +its subsidiaries or corporate affiliates, or (iii) against any party relating +to the Software. Notwithstanding the foregoing, if Facebook or any of its +subsidiaries or corporate affiliates files a lawsuit alleging patent +infringement against you in the first instance, and you respond by filing a +patent infringement counterclaim in that lawsuit against that party that is +unrelated to the Software, the license granted hereunder will not terminate +under section (i) of this paragraph due to such counterclaim. + +A "Necessary Claim" is a claim of a patent owned by Facebook that is +necessarily infringed by the Software standing alone. + +A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, +or contributory infringement or inducement to infringe any patent, including a +cross-claim or counterclaim. Added: vendor/zstd/dist/README.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/README.md Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,141 @@ + __Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm, + targeting real-time compression scenarios at zlib-level and better compression ratios. + +It is provided as an open-source BSD-licensed **C** library, +and a command line utility producing and decoding `.zst` and `.gz` files. +For other programming languages, +you can consult a list of known ports on [Zstandard homepage](http://www.zstd.net/#other-languages). + +|Branch |Status | +|------------|---------| +|master | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=master)](https://travis-ci.org/facebook/zstd) | +|dev | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=dev)](https://travis-ci.org/facebook/zstd) | + +As a reference, several fast compression algorithms were tested and compared +on a server running Linux Mint Debian Edition (`Linux version 4.8.0-1-amd64`), +with a Core i7-6700K CPU @ 4.0GHz, +using [lzbench v1.6], an open-source in-memory benchmark by @inikep +compiled with GCC 6.3.0, +on the [Silesia compression corpus]. + +[lzbench v1.6]: https://github.com/inikep/lzbench +[Silesia compression corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia + +| Compressor name | Ratio | Compression| Decompress.| +| --------------- | ------| -----------| ---------- | +| **zstd 1.1.3 -1** | 2.877 | 430 MB/s | 1110 MB/s | +| zlib 1.2.8 -1 | 2.743 | 110 MB/s | 400 MB/s | +| brotli 0.5.2 -0 | 2.708 | 400 MB/s | 430 MB/s | +| quicklz 1.5.0 -1 | 2.238 | 550 MB/s | 710 MB/s | +| lzo1x 2.09 -1 | 2.108 | 650 MB/s | 830 MB/s | +| lz4 1.7.5 | 2.101 | 720 MB/s | 3600 MB/s | +| snappy 1.1.3 | 2.091 | 500 MB/s | 1650 MB/s | +| lzf 3.6 -1 | 2.077 | 400 MB/s | 860 MB/s | + +[zlib]:http://www.zlib.net/ +[LZ4]: http://www.lz4.org/ + +Zstd can also offer stronger compression ratios at the cost of compression speed. +Speed vs Compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, a property shared by most LZ compression algorithms, such as [zlib] or lzma. + +The following tests were run on a Core i7-3930K CPU @ 4.5GHz, using [lzbench], an open-source in-memory benchmark by @inikep compiled with GCC 5.2.1, on the [Silesia compression corpus]. + +Compression Speed vs Ratio | Decompression Speed +---------------------------|-------------------- +![Compression Speed vs Ratio](doc/images/Cspeed4.png "Compression Speed vs Ratio") | ![Decompression Speed](doc/images/Dspeed4.png "Decompression Speed") + +Several algorithms can produce higher compression ratios, but at slower speeds, falling outside of the graph. +For a larger picture including very slow modes, [click on this link](doc/images/DCspeed5.png) . + + +### The case for Small Data compression + +Previous charts provide results applicable to typical file and stream scenarios (several MB). Small data comes with different perspectives. + +The smaller the amount of data to compress, the more difficult it is to compress. This problem is common to all compression algorithms, and reason is, compression algorithms learn from past data how to compress future data. But at the beginning of a new data set, there is no "past" to build upon. + +To solve this situation, Zstd offers a __training mode__, which can be used to tune the algorithm for a selected type of data. +Training Zstandard is achieved by provide it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression. +Using this dictionary, the compression ratio achievable on small data improves dramatically. + +The following example uses the `github-users` [sample set](https://github.com/facebook/zstd/releases/tag/v1.1.3), created from [github public API](https://developer.github.com/v3/users/#get-all-users). +It consists of roughly 10K records weighting about 1KB each. + +Compression Ratio | Compression Speed | Decompression Speed +------------------|-------------------|-------------------- +![Compression Ratio](doc/images/dict-cr.png "Compression Ratio") | ![Compression Speed](doc/images/dict-cs.png "Compression Speed") | ![Decompression Speed](doc/images/dict-ds.png "Decompression Speed") + + +These compression gains are achieved while simultaneously providing _faster_ compression and decompression speeds. + +Training works if there is some correlation in a family of small data samples. The more data-specific a dictionary is, the more efficient it is (there is no _universal dictionary_). +Hence, deploying one dictionary per type of data will provide the greatest benefits. +Dictionary gains are mostly effective in the first few KB. Then, the compression algorithm will gradually use previously decoded content to better compress the rest of the file. + +#### Dictionary compression How To : + +1) Create the dictionary + +`zstd --train FullPathToTrainingSet/* -o dictionaryName` + +2) Compress with dictionary + +`zstd -D dictionaryName FILE` + +3) Decompress with dictionary + +`zstd -D dictionaryName --decompress FILE.zst` + + +### Build + +Once you have the repository cloned, there are multiple ways provided to build Zstandard. + +#### Makefile + +If your system is compatible with a standard `make` (or `gmake`) binary generator, +you can simply run it at the root directory. +It will generate `zstd` within root directory. + +Other available options include : +- `make install` : create and install zstd binary, library and man page +- `make test` : create and run `zstd` and test tools on local platform + +#### cmake + +A `cmake` project generator is provided within `build/cmake`. +It can generate Makefiles or other build scripts +to create `zstd` binary, and `libzstd` dynamic and static libraries. + +#### Meson + +A Meson project is provided within `contrib/meson`. + +#### Visual Studio (Windows) + +Going into `build` directory, you will find additional possibilities : +- Projects for Visual Studio 2005, 2008 and 2010 + + VS2010 project is compatible with VS2012, VS2013 and VS2015 +- Automated build scripts for Visual compiler by @KrzysFR , in `build/VS_scripts`, + which will build `zstd` cli and `libzstd` library without any need to open Visual Studio solution. + + +### Status + +Zstandard is currently deployed within Facebook. It is used daily to compress and decompress very large amounts of data in multiple formats and use cases. +Zstandard is considered safe for production environments. + +### License + +Zstandard is [BSD-licensed](LICENSE). We also provide an [additional patent grant](PATENTS). + +### Contributing + +The "dev" branch is the one where all contributions will be merged before reaching "master". +If you plan to propose a patch, please commit into the "dev" branch or its own feature branch. +Direct commit to "master" are not permitted. +For more information, please read [CONTRIBUTING](CONTRIBUTING.md). + +### Miscellaneous + +Zstd entropy stage is provided by [Huff0 and FSE, from Finite State Entropy library](https://github.com/Cyan4973/FiniteStateEntropy). Added: vendor/zstd/dist/TESTING.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/TESTING.md Sat Apr 15 19:47:16 2017 (r316975) @@ -0,0 +1,44 @@ +Testing +======= *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Apr 15 19:47:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76C82D3F136; Sat, 15 Apr 2017 19:47:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30CC8F93; Sat, 15 Apr 2017 19:47:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FJlo57094517; Sat, 15 Apr 2017 19:47:50 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FJlo7A094516; Sat, 15 Apr 2017 19:47:50 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704151947.v3FJlo7A094516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 19:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316976 - vendor/zstd/1.1.4 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 19:47:51 -0000 Author: bapt Date: Sat Apr 15 19:47:50 2017 New Revision: 316976 URL: https://svnweb.freebsd.org/changeset/base/316976 Log: Tag import of zstd 1.1.4 Added: vendor/zstd/1.1.4/ - copied from r316975, vendor/zstd/dist/ From owner-svn-src-all@freebsd.org Sat Apr 15 20:03:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9050BD3F748; Sat, 15 Apr 2017 20:03:51 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E79CFDC; Sat, 15 Apr 2017 20:03:51 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FK3oIu002357; Sat, 15 Apr 2017 20:03:50 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FK3o3w002356; Sat, 15 Apr 2017 20:03:50 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704152003.v3FK3o3w002356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sat, 15 Apr 2017 20:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316977 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 20:03:51 -0000 Author: bde Date: Sat Apr 15 20:03:50 2017 New Revision: 316977 URL: https://svnweb.freebsd.org/changeset/base/316977 Log: Add a 10x16 mouse cursor and use it in all graphics (strictly, pixel) modes if the font size is >= 14. This is the X cursor XC_left_ptr (#68) (glyph #45 in an X cursor font). Also found in vt. The old 9x13 cursor is the 10x16 one trimmed not very well. 8x8 fonts need a smaller cursor instead of a larger one, except when the pixel size is small. Text mode is still limited to width and height 1 more than the font (so the 9x13 is already 4 pixels too high for it). Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Sat Apr 15 19:47:50 2017 (r316976) +++ head/sys/dev/syscons/scvgarndr.c Sat Apr 15 20:03:50 2017 (r316977) @@ -173,6 +173,14 @@ static const struct mousedata mouse9x13 0x0c00, 0x0c00, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, }, 9, 13, }; + +static const struct mousedata mouse10x16 = { { + 0xc000, 0xa000, 0x9000, 0x8800, 0x8400, 0x8200, 0x8100, 0x8080, + 0x8040, 0x83c0, 0x9200, 0xa900, 0xc900, 0x0480, 0x0480, 0x0300, }, { + 0x0000, 0x4000, 0x6000, 0x7000, 0x7800, 0x7c00, 0x7e00, 0x7f00, + 0x7f80, 0x7c00, 0x6c00, 0x4600, 0x0600, 0x0300, 0x0300, 0x0000, }, + 10, 16, +}; #endif #endif @@ -1042,7 +1050,7 @@ draw_pxlmouse_planar(scr_stat *scp, int int i, j, k; uint8_t m1; - mdp = &mouse9x13; + mdp = (scp->font_size < 14) ? &mouse9x13 : &mouse10x16; line_width = scp->sc->adp->va_line_width; xoff = (x - scp->xoff*8)%8; yoff = y - rounddown(y, line_width); @@ -1087,7 +1095,7 @@ remove_pxlmouse_planar(scr_stat *scp, in vm_offset_t p; int bx, by, i, line_width, xend, xoff, yend, yoff; - mdp = &mouse9x13; + mdp = (scp->font_size < 14) ? &mouse9x13 : &mouse10x16; /* * It is only necessary to remove the mouse image where it overlaps @@ -1132,7 +1140,7 @@ vga_pxlmouse_direct(scr_stat *scp, int x uint8_t *u8; int bpp; - mdp = &mouse9x13; + mdp = (scp->font_size < 14) ? &mouse9x13 : &mouse10x16; /* * Determine overlap with the border and then if removing, do nothing From owner-svn-src-all@freebsd.org Sat Apr 15 20:05:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D33E4D3F7C4; Sat, 15 Apr 2017 20:05:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B020B195; Sat, 15 Apr 2017 20:05:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FK5Msf002465; Sat, 15 Apr 2017 20:05:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FK5M2j002459; Sat, 15 Apr 2017 20:05:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704152005.v3FK5M2j002459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 20:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 20:05:23 -0000 Author: bapt Date: Sat Apr 15 20:05:22 2017 New Revision: 316978 URL: https://svnweb.freebsd.org/changeset/base/316978 Log: Import zstandard 1.1.4 in base zstandard is a new compression library/tool which is very fast at compression/decompression For now import as a private library Added: head/contrib/zstd/ - copied from r316976, vendor/zstd/dist/ head/lib/libzstd/ head/lib/libzstd/Makefile (contents, props changed) head/usr.bin/zstd/ head/usr.bin/zstd/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/lib/Makefile head/share/mk/src.libnames.mk head/usr.bin/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Sat Apr 15 20:03:50 2017 (r316977) +++ head/etc/mtree/BSD.usr.dist Sat Apr 15 20:05:22 2017 (r316978) @@ -17,6 +17,8 @@ .. ucl .. + zstd + .. .. .. lib Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Apr 15 20:03:50 2017 (r316977) +++ head/lib/Makefile Sat Apr 15 20:05:22 2017 (r316978) @@ -90,6 +90,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libxo \ liby \ libz \ + libzstd \ ncurses # Inter-library dependencies. When the makefile for a library contains LDADD Added: head/lib/libzstd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libzstd/Makefile Sat Apr 15 20:05:22 2017 (r316978) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +LIB= zstd +SRCS= entropy_common.c \ + error_private.c \ + fse_decompress.c \ + pool.c \ + threading.c \ + xxhash.c \ + zstd_common.c \ + fse_compress.c \ + huf_compress.c \ + zstd_compress.c \ + zstdmt_compress.c \ + huf_decompress.c \ + zstd_decompress.c \ + zbuff_common.c \ + zbuff_compress.c \ + zbuff_decompress.c \ + cover.c \ + divsufsort.c \ + zdict.c +WARNS= 2 +INCS= zstd.h +CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ + +PRIVATELIB= yes + +ZSTDDIR= ${SRCTOP}/contrib/zstd +.PATH: ${ZSTDDIR}/lib/common ${ZSTDDIR}/lib/compress \ + ${ZSTDDIR}/lib/decompress ${ZSTDDIR}/lib/deprecated \ + ${ZSTDDIR}/lib/dictBuilder ${ZSTDDIR}/lib + +.include Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sat Apr 15 20:03:50 2017 (r316977) +++ head/share/mk/src.libnames.mk Sat Apr 15 20:05:22 2017 (r316978) @@ -24,7 +24,8 @@ _PRIVATELIBS= \ sqlite3 \ ssh \ ucl \ - unbound + unbound \ + zstd _INTERNALLIBS= \ amu \ Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sat Apr 15 20:03:50 2017 (r316977) +++ head/usr.bin/Makefile Sat Apr 15 20:05:22 2017 (r316978) @@ -189,7 +189,8 @@ SUBDIR= alias \ xo \ xz \ xzdec \ - yes + yes \ + zstd # NB: keep these sorted by MK_* knobs Added: head/usr.bin/zstd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/zstd/Makefile Sat Apr 15 20:05:22 2017 (r316978) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +PROG= zstd +SRCS= bench.c \ + datagen.c \ + dibio.c \ + fileio.c \ + zstdcli.c + +CFLAGS+= -I${SRCTOP}/contrib/zstd/programs \ + -I${SRCTOP}/contrib/zstd/lib/common \ + -I${SRCTOP}/contrib/zstd/lib/compress \ + -I${SRCTOP}/contrib/zstd/lib/dictBuilder \ + -I${SRCTOP}/contrib/zstd/lib \ + -DXXH_NAMESPACE=ZSTD_ + +WARNS= 2 +LIBADD= zstd +.PATH: ${SRCTOP}/contrib/zstd/programs + +.include From owner-svn-src-all@freebsd.org Sat Apr 15 20:06:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C37F9D3F874; Sat, 15 Apr 2017 20:06:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93EEF32B; Sat, 15 Apr 2017 20:06:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FK6OOu002543; Sat, 15 Apr 2017 20:06:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FK6Ogw002541; Sat, 15 Apr 2017 20:06:24 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704152006.v3FK6Ogw002541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 20:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316979 - head/usr.bin/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 20:06:25 -0000 Author: bapt Date: Sat Apr 15 20:06:24 2017 New Revision: 316979 URL: https://svnweb.freebsd.org/changeset/base/316979 Log: Add a zstdless equivalent to zless, bzless xzless Modified: head/usr.bin/less/Makefile head/usr.bin/less/lesspipe.sh Modified: head/usr.bin/less/Makefile ============================================================================== --- head/usr.bin/less/Makefile Sat Apr 15 20:05:22 2017 (r316978) +++ head/usr.bin/less/Makefile Sat Apr 15 20:06:24 2017 (r316979) @@ -12,7 +12,8 @@ LIBADD= ncursesw LINKS= ${BINDIR}/less ${BINDIR}/more \ ${BINDIR}/zless ${BINDIR}/bzless \ ${BINDIR}/zless ${BINDIR}/xzless \ - ${BINDIR}/zless ${BINDIR}/lzless + ${BINDIR}/zless ${BINDIR}/lzless \ + ${BINDIR}/zless ${BINDIR}/zstless MLINKS= less.1 more.1 CLEANFILES= less.1 Modified: head/usr.bin/less/lesspipe.sh ============================================================================== --- head/usr.bin/less/lesspipe.sh Sat Apr 15 20:05:22 2017 (r316978) +++ head/usr.bin/less/lesspipe.sh Sat Apr 15 20:06:24 2017 (r316979) @@ -22,4 +22,7 @@ case "$1" in *.lzma) exec lzma -d -c "$1" 2>/dev/null ;; + *.zst) + exec zstd -d -q -c "$1" 2>/dev/null + ;; esac From owner-svn-src-all@freebsd.org Sat Apr 15 20:15:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4347D3FAD7; Sat, 15 Apr 2017 20:15:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86CC6A08; Sat, 15 Apr 2017 20:15:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FKFiJF006838; Sat, 15 Apr 2017 20:15:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FKFiwZ006836; Sat, 15 Apr 2017 20:15:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704152015.v3FKFiwZ006836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 20:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316980 - head/contrib/zstd/programs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 20:15:45 -0000 Author: bapt Date: Sat Apr 15 20:15:44 2017 New Revision: 316980 URL: https://svnweb.freebsd.org/changeset/base/316980 Log: Change some default to make zstd a dropin replacement for gzip,bzip etc in most cases Changes ares: - quiet by default - remove the source files one compression completion by default Modified: head/contrib/zstd/programs/fileio.c head/contrib/zstd/programs/zstdcli.c Modified: head/contrib/zstd/programs/fileio.c ============================================================================== --- head/contrib/zstd/programs/fileio.c Sat Apr 15 20:06:24 2017 (r316979) +++ head/contrib/zstd/programs/fileio.c Sat Apr 15 20:15:44 2017 (r316980) @@ -138,7 +138,7 @@ static U32 g_dictIDFlag = 1; void FIO_setDictIDFlag(unsigned dictIDFlag) { g_dictIDFlag = dictIDFlag; } static U32 g_checksumFlag = 1; void FIO_setChecksumFlag(unsigned checksumFlag) { g_checksumFlag = checksumFlag; } -static U32 g_removeSrcFile = 0; +static U32 g_removeSrcFile = 1; void FIO_setRemoveSrcFile(unsigned flag) { g_removeSrcFile = (flag>0); } static U32 g_memLimit = 0; void FIO_setMemLimit(unsigned memLimit) { g_memLimit = memLimit; } Modified: head/contrib/zstd/programs/zstdcli.c ============================================================================== --- head/contrib/zstd/programs/zstdcli.c Sat Apr 15 20:06:24 2017 (r316979) +++ head/contrib/zstd/programs/zstdcli.c Sat Apr 15 20:15:44 2017 (r316980) @@ -61,7 +61,7 @@ #define MB *(1 <<20) #define GB *(1U<<30) -#define DEFAULT_DISPLAY_LEVEL 2 +#define DEFAULT_DISPLAY_LEVEL 1 static const char* g_defaultDictName = "dictionary"; static const unsigned g_defaultMaxDictSize = 110 KB; From owner-svn-src-all@freebsd.org Sat Apr 15 20:37:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74045D3F5E3; Sat, 15 Apr 2017 20:37:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 510DBF12; Sat, 15 Apr 2017 20:37:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FKbZe2015052; Sat, 15 Apr 2017 20:37:35 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FKbZ91015048; Sat, 15 Apr 2017 20:37:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704152037.v3FKbZ91015048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 20:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316981 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 20:37:36 -0000 Author: bapt Date: Sat Apr 15 20:37:34 2017 New Revision: 316981 URL: https://svnweb.freebsd.org/changeset/base/316981 Log: Add a new Y flag to newsyslog.conf This makes newsyslog use zstandard to compress log files. Given Z is already taken for gzip and zstandard compression level stands in between gzip and xz (which has the X flag) chosing Y sounds ok :) Modified: head/usr.sbin/newsyslog/newsyslog.8 head/usr.sbin/newsyslog/newsyslog.c head/usr.sbin/newsyslog/newsyslog.conf.5 head/usr.sbin/newsyslog/pathnames.h Modified: head/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.8 Sat Apr 15 20:15:44 2017 (r316980) +++ head/usr.sbin/newsyslog/newsyslog.8 Sat Apr 15 20:37:34 2017 (r316981) @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd September 23, 2014 +.Dd April 15, 2017 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -288,6 +288,7 @@ accepted for backwards compatibility. .Xr bzip2 1 , .Xr gzip 1 , .Xr xz 1 , +.Xr zst 1 , .Xr syslog 3 , .Xr newsyslog.conf 5 , .Xr chown 8 , Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sat Apr 15 20:15:44 2017 (r316980) +++ head/usr.sbin/newsyslog/newsyslog.c Sat Apr 15 20:37:34 2017 (r316981) @@ -100,17 +100,22 @@ __FBSDID("$FreeBSD$"); #define COMPRESS_SUFFIX_XZ ".xz" #endif +#ifndef COMPRESS_SUFFIX_ZST +#define COMPRESS_SUFFIX_ZST ".zst" +#endif + #define COMPRESS_SUFFIX_MAXLEN MAX(MAX(sizeof(COMPRESS_SUFFIX_GZ),sizeof(COMPRESS_SUFFIX_BZ2)),sizeof(COMPRESS_SUFFIX_XZ)) /* * Compression types */ -#define COMPRESS_TYPES 4 /* Number of supported compression types */ +#define COMPRESS_TYPES 5 /* Number of supported compression types */ #define COMPRESS_NONE 0 #define COMPRESS_GZIP 1 #define COMPRESS_BZIP2 2 #define COMPRESS_XZ 3 +#define COMPRESS_ZSTD 4 /* * Bit-values for the 'flags' parsed from a config-file entry. @@ -149,7 +154,8 @@ static const struct compress_types compr { "", "", "" }, /* no compression */ { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP }, /* gzip compression */ { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2 }, /* bzip2 compression */ - { "X", COMPRESS_SUFFIX_XZ, _PATH_XZ } /* xz compression */ + { "X", COMPRESS_SUFFIX_XZ, _PATH_XZ }, /* xz compression */ + { "Y", COMPRESS_SUFFIX_ZST, _PATH_ZSTD } /* zst compression */ }; struct conf_entry { @@ -1299,6 +1305,9 @@ no_trimat: case 'x': working->compress = COMPRESS_XZ; break; + case 'y': + working->compress = COMPRESS_ZSTD; + break; case 'z': working->compress = COMPRESS_GZIP; break; Modified: head/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.conf.5 Sat Apr 15 20:15:44 2017 (r316980) +++ head/usr.sbin/newsyslog/newsyslog.conf.5 Sat Apr 15 20:37:34 2017 (r316981) @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd October 24, 2015 +.Dd April 15, 2017 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -303,6 +303,12 @@ indicates that should attempt to save disk space by compressing the rotated log file using .Xr xz 1 . +.It Cm Y +indicates that +.Xr newsyslog 8 +should attempt to save disk space by compressing the rotated +log file using +.Xr zstd 1 . .It Cm N indicates that there is no process which needs to be signaled when this log file is rotated. Modified: head/usr.sbin/newsyslog/pathnames.h ============================================================================== --- head/usr.sbin/newsyslog/pathnames.h Sat Apr 15 20:15:44 2017 (r316980) +++ head/usr.sbin/newsyslog/pathnames.h Sat Apr 15 20:37:34 2017 (r316981) @@ -27,3 +27,4 @@ provided "as is" without express or impl #define _PATH_BZIP2 "/usr/bin/bzip2" #define _PATH_GZIP "/usr/bin/gzip" #define _PATH_XZ "/usr/bin/xz" +#define _PATH_ZSTD "/usr/bin/zstd" From owner-svn-src-all@freebsd.org Sat Apr 15 20:51:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8312ED3FB27; Sat, 15 Apr 2017 20:51:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 463A7C28; Sat, 15 Apr 2017 20:51:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FKpskN020508; Sat, 15 Apr 2017 20:51:54 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FKpr38020502; Sat, 15 Apr 2017 20:51:53 GMT (envelope-from des@FreeBSD.org) Message-Id: <201704152051.v3FKpr38020502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 15 Apr 2017 20:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316982 - in head/sys: conf crypto/chacha20 modules modules/chacha20 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 20:51:55 -0000 Author: des Date: Sat Apr 15 20:51:53 2017 New Revision: 316982 URL: https://svnweb.freebsd.org/changeset/base/316982 Log: 3BSD-licensed implementation of the chacha20 stream cipher, intended for use by the upcoming arc4random replacement. Added: head/sys/crypto/chacha20/ head/sys/crypto/chacha20/chacha20.c (contents, props changed) head/sys/crypto/chacha20/chacha20.h (contents, props changed) head/sys/modules/chacha20/ head/sys/modules/chacha20/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Apr 15 20:37:34 2017 (r316981) +++ head/sys/conf/files Sat Apr 15 20:51:53 2017 (r316982) @@ -591,6 +591,7 @@ crypto/blowfish/bf_ecb.c optional ipsec crypto/blowfish/bf_skey.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia-api.c optional crypto | ipsec | ipsec_support +crypto/chacha20/chacha20.c optional chacha20 crypto/des/des_ecb.c optional crypto | ipsec | ipsec_support | netsmb crypto/des/des_setkey.c optional crypto | ipsec | ipsec_support | netsmb crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi Added: head/sys/crypto/chacha20/chacha20.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/chacha20/chacha20.c Sat Apr 15 20:51:53 2017 (r316982) @@ -0,0 +1,210 @@ +/*- + * Copyright (c) 2017 Dag-Erling Smørgrav + * 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. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifdef _KERNEL +#include +#include +#include +#include +#include +#include +#else +#include +#include +#endif + +#include + + +#include + +#define rol32(x, n) \ + ((x) << ((n) & 0x1f) | (x) >> (-(n) & 0x1f)) + +#define CHACHA_QR(x, a, b, c, d) \ + do { \ + x[a] = x[a] + x[b]; x[d] = rol32(x[d] ^ x[a], 16); \ + x[c] = x[c] + x[d]; x[b] = rol32(x[b] ^ x[c], 12); \ + x[a] = x[a] + x[b]; x[d] = rol32(x[d] ^ x[a], 8); \ + x[c] = x[c] + x[d]; x[b] = rol32(x[b] ^ x[c], 7); \ + } while (0) + +static const char magic128[] = "expand 16-byte k"; +static const char magic256[] = "expand 32-byte k"; + +/* + * Fill the state array with 16 bytes of magic and 32 bytes of key, + * repeating the key if necessary. The 8-byte stream position and the + * 8-byte nonce are initialized to all-zeroes. + */ +void +chacha20_init(chacha20_ctx *ctx, const uint8_t *key, size_t keylen) +{ + + memset(ctx, 0, sizeof *ctx); + if (keylen == 32) { + /* magic */ + ctx->state[ 0] = le32dec(magic256 + 0); + ctx->state[ 1] = le32dec(magic256 + 4); + ctx->state[ 2] = le32dec(magic256 + 8); + ctx->state[ 3] = le32dec(magic256 + 12); + /* first half of key */ + ctx->state[ 4] = le32dec(key + 0); + ctx->state[ 5] = le32dec(key + 4); + ctx->state[ 6] = le32dec(key + 8); + ctx->state[ 7] = le32dec(key + 12); + /* second half of key */ + ctx->state[ 8] = le32dec(key + 16); + ctx->state[ 9] = le32dec(key + 20); + ctx->state[10] = le32dec(key + 24); + ctx->state[11] = le32dec(key + 28); + } else { + /* magic */ + ctx->state[ 0] = le32dec(magic128 + 0); + ctx->state[ 1] = le32dec(magic128 + 4); + ctx->state[ 2] = le32dec(magic128 + 8); + ctx->state[ 3] = le32dec(magic128 + 12); + /* first half of key */ + ctx->state[ 4] = le32dec(key + 0); + ctx->state[ 5] = le32dec(key + 4); + ctx->state[ 6] = le32dec(key + 8); + ctx->state[ 7] = le32dec(key + 12); + /* repeat first half of key */ + ctx->state[ 8] = le32dec(key + 0); + ctx->state[ 9] = le32dec(key + 4); + ctx->state[10] = le32dec(key + 8); + ctx->state[11] = le32dec(key + 12); + } +} + +/* + * Reset the stream position and load a new nonce. + */ +void +chacha20_reset(chacha20_ctx *ctx, const uint8_t *nonce) +{ + + /* reset stream counter */ + ctx->state[12] = 0; + ctx->state[13] = 0; + /* copy nonce */ + ctx->state[14] = le32dec(nonce + 0); + ctx->state[15] = le32dec(nonce + 4); +} + +/* + * Encryption: generate a block of keystream, xor it with the plaintext to + * produce the ciphertext, and increment the stream position. If vpt is + * NULL, simply copy the requested keystream to the output buffer. + */ +size_t +chacha20_encrypt(chacha20_ctx *ctx, const void *vpt, uint8_t *ct, size_t len) +{ + const uint8_t *pt = vpt; + uint64_t ctr; + uint32_t mix[16]; + uint8_t ks[64]; + unsigned int b, i; + + len -= len % sizeof ks; + for (b = 0; b < len; b += sizeof ks) { + memcpy(mix, ctx->state, sizeof mix); + for (i = 0; i < 20; i += 2) { + CHACHA_QR(mix, 0, 4, 8, 12); + CHACHA_QR(mix, 1, 5, 9, 13); + CHACHA_QR(mix, 2, 6, 10, 14); + CHACHA_QR(mix, 3, 7, 11, 15); + CHACHA_QR(mix, 0, 5, 10, 15); + CHACHA_QR(mix, 1, 6, 11, 12); + CHACHA_QR(mix, 2, 7, 8, 13); + CHACHA_QR(mix, 3, 4, 9, 14); + } + for (i = 0; i < 16; ++i) + le32enc(ks + i * 4, ctx->state[i] + mix[i]); + if (pt == NULL) { + memcpy(ct, ks, sizeof ks); + ct += sizeof ks; + } else { + for (i = 0; i < 64 && i < len; ++i) + *ct++ = *pt++ ^ ks[i]; + } + ctr = le64dec(ctx->state + 12); + le64enc(ctx->state + 12, ++ctr); + } + return (len); +} + +/* + * Decryption: identical to encryption. + */ +size_t +chacha20_decrypt(chacha20_ctx *ctx, const uint8_t *ct, void *vpt, size_t len) +{ + + return (chacha20_encrypt(ctx, ct, vpt, len)); +} + +/* + * Wipe our state. + */ +void +chacha20_finish(chacha20_ctx *ctx) +{ + + memset(ctx, 0, sizeof *ctx); +} + +#ifdef _KERNEL + +static int +chacha20_modevent(module_t mod, int evtype, void *unused) +{ + + switch (evtype) { + case MOD_LOAD: + return (0); + case MOD_UNLOAD: + return (0); + default: + return (EOPNOTSUPP); + } +} + +static moduledata_t chacha20_mod = { + "chacha20", + chacha20_modevent, + 0 +}; + +DECLARE_MODULE(chacha20, chacha20_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); +MODULE_VERSION(chacha20, 1); +#endif Added: head/sys/crypto/chacha20/chacha20.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/chacha20/chacha20.h Sat Apr 15 20:51:53 2017 (r316982) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2017 Dag-Erling Smørgrav + * 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. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * 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$ + */ + +#ifndef SYS_CRYPTO_CHACHA20_H_INCLUDED +#define SYS_CRYPTO_CHACHA20_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + uint32_t state[16]; +} chacha20_ctx; + +void chacha20_init(chacha20_ctx *, const uint8_t *, size_t); +void chacha20_reset(chacha20_ctx *, const uint8_t *); +size_t chacha20_encrypt(chacha20_ctx *, const void *, uint8_t *, size_t); +size_t chacha20_decrypt(chacha20_ctx *, const uint8_t *, void *, size_t); +void chacha20_finish(chacha20_ctx *); + +#ifdef __cplusplus +} +#endif + +#endif Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Apr 15 20:37:34 2017 (r316981) +++ head/sys/modules/Makefile Sat Apr 15 20:51:53 2017 (r316982) @@ -73,6 +73,7 @@ SUBDIR= \ cd9660_iconv \ ${_ce} \ ${_cfi} \ + chacha20 \ ${_chromebook_platform} \ ${_ciss} \ cloudabi \ Added: head/sys/modules/chacha20/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/chacha20/Makefile Sat Apr 15 20:51:53 2017 (r316982) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/crypto/chacha20 + +KMOD= chacha20 +SRCS= chacha20.c + +.include From owner-svn-src-all@freebsd.org Sat Apr 15 20:53:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6415D3FD75; Sat, 15 Apr 2017 20:53:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7347AF1F; Sat, 15 Apr 2017 20:53:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FKrpXr023441; Sat, 15 Apr 2017 20:53:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FKrpYU023440; Sat, 15 Apr 2017 20:53:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704152053.v3FKrpYU023440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 20:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316983 - head/usr.bin/zstd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 20:53:52 -0000 Author: bapt Date: Sat Apr 15 20:53:51 2017 New Revision: 316983 URL: https://svnweb.freebsd.org/changeset/base/316983 Log: Add forgotten links for zstdcat and unzstd Modified: head/usr.bin/zstd/Makefile Modified: head/usr.bin/zstd/Makefile ============================================================================== --- head/usr.bin/zstd/Makefile Sat Apr 15 20:51:53 2017 (r316982) +++ head/usr.bin/zstd/Makefile Sat Apr 15 20:53:51 2017 (r316983) @@ -13,6 +13,10 @@ CFLAGS+= -I${SRCTOP}/contrib/zstd/progra -I${SRCTOP}/contrib/zstd/lib/dictBuilder \ -I${SRCTOP}/contrib/zstd/lib \ -DXXH_NAMESPACE=ZSTD_ +LINKS= ${BINDIR}/zstd ${BINDIR}/unzstd \ + ${BINDIR}/zstd ${BINDIR}/zstdcat +MLINKS= zstd.1 unzstd.1 \ + zstd.1 zstdcat.1 WARNS= 2 LIBADD= zstd From owner-svn-src-all@freebsd.org Sat Apr 15 20:55:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89FE7D3FE7C; Sat, 15 Apr 2017 20:55:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A96D10C3; Sat, 15 Apr 2017 20:55:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FKt9YB023678; Sat, 15 Apr 2017 20:55:09 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FKt9jt023677; Sat, 15 Apr 2017 20:55:09 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704152055.v3FKt9jt023677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 20:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316984 - head/usr.bin/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 20:55:10 -0000 Author: bapt Date: Sat Apr 15 20:55:09 2017 New Revision: 316984 URL: https://svnweb.freebsd.org/changeset/base/316984 Log: rename zstless into zstdless to be consistent with other zstdcommands Modified: head/usr.bin/less/Makefile Modified: head/usr.bin/less/Makefile ============================================================================== --- head/usr.bin/less/Makefile Sat Apr 15 20:53:51 2017 (r316983) +++ head/usr.bin/less/Makefile Sat Apr 15 20:55:09 2017 (r316984) @@ -13,7 +13,7 @@ LINKS= ${BINDIR}/less ${BINDIR}/more \ ${BINDIR}/zless ${BINDIR}/bzless \ ${BINDIR}/zless ${BINDIR}/xzless \ ${BINDIR}/zless ${BINDIR}/lzless \ - ${BINDIR}/zless ${BINDIR}/zstless + ${BINDIR}/zless ${BINDIR}/zstdless MLINKS= less.1 more.1 CLEANFILES= less.1 From owner-svn-src-all@freebsd.org Sat Apr 15 20:56:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6263CD3FF1C; Sat, 15 Apr 2017 20:56:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E768C1385; Sat, 15 Apr 2017 20:56:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::1d46:7fe3:2385:fefb] (unknown [IPv6:2001:470:7a58:0:1d46:7fe3:2385:fefb]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 1E21626BB0; Sat, 15 Apr 2017 22:55:54 +0200 (CEST) From: Dimitry Andric Message-Id: <27D3BC32-DEAB-404C-A60B-ABCD00011949@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_9EFBF763-547F-4F0F-AC9E-85B6840AA00E"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r316979 - head/usr.bin/less Date: Sat, 15 Apr 2017 22:55:42 +0200 In-Reply-To: <201704152006.v3FK6Ogw002541@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Baptiste Daroussin References: <201704152006.v3FK6Ogw002541@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 20:56:04 -0000 --Apple-Mail=_9EFBF763-547F-4F0F-AC9E-85B6840AA00E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 15 Apr 2017, at 22:06, Baptiste Daroussin wrote: >=20 > Author: bapt > Date: Sat Apr 15 20:06:24 2017 > New Revision: 316979 > URL: https://svnweb.freebsd.org/changeset/base/316979 >=20 > Log: > Add a zstdless equivalent to zless, bzless xzless >=20 > Modified: > head/usr.bin/less/Makefile > head/usr.bin/less/lesspipe.sh >=20 > Modified: head/usr.bin/less/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/less/Makefile Sat Apr 15 20:05:22 2017 = (r316978) > +++ head/usr.bin/less/Makefile Sat Apr 15 20:06:24 2017 = (r316979) > @@ -12,7 +12,8 @@ LIBADD=3D ncursesw > LINKS=3D ${BINDIR}/less ${BINDIR}/more \ > ${BINDIR}/zless ${BINDIR}/bzless \ > ${BINDIR}/zless ${BINDIR}/xzless \ > - ${BINDIR}/zless ${BINDIR}/lzless > + ${BINDIR}/zless ${BINDIR}/lzless \ > + ${BINDIR}/zless ${BINDIR}/zstless s/zstless/zstdless/ here? -Dimitry --Apple-Mail=_9EFBF763-547F-4F0F-AC9E-85B6840AA00E Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAljyiNgACgkQsF6jCi4glqNnUgCgkQk6S+ulveE0wvh5lckrp4RG vXQAn1CcKKEpe6zcP7z+sQemAIa/PTYJ =daFb -----END PGP SIGNATURE----- --Apple-Mail=_9EFBF763-547F-4F0F-AC9E-85B6840AA00E-- From owner-svn-src-all@freebsd.org Sat Apr 15 21:12:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F98DD3F531; Sat, 15 Apr 2017 21:12:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0A091EA5; Sat, 15 Apr 2017 21:12:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FLCBBr030793; Sat, 15 Apr 2017 21:12:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FLCBep030792; Sat, 15 Apr 2017 21:12:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704152112.v3FLCBep030792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 21:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316985 - head/usr.bin/zstd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 21:12:13 -0000 Author: bapt Date: Sat Apr 15 21:12:11 2017 New Revision: 316985 URL: https://svnweb.freebsd.org/changeset/base/316985 Log: Install the zstdgrep shell wrapper Modified: head/usr.bin/zstd/Makefile Modified: head/usr.bin/zstd/Makefile ============================================================================== --- head/usr.bin/zstd/Makefile Sat Apr 15 20:55:09 2017 (r316984) +++ head/usr.bin/zstd/Makefile Sat Apr 15 21:12:11 2017 (r316985) @@ -13,6 +13,7 @@ CFLAGS+= -I${SRCTOP}/contrib/zstd/progra -I${SRCTOP}/contrib/zstd/lib/dictBuilder \ -I${SRCTOP}/contrib/zstd/lib \ -DXXH_NAMESPACE=ZSTD_ +SCRIPTS= zstdgrep LINKS= ${BINDIR}/zstd ${BINDIR}/unzstd \ ${BINDIR}/zstd ${BINDIR}/zstdcat MLINKS= zstd.1 unzstd.1 \ From owner-svn-src-all@freebsd.org Sat Apr 15 21:19:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE35DD3F653; Sat, 15 Apr 2017 21:19:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9118B123; Sat, 15 Apr 2017 21:19:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FLJnMp031648; Sat, 15 Apr 2017 21:19:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FLJnd9031647; Sat, 15 Apr 2017 21:19:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704152119.v3FLJnd9031647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 21:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316986 - in head/contrib/zstd: build lib/dll programs/windres X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 21:19:51 -0000 Author: bapt Date: Sat Apr 15 21:19:49 2017 New Revision: 316986 URL: https://svnweb.freebsd.org/changeset/base/316986 Log: Remove files which seems to confuse the git converter Deleted: head/contrib/zstd/build/ head/contrib/zstd/lib/dll/ head/contrib/zstd/programs/windres/ From owner-svn-src-all@freebsd.org Sat Apr 15 21:25:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0E8ED3F8B2; Sat, 15 Apr 2017 21:25:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7284A8EF; Sat, 15 Apr 2017 21:25:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FLPdph035925; Sat, 15 Apr 2017 21:25:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FLPdOX035924; Sat, 15 Apr 2017 21:25:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704152125.v3FLPdOX035924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 21:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316987 - in vendor/zstd/dist: build lib/dll programs programs/windres X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 21:25:40 -0000 Author: bapt Date: Sat Apr 15 21:25:39 2017 New Revision: 316987 URL: https://svnweb.freebsd.org/changeset/base/316987 Log: Remove files confusing the git exporter Deleted: vendor/zstd/dist/build/ vendor/zstd/dist/lib/dll/ vendor/zstd/dist/programs/windres/ Modified: vendor/zstd/dist/programs/fileio.c Modified: vendor/zstd/dist/programs/fileio.c ============================================================================== --- vendor/zstd/dist/programs/fileio.c Sat Apr 15 21:19:49 2017 (r316986) +++ vendor/zstd/dist/programs/fileio.c Sat Apr 15 21:25:39 2017 (r316987) @@ -138,7 +138,7 @@ static U32 g_dictIDFlag = 1; void FIO_setDictIDFlag(unsigned dictIDFlag) { g_dictIDFlag = dictIDFlag; } static U32 g_checksumFlag = 1; void FIO_setChecksumFlag(unsigned checksumFlag) { g_checksumFlag = checksumFlag; } -static U32 g_removeSrcFile = 0; +static U32 g_removeSrcFile = 1; void FIO_setRemoveSrcFile(unsigned flag) { g_removeSrcFile = (flag>0); } static U32 g_memLimit = 0; void FIO_setMemLimit(unsigned memLimit) { g_memLimit = memLimit; } From owner-svn-src-all@freebsd.org Sat Apr 15 21:33:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FC65D3FAC9; Sat, 15 Apr 2017 21:33:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57195CE0; Sat, 15 Apr 2017 21:33:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FLXi8K039837; Sat, 15 Apr 2017 21:33:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FLXiOU039836; Sat, 15 Apr 2017 21:33:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704152133.v3FLXiOU039836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Apr 2017 21:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316988 - vendor/zstd/dist/programs X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 21:33:45 -0000 Author: bapt Date: Sat Apr 15 21:33:44 2017 New Revision: 316988 URL: https://svnweb.freebsd.org/changeset/base/316988 Log: revert a change committed by accident: it is freebsd specific and should remain in contrib, not vendor Modified: vendor/zstd/dist/programs/fileio.c Modified: vendor/zstd/dist/programs/fileio.c ============================================================================== --- vendor/zstd/dist/programs/fileio.c Sat Apr 15 21:25:39 2017 (r316987) +++ vendor/zstd/dist/programs/fileio.c Sat Apr 15 21:33:44 2017 (r316988) @@ -138,7 +138,7 @@ static U32 g_dictIDFlag = 1; void FIO_setDictIDFlag(unsigned dictIDFlag) { g_dictIDFlag = dictIDFlag; } static U32 g_checksumFlag = 1; void FIO_setChecksumFlag(unsigned checksumFlag) { g_checksumFlag = checksumFlag; } -static U32 g_removeSrcFile = 1; +static U32 g_removeSrcFile = 0; void FIO_setRemoveSrcFile(unsigned flag) { g_removeSrcFile = (flag>0); } static U32 g_memLimit = 0; void FIO_setMemLimit(unsigned memLimit) { g_memLimit = memLimit; } From owner-svn-src-all@freebsd.org Sat Apr 15 22:35:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2EE2D3FFB4; Sat, 15 Apr 2017 22:35:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B652B12FC; Sat, 15 Apr 2017 22:35:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FMYMgc064412; Sat, 15 Apr 2017 22:34:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FMYMCB064410; Sat, 15 Apr 2017 22:34:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704152234.v3FMYMCB064410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 15 Apr 2017 22:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316989 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 22:35:39 -0000 Author: dim Date: Sat Apr 15 22:34:22 2017 New Revision: 316989 URL: https://svnweb.freebsd.org/changeset/base/316989 Log: Pull in r300404 from upstream llvm trunk (by me): Use correct registers for "A" inline asm constraint Summary: In PR32594, inline assembly using the 'A' constraint on x86_64 causes llvm to crash with a "Cannot select" stack trace. This is because `X86TargetLowering::getRegForInlineAsmConstraint` hardcodes that 'A' means the EAX and EDX registers. However, on x86_64 it means the RAX and RDX registers, and on 16-bit x86 (ia16?) it means the old AX and DX registers. Add new register classes in `X86RegisterInfo.td` to support these cases, and amend the logic in `getRegForInlineAsmConstraint` to cope with different subtargets. Also add a test case, derived from PR32594. Reviewers: craig.topper, qcolombet, RKSimon, ab Reviewed By: ab Subscribers: ab, emaste, royger, llvm-commits Differential Revision: https://reviews.llvm.org/D31902 This should fix crashes when using the 'A' constraint on amd64, for example as it is being used in Xen. Reported by: royger MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sat Apr 15 21:33:44 2017 (r316988) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sat Apr 15 22:34:22 2017 (r316989) @@ -34717,10 +34717,20 @@ X86TargetLowering::getRegForInlineAsmCon return Res; } - // 'A' means EAX + EDX. + // 'A' means [ER]AX + [ER]DX. if (Constraint == "A") { - Res.first = X86::EAX; - Res.second = &X86::GR32_ADRegClass; + if (Subtarget.is64Bit()) { + Res.first = X86::RAX; + Res.second = &X86::GR64_ADRegClass; + } else if (Subtarget.is32Bit()) { + Res.first = X86::EAX; + Res.second = &X86::GR32_ADRegClass; + } else if (Subtarget.is16Bit()) { + Res.first = X86::AX; + Res.second = &X86::GR16_ADRegClass; + } else { + llvm_unreachable("Expecting 64, 32 or 16 bit subtarget"); + } return Res; } return Res; Modified: head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td Sat Apr 15 21:33:44 2017 (r316988) +++ head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td Sat Apr 15 22:34:22 2017 (r316989) @@ -437,8 +437,10 @@ def LOW32_ADDR_ACCESS : RegisterClass<"X def LOW32_ADDR_ACCESS_RBP : RegisterClass<"X86", [i32], 32, (add LOW32_ADDR_ACCESS, RBP)>; -// A class to support the 'A' assembler constraint: EAX then EDX. +// A class to support the 'A' assembler constraint: [ER]AX then [ER]DX. +def GR16_AD : RegisterClass<"X86", [i16], 16, (add AX, DX)>; def GR32_AD : RegisterClass<"X86", [i32], 32, (add EAX, EDX)>; +def GR64_AD : RegisterClass<"X86", [i64], 64, (add RAX, RDX)>; // Scalar SSE2 floating point registers. def FR32 : RegisterClass<"X86", [f32], 32, (sequence "XMM%u", 0, 15)>; From owner-svn-src-all@freebsd.org Sat Apr 15 22:42:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B024D3F238; Sat, 15 Apr 2017 22:42:25 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB9E71988; Sat, 15 Apr 2017 22:42:24 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FMgNhm068155; Sat, 15 Apr 2017 22:42:23 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FMgNIN068154; Sat, 15 Apr 2017 22:42:23 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201704152242.v3FMgNIN068154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 15 Apr 2017 22:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316990 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 22:42:25 -0000 Author: neel Date: Sat Apr 15 22:42:23 2017 New Revision: 316990 URL: https://svnweb.freebsd.org/changeset/base/316990 Log: Due to time constraints remove myself as a vmm(4) maintainer. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Sat Apr 15 22:34:22 2017 (r316989) +++ head/MAINTAINERS Sat Apr 15 22:42:23 2017 (r316990) @@ -100,7 +100,7 @@ usr.sbin/bsdconfig dteske Pre-commit pha usr.sbin/dpv dteske Pre-commit review requested. Keep in sync with libdpv. usr.sbin/pkg pkg@ Please coordinate behavior or flag changes with pkg team. usr.sbin/sysrc dteske Pre-commit phabricator review requested. Keep in sync with bsdconfig(8) sysrc.subr. -vmm(4) neel,grehan Pre-commit review requested. +vmm(4) grehan Pre-commit review requested. autofs(5) trasz Pre-commit review recommended. iscsi(4) trasz Pre-commit review recommended. rctl(8) trasz Pre-commit review recommended. From owner-svn-src-all@freebsd.org Sat Apr 15 22:57:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABDB3D3F813; Sat, 15 Apr 2017 22:57:29 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73F9D688; Sat, 15 Apr 2017 22:57:29 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id k87so107654920ioi.0; Sat, 15 Apr 2017 15:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OWtmZI9sf3A3VqmNufh3ckeDqMK/qXVEZPLGD6HwSDY=; b=ipH8mWdaul0UslTF9N4e52zo6ojusIat5jyG6FTLeFY3AvYBcT+GV9A8vg4k9aBvIR aaJnIy0wUqWkJyFuX24MIGI4i+5r8WXZzOvRHin6TrkX1WipQIiKK4aV7YcGk6jRvps0 BOzGikc8RTBGCFDgzlwWHCPx3Rmrp5wum/oLekkD6x2ScjYcJtqxVClN8rtxaPvplsdK ClUhzNcf4P5vpmuRk8obXA1wqDOWB8ovD7WjWYTcnsFWyOUaJ9Urn0LYm+jVt/Sls2ma Zezp5IMk6lljPe6JjjhxQOraEYEg1xJr5e6Emw80qTKakthNUXM0mYexsXeFCB85/j3e eOwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OWtmZI9sf3A3VqmNufh3ckeDqMK/qXVEZPLGD6HwSDY=; b=fA+7DvrN0M3nEyPwSbd/iwkqJI8wBF/696Wtwiw1tv+n4XwE1nc2zYCCMjDTbBHL+/ dj9NRuCcGhfULwLrEmRWTPsaL33knc39Vdxc15AZa3YtAYYghXR/VNkLtGQP0USpLpQa HCZOPi6uL+b+fw4TinZMHNCFmGBUKQLI+IuH+D1ENhwA/UiA3fwGUQpNPMwuwrruagxr mfnwzRpCrdOpNcTIg67WQFzMrNepigF0Ub8N9WrozyZJoiKAPExKnqvCGefUsLPNJaMZ pZ2aWb8knP6/H5Wcl1jicm6hWzPks+4gAF3McA8E80J8Db8a3nvk4xSOKk7syUrbixzH hrug== X-Gm-Message-State: AN3rC/6AGbIPKlAy5YdxQfyz/p/CsY+Hnb8QfL6hLSnniRVhqzlDzJUC 04TjdgqgR/9hySAYfvl9LHUuIOPYJw== X-Received: by 10.107.156.200 with SMTP id f191mr3713256ioe.9.1492297048711; Sat, 15 Apr 2017 15:57:28 -0700 (PDT) MIME-Version: 1.0 Sender: rizzo.unipi@gmail.com Received: by 10.107.173.165 with HTTP; Sat, 15 Apr 2017 15:57:27 -0700 (PDT) In-Reply-To: <201704152242.v3FMgNIN068154@repo.freebsd.org> References: <201704152242.v3FMgNIN068154@repo.freebsd.org> From: Luigi Rizzo Date: Sat, 15 Apr 2017 15:57:27 -0700 X-Google-Sender-Auth: EHWlRKKr3d3Wn8g7JHgVL6ipxZ4 Message-ID: Subject: Re: svn commit: r316990 - head To: Neel Natu Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 22:57:29 -0000 On Sunday, April 16, 2017, Neel Natu wrote: > Author: neel > Date: Sat Apr 15 22:42:23 2017 > New Revision: 316990 > URL: https://svnweb.freebsd.org/changeset/base/316990 > > Log: > Due to time constraints remove myself as a vmm(4) maintainer. Too bad, when i saw the email I was going to reply "welcome back!" > Modified: > head/MAINTAINERS > > Modified: head/MAINTAINERS > ============================================================ > ================== > --- head/MAINTAINERS Sat Apr 15 22:34:22 2017 (r316989) > +++ head/MAINTAINERS Sat Apr 15 22:42:23 2017 (r316990) > @@ -100,7 +100,7 @@ usr.sbin/bsdconfig dteske Pre-commit pha > usr.sbin/dpv dteske Pre-commit review requested. Keep in sync with > libdpv. > usr.sbin/pkg pkg@ Please coordinate behavior or flag changes with > pkg team. > usr.sbin/sysrc dteske Pre-commit phabricator review requested. Keep in > sync with bsdconfig(8) sysrc.subr. > -vmm(4) neel,grehan Pre-commit review requested. > +vmm(4) grehan Pre-commit review requested. > autofs(5) trasz Pre-commit review recommended. > iscsi(4) trasz Pre-commit review recommended. > rctl(8) trasz Pre-commit review recommended. > > -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2217533 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+------------------------------- From owner-svn-src-all@freebsd.org Sat Apr 15 23:34:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92145D3F010; Sat, 15 Apr 2017 23:34:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62523175; Sat, 15 Apr 2017 23:34:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3FNY5uL088004; Sat, 15 Apr 2017 23:34:05 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3FNY51Z088003; Sat, 15 Apr 2017 23:34:05 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704152334.v3FNY51Z088003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 15 Apr 2017 23:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316991 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 23:34:06 -0000 Author: cy Date: Sat Apr 15 23:34:05 2017 New Revision: 316991 URL: https://svnweb.freebsd.org/changeset/base/316991 Log: Clean up extraneous brackets. Modified: head/sys/contrib/ipfilter/netinet/ip_state.c Modified: head/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_state.c Sat Apr 15 22:42:23 2017 (r316990) +++ head/sys/contrib/ipfilter/netinet/ip_state.c Sat Apr 15 23:34:05 2017 (r316991) @@ -3414,8 +3414,8 @@ ipf_state_check(fin, passp) * If this packet is a fragment and the rule says to track fragments, * then create a new fragment cache entry. */ - if (((fin->fin_flx & FI_FRAG) && FR_ISPASS(is->is_pass)) && - ((is->is_pass & FR_KEEPFRAG))) + if (fin->fin_flx & FI_FRAG && FR_ISPASS(is->is_pass) && + is->is_pass & FR_KEEPFRAG) (void) ipf_frag_new(softc, fin, is->is_pass); /* From owner-svn-src-all@freebsd.org Sat Apr 15 23:37:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A255D3F0D8; Sat, 15 Apr 2017 23:37:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4D7E688; Sat, 15 Apr 2017 23:37:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3FNb2u1014054; Sat, 15 Apr 2017 16:37:02 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3FNb2m1014053; Sat, 15 Apr 2017 16:37:02 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd In-Reply-To: <201704152005.v3FK5M2j002459@repo.freebsd.org> To: Baptiste Daroussin Date: Sat, 15 Apr 2017 16:37:02 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 23:37:06 -0000 And we need this in base for what great purpose??? > Author: bapt > Date: Sat Apr 15 20:05:22 2017 > New Revision: 316978 > URL: https://svnweb.freebsd.org/changeset/base/316978 > > Log: > Import zstandard 1.1.4 in base > > zstandard is a new compression library/tool which is very fast at > compression/decompression > > For now import as a private library > > Added: > head/contrib/zstd/ > - copied from r316976, vendor/zstd/dist/ > head/lib/libzstd/ > head/lib/libzstd/Makefile (contents, props changed) > head/usr.bin/zstd/ > head/usr.bin/zstd/Makefile (contents, props changed) > Modified: > head/etc/mtree/BSD.usr.dist > head/lib/Makefile > head/share/mk/src.libnames.mk > head/usr.bin/Makefile > > Modified: head/etc/mtree/BSD.usr.dist > ============================================================================== > --- head/etc/mtree/BSD.usr.dist Sat Apr 15 20:03:50 2017 (r316977) > +++ head/etc/mtree/BSD.usr.dist Sat Apr 15 20:05:22 2017 (r316978) > @@ -17,6 +17,8 @@ > .. > ucl > .. > + zstd > + .. > .. > .. > lib > > Modified: head/lib/Makefile > ============================================================================== > --- head/lib/Makefile Sat Apr 15 20:03:50 2017 (r316977) > +++ head/lib/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -90,6 +90,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ > libxo \ > liby \ > libz \ > + libzstd \ > ncurses > > # Inter-library dependencies. When the makefile for a library contains LDADD > > Added: head/lib/libzstd/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libzstd/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -0,0 +1,34 @@ > +# $FreeBSD$ > + > +LIB= zstd > +SRCS= entropy_common.c \ > + error_private.c \ > + fse_decompress.c \ > + pool.c \ > + threading.c \ > + xxhash.c \ > + zstd_common.c \ > + fse_compress.c \ > + huf_compress.c \ > + zstd_compress.c \ > + zstdmt_compress.c \ > + huf_decompress.c \ > + zstd_decompress.c \ > + zbuff_common.c \ > + zbuff_compress.c \ > + zbuff_decompress.c \ > + cover.c \ > + divsufsort.c \ > + zdict.c > +WARNS= 2 > +INCS= zstd.h > +CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ > + > +PRIVATELIB= yes > + > +ZSTDDIR= ${SRCTOP}/contrib/zstd > +.PATH: ${ZSTDDIR}/lib/common ${ZSTDDIR}/lib/compress \ > + ${ZSTDDIR}/lib/decompress ${ZSTDDIR}/lib/deprecated \ > + ${ZSTDDIR}/lib/dictBuilder ${ZSTDDIR}/lib > + > +.include > > Modified: head/share/mk/src.libnames.mk > ============================================================================== > --- head/share/mk/src.libnames.mk Sat Apr 15 20:03:50 2017 (r316977) > +++ head/share/mk/src.libnames.mk Sat Apr 15 20:05:22 2017 (r316978) > @@ -24,7 +24,8 @@ _PRIVATELIBS= \ > sqlite3 \ > ssh \ > ucl \ > - unbound > + unbound \ > + zstd > > _INTERNALLIBS= \ > amu \ > > Modified: head/usr.bin/Makefile > ============================================================================== > --- head/usr.bin/Makefile Sat Apr 15 20:03:50 2017 (r316977) > +++ head/usr.bin/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -189,7 +189,8 @@ SUBDIR= alias \ > xo \ > xz \ > xzdec \ > - yes > + yes \ > + zstd > > # NB: keep these sorted by MK_* knobs > > > Added: head/usr.bin/zstd/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/zstd/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -0,0 +1,21 @@ > +# $FreeBSD$ > + > +PROG= zstd > +SRCS= bench.c \ > + datagen.c \ > + dibio.c \ > + fileio.c \ > + zstdcli.c > + > +CFLAGS+= -I${SRCTOP}/contrib/zstd/programs \ > + -I${SRCTOP}/contrib/zstd/lib/common \ > + -I${SRCTOP}/contrib/zstd/lib/compress \ > + -I${SRCTOP}/contrib/zstd/lib/dictBuilder \ > + -I${SRCTOP}/contrib/zstd/lib \ > + -DXXH_NAMESPACE=ZSTD_ > + > +WARNS= 2 > +LIBADD= zstd > +.PATH: ${SRCTOP}/contrib/zstd/programs > + > +.include > > -- Rod Grimes rgrimes@freebsd.org