From owner-svn-src-stable-10@freebsd.org Sun Mar 13 01:08:14 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3786BA92BBF; Sun, 13 Mar 2016 01:08:14 +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 07E14DB1; Sun, 13 Mar 2016 01:08:13 +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 u2D18D3F084909; Sun, 13 Mar 2016 01:08:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D18BgG084886; Sun, 13 Mar 2016 01:08:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603130108.u2D18BgG084886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Mar 2016 01:08:11 +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: r296782 - stable/10/tools/regression/geom_eli X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:08:14 -0000 Author: ngie Date: Sun Mar 13 01:08:10 2016 New Revision: 296782 URL: https://svnweb.freebsd.org/changeset/base/296782 Log: MFC r293436: - Add a conf.sh file for executing common functions with geli -- Use linear probing to find the first unique md(4) device, unlike the other code which uses attach_md, as geli(8) allocates the md(4) devices itself - Don't hardcode /tmp for temporary files, which violates the kyua sandbox Added: stable/10/tools/regression/geom_eli/conf.sh - copied unchanged from r293436, head/tools/regression/geom_eli/conf.sh Modified: stable/10/tools/regression/geom_eli/attach-d.t stable/10/tools/regression/geom_eli/configure-b-B.t stable/10/tools/regression/geom_eli/delkey.t stable/10/tools/regression/geom_eli/detach-l.t stable/10/tools/regression/geom_eli/init-B.t stable/10/tools/regression/geom_eli/init-J.t stable/10/tools/regression/geom_eli/init-a.t stable/10/tools/regression/geom_eli/init-i-P.t stable/10/tools/regression/geom_eli/init.t stable/10/tools/regression/geom_eli/integrity-copy.t stable/10/tools/regression/geom_eli/integrity-data.t stable/10/tools/regression/geom_eli/integrity-hmac.t stable/10/tools/regression/geom_eli/kill.t stable/10/tools/regression/geom_eli/nokey.t stable/10/tools/regression/geom_eli/onetime-a.t stable/10/tools/regression/geom_eli/onetime-d.t stable/10/tools/regression/geom_eli/onetime.t stable/10/tools/regression/geom_eli/readonly.t stable/10/tools/regression/geom_eli/resize.t stable/10/tools/regression/geom_eli/setkey.t Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/geom_eli/attach-d.t ============================================================================== --- stable/10/tools/regression/geom_eli/attach-d.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/attach-d.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..3" @@ -34,5 +35,4 @@ else echo "not ok 3" fi -mdconfig -d -u $no rm -f $keyfile Copied: stable/10/tools/regression/geom_eli/conf.sh (from r293436, head/tools/regression/geom_eli/conf.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/regression/geom_eli/conf.sh Sun Mar 13 01:08:10 2016 (r296782, copy of r293436, head/tools/regression/geom_eli/conf.sh) @@ -0,0 +1,21 @@ +#!/bin/sh +# $FreeBSD$ + +class="eli" +base=`basename $0` + +# We need to use linear probing in order to detect the first available md(4) +# device instead of using mdconfig -a -t, because geli(8) attachs md(4) devices +no=0 +while [ -c /dev/md$no ]; do + : $(( no += 1 )) +done + +geli_test_cleanup() +{ + [ -c /dev/md${no}.eli ] && geli detach md${no}.eli + mdconfig -d -u $no +} +trap geli_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh Modified: stable/10/tools/regression/geom_eli/configure-b-B.t ============================================================================== --- stable/10/tools/regression/geom_eli/configure-b-B.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/configure-b-B.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 @@ -126,5 +127,3 @@ if [ $? -eq 0 ]; then else echo "not ok 17" fi - -mdconfig -d -u $no Modified: stable/10/tools/regression/geom_eli/delkey.t ============================================================================== --- stable/10/tools/regression/geom_eli/delkey.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/delkey.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,13 +1,14 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile2=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile3=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile4=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +keyfile3=`mktemp $base.XXXXXX` || exit 1 +keyfile4=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..14" @@ -136,5 +137,4 @@ else echo "not ok 14" fi -mdconfig -d -u $no rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 Modified: stable/10/tools/regression/geom_eli/detach-l.t ============================================================================== --- stable/10/tools/regression/geom_eli/detach-l.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/detach-l.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..4" @@ -40,5 +41,4 @@ else echo "not ok 4" fi -mdconfig -d -u $no rm -f $keyfile Modified: stable/10/tools/regression/geom_eli/init-B.t ============================================================================== --- stable/10/tools/regression/geom_eli/init-B.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/init-B.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,11 +1,12 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -backupfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 +backupfile=`mktemp $base.XXXXXX` || exit 1 echo "1..13" @@ -99,8 +100,5 @@ if [ -c /dev/md${no}.eli ]; then else echo "not ok 13 - -B file" fi -geli detach md${no} -rm -f $backupfile -mdconfig -d -u $no -rm -f $keyfile +rm -f $backupfile $keyfile Modified: stable/10/tools/regression/geom_eli/init-J.t ============================================================================== --- stable/10/tools/regression/geom_eli/init-J.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/init-J.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,13 +1,14 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile0=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -passfile0=`mktemp /tmp/$base.XXXXXX` || exit 1 -passfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile0=`mktemp $base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +passfile0=`mktemp $base.XXXXXX` || exit 1 +passfile1=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..150" @@ -122,5 +123,4 @@ for iter in -1 0 64; do echo "ok ${i}"; i=$((i+1)) done -mdconfig -d -u $no rm -f ${keyfile0} ${keyfile1} ${passfile0} ${passfile1} Modified: stable/10/tools/regression/geom_eli/init-a.t ============================================================================== --- stable/10/tools/regression/geom_eli/init-a.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/init-a.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 echo "1..1380" @@ -26,7 +27,7 @@ for cipher in aes:0 aes:128 aes:256 \ keylen=${cipher##*:} for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 + rnd=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 Modified: stable/10/tools/regression/geom_eli/init-i-P.t ============================================================================== --- stable/10/tools/regression/geom_eli/init-i-P.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/init-i-P.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..1" @@ -18,5 +19,4 @@ else echo "not ok 1" fi -mdconfig -d -u $no rm -f $keyfile Modified: stable/10/tools/regression/geom_eli/init.t ============================================================================== --- stable/10/tools/regression/geom_eli/init.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/init.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 echo "1..460" @@ -25,7 +26,7 @@ for cipher in aes:0 aes:128 aes:256 \ ealgo=${cipher%%:*} keylen=${cipher##*:} for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 + rnd=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 Modified: stable/10/tools/regression/geom_eli/integrity-copy.t ============================================================================== --- stable/10/tools/regression/geom_eli/integrity-copy.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/integrity-copy.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,11 +1,12 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sector=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 echo "1..5520" Modified: stable/10/tools/regression/geom_eli/integrity-data.t ============================================================================== --- stable/10/tools/regression/geom_eli/integrity-data.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/integrity-data.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,11 +1,12 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sector=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 echo "1..2760" Modified: stable/10/tools/regression/geom_eli/integrity-hmac.t ============================================================================== --- stable/10/tools/regression/geom_eli/integrity-hmac.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/integrity-hmac.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,11 +1,12 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sector=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 echo "1..2760" Modified: stable/10/tools/regression/geom_eli/kill.t ============================================================================== --- stable/10/tools/regression/geom_eli/kill.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/kill.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,11 +1,12 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile2=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..9" @@ -93,5 +94,4 @@ else echo "not ok 9" fi -mdconfig -d -u $no rm -f $keyfile1 $keyfile2 Modified: stable/10/tools/regression/geom_eli/nokey.t ============================================================================== --- stable/10/tools/regression/geom_eli/nokey.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/nokey.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..8" @@ -61,5 +62,4 @@ else echo "not ok 8" fi -mdconfig -d -u $no rm -f $keyfile Modified: stable/10/tools/regression/geom_eli/onetime-a.t ============================================================================== --- stable/10/tools/regression/geom_eli/onetime-a.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/onetime-a.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 echo "1..1380" @@ -25,7 +26,7 @@ for cipher in aes:0 aes:128 aes:256 \ keylen=${cipher##*:} for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 + rnd=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 geli onetime -a $aalgo -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null Modified: stable/10/tools/regression/geom_eli/onetime-d.t ============================================================================== --- stable/10/tools/regression/geom_eli/onetime-d.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/onetime-d.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 mdconfig -a -t malloc -s $sectors -u $no || exit 1 Modified: stable/10/tools/regression/geom_eli/onetime.t ============================================================================== --- stable/10/tools/regression/geom_eli/onetime.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/onetime.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 echo "1..460" @@ -24,7 +25,7 @@ for cipher in aes:0 aes:128 aes:256 \ ealgo=${cipher%%:*} keylen=${cipher##*:} for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 + rnd=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $secsize \* $sectors`b -u $no || exit 1 geli onetime -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null Modified: stable/10/tools/regression/geom_eli/readonly.t ============================================================================== --- stable/10/tools/regression/geom_eli/readonly.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/readonly.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..11" Modified: stable/10/tools/regression/geom_eli/resize.t ============================================================================== --- stable/10/tools/regression/geom_eli/resize.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/resize.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,7 +1,8 @@ -#! /bin/sh -# +#!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + echo 1..27 BLK=512 @@ -22,8 +23,6 @@ setsize() { # Initialise -kldload geom_eli >/dev/null 2>&1 - setsize 10 40 || echo -n "not " echo ok $i - "Sized ${md}a to 10m" i=$((i + 1)) @@ -145,6 +144,5 @@ echo ok $i - "Attached ${md}p1.eli" i=$((i + 1)) geli detach ${md}p1.eli -mdconfig -du$unit rm tmp.* Modified: stable/10/tools/regression/geom_eli/setkey.t ============================================================================== --- stable/10/tools/regression/geom_eli/setkey.t Sat Mar 12 23:53:20 2016 (r296781) +++ stable/10/tools/regression/geom_eli/setkey.t Sun Mar 13 01:08:10 2016 (r296782) @@ -1,15 +1,16 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile2=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile3=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile4=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile5=`mktemp /tmp/$base.XXXXXX` || exit 1 +rnd=`mktemp $base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +keyfile3=`mktemp $base.XXXXXX` || exit 1 +keyfile4=`mktemp $base.XXXXXX` || exit 1 +keyfile5=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..16" @@ -152,5 +153,4 @@ else echo "not ok 16" fi -mdconfig -d -u $no rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 $keyfile5 From owner-svn-src-stable-10@freebsd.org Sun Mar 13 01:13:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88EC1A92E62; Sun, 13 Mar 2016 01:13:00 +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 497991B1; Sun, 13 Mar 2016 01:13:00 +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 u2D1Cx8S087939; Sun, 13 Mar 2016 01:12:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D1CxOi087936; Sun, 13 Mar 2016 01:12:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603130112.u2D1CxOi087936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Mar 2016 01:12: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: r296783 - stable/10/tools/regression/geom_nop X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:13:00 -0000 Author: ngie Date: Sun Mar 13 01:12:58 2016 New Revision: 296783 URL: https://svnweb.freebsd.org/changeset/base/296783 Log: MFC r293437: - Add a conf.sh file for executing common functions with gnop - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox Modified: stable/10/tools/regression/geom_nop/conf.sh stable/10/tools/regression/geom_nop/test-1.t stable/10/tools/regression/geom_nop/test-2.t Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/geom_nop/conf.sh ============================================================================== --- stable/10/tools/regression/geom_nop/conf.sh Sun Mar 13 01:08:10 2016 (r296782) +++ stable/10/tools/regression/geom_nop/conf.sh Sun Mar 13 01:12:58 2016 (r296783) @@ -4,4 +4,11 @@ class="nop" base=`basename $0` +gnop_test_cleanup() +{ + [ -c /dev/${us}.nop ] && gnop destroy ${us}.nop + geom_test_cleanup +} +trap gnop_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: stable/10/tools/regression/geom_nop/test-1.t ============================================================================== --- stable/10/tools/regression/geom_nop/test-1.t Sun Mar 13 01:08:10 2016 (r296782) +++ stable/10/tools/regression/geom_nop/test-1.t Sun Mar 13 01:12:58 2016 (r296783) @@ -5,21 +5,16 @@ echo "1..1" -us=45 +us=$(attach_md -t malloc -s 1M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 - -gnop create /dev/md${us} || exit 1 +gnop create /dev/${us} || exit 1 # Size of created device should be 1MB. -size=`diskinfo /dev/md${us}.nop | awk '{print $3}'` +size=`diskinfo /dev/${us}.nop | awk '{print $3}'` if [ $size -eq 1048576 ]; then echo "ok 1" else echo "not ok 1" fi - -gnop destroy md${us}.nop -mdconfig -d -u $us Modified: stable/10/tools/regression/geom_nop/test-2.t ============================================================================== --- stable/10/tools/regression/geom_nop/test-2.t Sun Mar 13 01:08:10 2016 (r296782) +++ stable/10/tools/regression/geom_nop/test-2.t Sun Mar 13 01:12:58 2016 (r296783) @@ -3,20 +3,19 @@ . `dirname $0`/conf.sh -us=45 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 echo "1..1" dd if=/dev/random of=${src} bs=1m count=1 >/dev/null 2>&1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 +us=$(attach_md -t malloc -s 1M) || exit 1 -gnop create /dev/md${us} || exit 1 +gnop create /dev/${us} || exit 1 -dd if=${src} of=/dev/md${us}.nop bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/md${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1 +dd if=${src} of=/dev/${us}.nop bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 1" @@ -24,6 +23,4 @@ else echo "ok 1" fi -gnop destroy md${us}.nop -mdconfig -d -u $us rm -f ${src} ${dst} From owner-svn-src-stable-10@freebsd.org Sun Mar 13 01:14:10 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 738D3A92ED5; Sun, 13 Mar 2016 01:14:10 +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 3B1B532D; Sun, 13 Mar 2016 01:14:10 +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 u2D1E9KH088053; Sun, 13 Mar 2016 01:14:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D1E8a6088040; Sun, 13 Mar 2016 01:14:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603130114.u2D1E8a6088040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Mar 2016 01:14:08 +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: r296784 - stable/10/tools/regression/geom_raid3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:14:10 -0000 Author: ngie Date: Sun Mar 13 01:14:07 2016 New Revision: 296784 URL: https://svnweb.freebsd.org/changeset/base/296784 Log: MFC r293438: - Add a geom_raid3 specific cleanup function and trap on that function at exit so things are cleaned up properly - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox Modified: stable/10/tools/regression/geom_raid3/conf.sh stable/10/tools/regression/geom_raid3/test-1.t stable/10/tools/regression/geom_raid3/test-10.t stable/10/tools/regression/geom_raid3/test-11.t stable/10/tools/regression/geom_raid3/test-12.t stable/10/tools/regression/geom_raid3/test-2.t stable/10/tools/regression/geom_raid3/test-3.t stable/10/tools/regression/geom_raid3/test-4.t stable/10/tools/regression/geom_raid3/test-5.t stable/10/tools/regression/geom_raid3/test-6.t stable/10/tools/regression/geom_raid3/test-7.t stable/10/tools/regression/geom_raid3/test-8.t stable/10/tools/regression/geom_raid3/test-9.t Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/geom_raid3/conf.sh ============================================================================== --- stable/10/tools/regression/geom_raid3/conf.sh Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/conf.sh Sun Mar 13 01:14:07 2016 (r296784) @@ -5,4 +5,11 @@ name="$(mktemp -u graid3.XXXXXX)" class="raid3" base=`basename $0` +graid3_test_cleanup() +{ + [ -c /dev/$class/$name ] && graid3 stop $name + geom_test_cleanup +} +trap graid3_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: stable/10/tools/regression/geom_raid3/test-1.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-1.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-1.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,15 +5,11 @@ echo "1..2" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 devwait # Size of created device should be 2MB - 1024B. @@ -30,8 +26,3 @@ if [ $sectorsize -eq 1024 ]; then else echo "not ok 2" fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: stable/10/tools/regression/geom_raid3/test-10.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-10.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-10.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label -r $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -r $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,8 +29,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_raid3/test-11.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-11.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-11.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,8 +29,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_raid3/test-12.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-12.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-12.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,31 +5,28 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` nblocks1=9 nblocks2=`expr $nblocks1 - 1` nblocks3=`expr $nblocks2 / 2` -mdconfig -a -t malloc -s $nblocks1 -u $us0 || exit 1 -mdconfig -a -t malloc -s $nblocks1 -u $us1 || exit 1 -mdconfig -a -t malloc -s $nblocks1 -u $us2 || exit 1 - -dd if=/dev/random of=/dev/md${us0} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/md${us1} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/md${us2} count=$nblocks1 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $nblocks1) || exit 1 +us1=$(attach_md -t malloc -s $nblocks1) || exit 1 +us2=$(attach_md -t malloc -s $nblocks1) || exit 1 + +dd if=/dev/random of=/dev/${us0} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us1} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us2} count=$nblocks1 >/dev/null 2>&1 -graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # Wait for synchronization. sleep 2 graid3 stop $name # Break one component. -dd if=/dev/random of=/dev/md${us1} count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us1} count=$nblocks2 >/dev/null 2>&1 # Provoke retaste of the rest components. -true > /dev/md${us0} -true > /dev/md${us2} +true > /dev/${us0} +true > /dev/${us2} sleep 1 dd if=/dev/raid3/${name} of=/dev/null bs=1k count=$nblocks3 >/dev/null 2>&1 @@ -39,8 +36,3 @@ if [ $ec -eq 0 ]; then else echo "ok 1" fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: stable/10/tools/regression/geom_raid3/test-2.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-2.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-2.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,8 +29,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_raid3/test-3.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-3.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-3.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -36,8 +33,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_raid3/test-4.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-4.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-4.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # @@ -36,8 +33,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_raid3/test-5.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-5.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-5.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # @@ -36,8 +33,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_raid3/test-6.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-6.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-6.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -29,7 +26,7 @@ dd if=${src} of=/dev/raid3/${name} bs=$d # Rebuild of DATA component. # graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 graid3 insert -n 1 $name md${us1} sleep 1 @@ -40,8 +37,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_raid3/test-7.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-7.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-7.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -29,12 +26,12 @@ dd if=${src} of=/dev/raid3/${name} bs=$d # Rebuild of PARITY component. # graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 graid3 insert -n 2 $name md${us2} sleep 1 # Remove DATA component, so PARITY component can be used while reading. graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -43,8 +40,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_raid3/test-8.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-8.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-8.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,29 +5,26 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # # Writing without DATA component and rebuild of DATA component. # graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 graid3 insert -n 1 $name md${us1} sleep 1 @@ -39,8 +36,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_raid3/test-9.t ============================================================================== --- stable/10/tools/regression/geom_raid3/test-9.t Sun Mar 13 01:12:58 2016 (r296783) +++ stable/10/tools/regression/geom_raid3/test-9.t Sun Mar 13 01:14:07 2016 (r296784) @@ -5,35 +5,32 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # # Writing without PARITY component and rebuild of PARITY component. # graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 graid3 insert -n 2 $name md${us2} sleep 1 # Remove DATA component, so PARITY component can be used while reading. graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -42,8 +39,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} From owner-svn-src-stable-10@freebsd.org Sun Mar 13 01:15:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0942FACD062; Sun, 13 Mar 2016 01:15:36 +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 D7E5A8B0; Sun, 13 Mar 2016 01:15:35 +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 u2D1FY7M088165; Sun, 13 Mar 2016 01:15:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D1FYWN088162; Sun, 13 Mar 2016 01:15:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603130115.u2D1FYWN088162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Mar 2016 01: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: r296785 - stable/10/tools/regression/geom_shsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:15:36 -0000 Author: ngie Date: Sun Mar 13 01:15:34 2016 New Revision: 296785 URL: https://svnweb.freebsd.org/changeset/base/296785 Log: MFC r293441: - Add a geom_shsec specific cleanup function and trap on that function at exit so things are cleaned up properly - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox Modified: stable/10/tools/regression/geom_shsec/conf.sh stable/10/tools/regression/geom_shsec/test-1.t stable/10/tools/regression/geom_shsec/test-2.t Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/geom_shsec/conf.sh ============================================================================== --- stable/10/tools/regression/geom_shsec/conf.sh Sun Mar 13 01:14:07 2016 (r296784) +++ stable/10/tools/regression/geom_shsec/conf.sh Sun Mar 13 01:15:34 2016 (r296785) @@ -5,4 +5,11 @@ name="$(mktemp -u shsec.XXXXXX)" class="shsec" base=`basename $0` +shsec_test_cleanup() +{ + [ -c /dev/$class/$name ] && gshsec stop $name + geom_test_cleanup +} +trap shsec_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: stable/10/tools/regression/geom_shsec/test-1.t ============================================================================== --- stable/10/tools/regression/geom_shsec/test-1.t Sun Mar 13 01:14:07 2016 (r296784) +++ stable/10/tools/regression/geom_shsec/test-1.t Sun Mar 13 01:15:34 2016 (r296785) @@ -5,15 +5,11 @@ echo "1..2" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 - -gshsec label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 +gshsec label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 devwait # Size of created device should be 1MB - 512B. @@ -30,8 +26,3 @@ if [ $sectorsize -eq 512 ]; then else echo "not ok 2" fi - -gshsec stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: stable/10/tools/regression/geom_shsec/test-2.t ============================================================================== --- stable/10/tools/regression/geom_shsec/test-2.t Sun Mar 13 01:14:07 2016 (r296784) +++ stable/10/tools/regression/geom_shsec/test-2.t Sun Mar 13 01:15:34 2016 (r296785) @@ -5,21 +5,18 @@ echo "1..4" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` nblocks1=1024 nblocks2=`expr $nblocks1 + 1` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} count=$nblocks1 >/dev/null 2>&1 -mdconfig -a -t malloc -s $nblocks2 -u $us0 || exit 1 -mdconfig -a -t malloc -s $nblocks2 -u $us1 || exit 1 -mdconfig -a -t malloc -s $nblocks2 -u $us2 || exit 1 +us0=$(attach_md -t malloc -s $nblocks2) || exit 1 +us1=$(attach_md -t malloc -s $nblocks2) || exit 1 +us2=$(attach_md -t malloc -s $nblocks2) || exit 1 -gshsec label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gshsec label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait dd if=${src} of=/dev/shsec/${name} count=$nblocks1 >/dev/null 2>&1 @@ -31,29 +28,25 @@ else echo "ok 1" fi -dd if=/dev/md${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -dd if=/dev/md${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then echo "not ok 3" else echo "ok 3" fi -dd if=/dev/md${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then echo "not ok 4" else echo "ok 4" fi -gshsec stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} From owner-svn-src-stable-10@freebsd.org Sun Mar 13 01:16:52 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38D8EACD133; Sun, 13 Mar 2016 01:16:52 +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 13C18A26; Sun, 13 Mar 2016 01:16:52 +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 u2D1GpSI088278; Sun, 13 Mar 2016 01:16:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D1Go4N088275; Sun, 13 Mar 2016 01:16:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603130116.u2D1Go4N088275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Mar 2016 01:16:50 +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: r296786 - stable/10/tools/regression/geom_stripe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:16:52 -0000 Author: ngie Date: Sun Mar 13 01:16:50 2016 New Revision: 296786 URL: https://svnweb.freebsd.org/changeset/base/296786 Log: MFC r293442: - Add a geom_stripe specific cleanup function and trap on that function at exit so things are cleaned up properly - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox Modified: stable/10/tools/regression/geom_stripe/conf.sh stable/10/tools/regression/geom_stripe/test-1.t stable/10/tools/regression/geom_stripe/test-2.t Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/geom_stripe/conf.sh ============================================================================== --- stable/10/tools/regression/geom_stripe/conf.sh Sun Mar 13 01:15:34 2016 (r296785) +++ stable/10/tools/regression/geom_stripe/conf.sh Sun Mar 13 01:16:50 2016 (r296786) @@ -5,4 +5,11 @@ name="$(mktemp -u stripe.XXXXXX)" class="stripe" base=`basename $0` +gstripe_test_cleanup() +{ + [ -c /dev/$class/$name ] && gstripe destroy $name + geom_test_cleanup +} +trap gstripe_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: stable/10/tools/regression/geom_stripe/test-1.t ============================================================================== --- stable/10/tools/regression/geom_stripe/test-1.t Sun Mar 13 01:15:34 2016 (r296785) +++ stable/10/tools/regression/geom_stripe/test-1.t Sun Mar 13 01:16:50 2016 (r296786) @@ -5,13 +5,11 @@ echo "1..1" -us=45 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 - -gstripe create -s 16384 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gstripe create -s 16384 $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait # Size of created device should be 1MB * 3. @@ -23,8 +21,3 @@ if [ $size -eq 3145728 ]; then else echo "not ok 1" fi - -gstripe destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` Modified: stable/10/tools/regression/geom_stripe/test-2.t ============================================================================== --- stable/10/tools/regression/geom_stripe/test-2.t Sun Mar 13 01:15:34 2016 (r296785) +++ stable/10/tools/regression/geom_stripe/test-2.t Sun Mar 13 01:16:50 2016 (r296786) @@ -5,18 +5,17 @@ echo "1..1" -us=45 tsize=3 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -gstripe create -s 8192 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gstripe create -s 8192 $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait dd if=${src} of=/dev/stripe/${name} bs=1m count=$tsize >/dev/null 2>&1 @@ -28,8 +27,4 @@ else echo "ok 1" fi -gstripe destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` rm -f ${src} ${dst} From owner-svn-src-stable-10@freebsd.org Sun Mar 13 01:17:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5775ACD1DA; Sun, 13 Mar 2016 01:17:54 +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 84F9AB9B; Sun, 13 Mar 2016 01:17:54 +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 u2D1HrWC088391; Sun, 13 Mar 2016 01:17:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D1HrhG088388; Sun, 13 Mar 2016 01:17:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603130117.u2D1HrhG088388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Mar 2016 01:17:53 +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: r296787 - stable/10/tools/regression/geom_uzip X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:17:55 -0000 Author: ngie Date: Sun Mar 13 01:17:53 2016 New Revision: 296787 URL: https://svnweb.freebsd.org/changeset/base/296787 Log: MFC r293443: - Make test-1.sh into a TAP testable testcase - Delete test-2.sh as it was an incomplete testcase, and the contents were basically a subset of test-1.sh - Add a conf.sh file for executing common functions with geom_uzip - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox Added: stable/10/tools/regression/geom_uzip/conf.sh - copied unchanged from r293443, head/tools/regression/geom_uzip/conf.sh stable/10/tools/regression/geom_uzip/test-1.t - copied unchanged from r293443, head/tools/regression/geom_uzip/test-1.t Deleted: stable/10/tools/regression/geom_uzip/runtests.sh stable/10/tools/regression/geom_uzip/test-1.sh stable/10/tools/regression/geom_uzip/test-2.sh Modified: stable/10/tools/regression/geom_uzip/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/geom_uzip/Makefile ============================================================================== --- stable/10/tools/regression/geom_uzip/Makefile Sun Mar 13 01:16:50 2016 (r296786) +++ stable/10/tools/regression/geom_uzip/Makefile Sun Mar 13 01:17:53 2016 (r296787) @@ -9,7 +9,7 @@ ZIMAGE= ${IMAGE}.uzip UZIMAGE= ${ZIMAGE}.uue test: - @sh runtests.sh + prove -rv ./test-1.t image: makefs -s 1048576 ${IMAGE} etalon Copied: stable/10/tools/regression/geom_uzip/conf.sh (from r293443, head/tools/regression/geom_uzip/conf.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/regression/geom_uzip/conf.sh Sun Mar 13 01:17:53 2016 (r296787, copy of r293443, head/tools/regression/geom_uzip/conf.sh) @@ -0,0 +1,20 @@ +#!/bin/sh +# $FreeBSD$ + +class="uzip" +base=`basename $0` + +uzip_test_cleanup() +{ + if [ -n "$mntpoint" ]; then + umount $mntpoint + rmdir $mntpoint + fi + geom_test_cleanup +} +trap uzip_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh + +# NOTE: make sure $TMPDIR has been set by geom_subr.sh if unset [by kyua, etc] +mntpoint=$(mktemp -d tmp.XXXXXX) || exit Copied: stable/10/tools/regression/geom_uzip/test-1.t (from r293443, head/tools/regression/geom_uzip/test-1.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/regression/geom_uzip/test-1.t Sun Mar 13 01:17:53 2016 (r296787, copy of r293443, head/tools/regression/geom_uzip/test-1.t) @@ -0,0 +1,22 @@ +#!/bin/sh +# $FreeBSD$ + +testsdir=$(dirname $0) +. $testsdir/conf.sh + +echo "1..1" + +UUE=$testsdir/test-1.img.uzip.uue +uudecode $UUE +us0=$(attach_md -f $(basename $UUE .uue)) || exit 1 +sleep 1 + +mount -o ro /dev/${us0}.uzip "${mntpoint}" || exit 1 + +#cat "${mntpoint}/etalon.txt" +diff -I '\$FreeBSD.*\$' -u $testsdir/etalon/etalon.txt "${mntpoint}/etalon.txt" +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi From owner-svn-src-stable-10@freebsd.org Sun Mar 13 01:20:21 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E169BACD31A; Sun, 13 Mar 2016 01:20:21 +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 B2075D26; Sun, 13 Mar 2016 01:20:21 +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 u2D1KKPW088568; Sun, 13 Mar 2016 01:20:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D1KK7o088567; Sun, 13 Mar 2016 01:20:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603130120.u2D1KK7o088567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Mar 2016 01:20:20 +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: r296788 - stable/10/usr.sbin/makefs/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:20:22 -0000 Author: ngie Date: Sun Mar 13 01:20:20 2016 New Revision: 296788 URL: https://svnweb.freebsd.org/changeset/base/296788 Log: MFC r294891: Require /sbin/mount_cd9660 when running the cd9660 tests In some cases the test system might not have mount_cd9660(8). Don't implicitly rely on it while testing cd9660 support; explicitly rely on it Modified: stable/10/usr.sbin/makefs/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/tests/Makefile ============================================================================== --- stable/10/usr.sbin/makefs/tests/Makefile Sun Mar 13 01:17:53 2016 (r296787) +++ stable/10/usr.sbin/makefs/tests/Makefile Sun Mar 13 01:20:20 2016 (r296788) @@ -10,6 +10,8 @@ BINDIR= ${TESTSDIR} SCRIPTS+= makefs_tests_common.sh SCRIPTSNAME_makefs_tests_common.sh= makefs_tests_common.sh +TEST_METADATA.makefs_cd9660_tests+= required_files="/sbin/mount_cd9660" + .for t in ${ATF_TESTS_SH} TEST_METADATA.$t+= required_user="root" .endfor From owner-svn-src-stable-10@freebsd.org Sun Mar 13 08:19:28 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97D65A92F8A; Sun, 13 Mar 2016 08:19:28 +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 69D88928; Sun, 13 Mar 2016 08:19:28 +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 u2D8JRBh016970; Sun, 13 Mar 2016 08:19:27 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D8JRoW016969; Sun, 13 Mar 2016 08:19:27 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603130819.u2D8JRoW016969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 13 Mar 2016 08:19: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: r296797 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 08:19:28 -0000 Author: dchagin Date: Sun Mar 13 08:19:27 2016 New Revision: 296797 URL: https://svnweb.freebsd.org/changeset/base/296797 Log: MFC r296542: Load linux64 module for amd64 if Linux abi enabled. Modified: stable/10/etc/rc.d/abi Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/abi ============================================================================== --- stable/10/etc/rc.d/abi Sun Mar 13 02:09:01 2016 (r296796) +++ stable/10/etc/rc.d/abi Sun Mar 13 08:19:27 2016 (r296797) @@ -27,6 +27,11 @@ linux_start() echo -n ' linux' load_kld -e 'linux(aout|elf)' linux + case `sysctl -n hw.machine_arch` in + amd64) + load_kld -e 'linux64elf' linux64 + ;; + esac if [ -x /compat/linux/sbin/ldconfigDisabled ]; then _tmpdir=`mktemp -d -t linux-ldconfig` /compat/linux/sbin/ldconfig -C ${_tmpdir}/ld.so.cache From owner-svn-src-stable-10@freebsd.org Sun Mar 13 08:45:55 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CA2AACD98A; Sun, 13 Mar 2016 08:45:55 +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 098D83A7; Sun, 13 Mar 2016 08:45:54 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id f1elaaepB0h8Nf1emal7kC; Sun, 13 Mar 2016 01:45:48 -0700 X-Authority-Analysis: v=2.1 cv=VIR9547X c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=7OsogOcEt9IA:10 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=YxBL1-UpAAAA:8 a=PhbfG9F-uBuFTiT_oKMA:9 a=CjuIK1q_8ugA:10 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 2737913751; Sun, 13 Mar 2016 00:45:47 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u2D8jkV3006111; Sun, 13 Mar 2016 00:45:46 -0800 (PST) (envelope-from Cy.Schubert@komquats.com) Message-Id: <201603130845.u2D8jkV3006111@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.komquats.com/ To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r296781 - in stable/10: crypto/openssh crypto/openssh/contrib crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-compat crypto/openssh/regress crypto/opens... In-Reply-To: Message from =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= of "Sat, 12 Mar 2016 23:53:20 +0000." <201603122353.u2CNrK3g063288@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 13 Mar 2016 00:45:46 -0800 X-CMAE-Envelope: MS4wfHRgXqZSWi7Rf7QLgGdyItQbWExZTjgl4Vq86664wOFMJZxpzf0rXV9AM4hloahGPpycwJyF3dya3U4lWt11Rsjbn7GorIPSbHaQHbw7QsYIGGrTy+f6 3wFVplEGOtK2E9FY4lwrxjp63cWeU+M7K4/KPv80GW/XzDkP0M9+B9B5VZDxyG80rDcIJnsbDmOomf8QnMs7iXiqKwYEESIPTCWTsqH3s4ZvXxXox6dyoUZ8 +Wptb4jAUbWed9RHrfxByC3mZuSQnlXt0pHD3Bq5aTABBtHkCXQS0tMGHTLOGJvjRekjUQfKnfHjCn3jRc2BuuwRBN+UHbcOWstUnBObcTk= X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 08:45:55 -0000 In message <201603122353.u2CNrK3g063288@repo.freebsd.org>, =?UTF-8?Q?Dag-Erling _Sm=c3=b8rgrav?= writes: > Author: des > Date: Sat Mar 12 23:53:20 2016 > New Revision: 296781 > URL: https://svnweb.freebsd.org/changeset/base/296781 > > Log: > MFH (r296633): upgrade to 7.2p2 (fixes xauth command injection bug) > MFH (r296634): re-add aes-cbc to server-side default cipher list > MFH (r296651, r296657): fix gcc build of pam_ssh > > PR: 207679 > Security: CVE-2016-3115 [...] Thanks. -- Cheers, Cy Schubert or FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-stable-10@freebsd.org Sun Mar 13 18:32:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35A6BACFF41; Sun, 13 Mar 2016 18:32:12 +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 0281CBDB; Sun, 13 Mar 2016 18:32:11 +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 u2DIWAPd012212; Sun, 13 Mar 2016 18:32:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DIWA7q012211; Sun, 13 Mar 2016 18:32:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201603131832.u2DIWA7q012211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 13 Mar 2016 18:32: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: r296800 - stable/10/contrib/llvm/lib/CodeGen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 18:32:12 -0000 Author: dim Date: Sun Mar 13 18:32:10 2016 New Revision: 296800 URL: https://svnweb.freebsd.org/changeset/base/296800 Log: Pull in r219512 from upstream llvm trunk (by Hal Finkel): [MiSched] Fix a logic error in tryPressure() Fixes a logic error in the MachineScheduler found by Steve Montgomery (and confirmed by Andy). This has gone unfixed for months because the fix has been found to introduce some small performance regressions. However, Andy has recommended that, at this point, we fix this to avoid further dependence on the incorrect behavior (and then follow-up separately on any regressions), and I agree. Fixes PR18883. This fixes a possible "ran out of registers" error when compiling www/firefox 45.0 on i386. Direct commit to stable/10, because head already has this fix since the llvm/clang 3.6.0 import. PR: 207837 Modified: stable/10/contrib/llvm/lib/CodeGen/MachineScheduler.cpp Modified: stable/10/contrib/llvm/lib/CodeGen/MachineScheduler.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/MachineScheduler.cpp Sun Mar 13 14:53:12 2016 (r296799) +++ stable/10/contrib/llvm/lib/CodeGen/MachineScheduler.cpp Sun Mar 13 18:32:10 2016 (r296800) @@ -2365,8 +2365,8 @@ static bool tryPressure(const PressureCh } // If one candidate decreases and the other increases, go with it. // Invalid candidates have UnitInc==0. - if (tryLess(TryP.getUnitInc() < 0, CandP.getUnitInc() < 0, TryCand, Cand, - Reason)) { + if (tryGreater(TryP.getUnitInc() < 0, CandP.getUnitInc() < 0, TryCand, Cand, + Reason)) { return true; } // If the candidates are decreasing pressure, reverse priority. From owner-svn-src-stable-10@freebsd.org Sun Mar 13 18:34:33 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97CA1ACF100; Sun, 13 Mar 2016 18:34:33 +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 4E40B105A; Sun, 13 Mar 2016 18:34:33 +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 u2DIYWhg012416; Sun, 13 Mar 2016 18:34:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DIYWcl012415; Sun, 13 Mar 2016 18:34:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201603131834.u2DIYWcl012415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 13 Mar 2016 18:34: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: r296802 - stable/10/contrib/llvm/patches X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 18:34:33 -0000 Author: dim Date: Sun Mar 13 18:34:32 2016 New Revision: 296802 URL: https://svnweb.freebsd.org/changeset/base/296802 Log: Add patch corresponding to r296800. Added: stable/10/contrib/llvm/patches/patch-r296800-llvm-r219512-out-of-registers.diff Added: stable/10/contrib/llvm/patches/patch-r296800-llvm-r219512-out-of-registers.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/patches/patch-r296800-llvm-r219512-out-of-registers.diff Sun Mar 13 18:34:32 2016 (r296802) @@ -0,0 +1,33 @@ +Pull in r219512 from upstream llvm trunk (by Hal Finkel): + + [MiSched] Fix a logic error in tryPressure() + + Fixes a logic error in the MachineScheduler found by Steve Montgomery + (and confirmed by Andy). This has gone unfixed for months because the + fix has been found to introduce some small performance regressions. + However, Andy has recommended that, at this point, we fix this to + avoid further dependence on the incorrect behavior (and then + follow-up separately on any regressions), and I agree. + + Fixes PR18883. + +This fixes a possible "ran out of registers" error when compiling +www/firefox 45.0 on i386. + +Introduced here: http://svnweb.freebsd.org/changeset/base/xxxxxx + +Index: lib/CodeGen/MachineScheduler.cpp +=================================================================== +--- lib/CodeGen/MachineScheduler.cpp ++++ lib/CodeGen/MachineScheduler.cpp +@@ -2365,8 +2365,8 @@ static bool tryPressure(const PressureChange &TryP + } + // If one candidate decreases and the other increases, go with it. + // Invalid candidates have UnitInc==0. +- if (tryLess(TryP.getUnitInc() < 0, CandP.getUnitInc() < 0, TryCand, Cand, +- Reason)) { ++ if (tryGreater(TryP.getUnitInc() < 0, CandP.getUnitInc() < 0, TryCand, Cand, ++ Reason)) { + return true; + } + // If the candidates are decreasing pressure, reverse priority. From owner-svn-src-stable-10@freebsd.org Sun Mar 13 23:29:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FCB5ACFEF7; Sun, 13 Mar 2016 23:29:13 +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 61F5D6DB; Sun, 13 Mar 2016 23:29:13 +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 u2DNTCDU003352; Sun, 13 Mar 2016 23:29:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DNTCPV003348; Sun, 13 Mar 2016 23:29:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603132329.u2DNTCPV003348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Mar 2016 23:29: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: r296814 - stable/10/tools/regression/geom_gate X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 23:29:13 -0000 Author: ngie Date: Sun Mar 13 23:29:11 2016 New Revision: 296814 URL: https://svnweb.freebsd.org/changeset/base/296814 Log: MFC r293621,r293622,r293815: r293621: - Delete non-TAP testcases - Add a conf.sh file for executing common functions with geom_gate - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox - Add/increase sleeps to try and improve synchronization - Add debug output for when checksums fail test-1.t: - Use pkill for killing ggated r293622: Remove Makefile now that the testcases are all TAP based and prove -rv can be used on them r293815: Add conf.sh file missed in r293621 Added: stable/10/tools/regression/geom_gate/conf.sh - copied unchanged from r293815, head/tools/regression/geom_gate/conf.sh Deleted: stable/10/tools/regression/geom_gate/Makefile stable/10/tools/regression/geom_gate/runtests.sh stable/10/tools/regression/geom_gate/test-1.sh stable/10/tools/regression/geom_gate/test-2.sh stable/10/tools/regression/geom_gate/test-3.sh Modified: stable/10/tools/regression/geom_gate/test-1.t stable/10/tools/regression/geom_gate/test-2.t stable/10/tools/regression/geom_gate/test-3.t Directory Properties: stable/10/ (props changed) Copied: stable/10/tools/regression/geom_gate/conf.sh (from r293815, head/tools/regression/geom_gate/conf.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/regression/geom_gate/conf.sh Sun Mar 13 23:29:11 2016 (r296814, copy of r293815, head/tools/regression/geom_gate/conf.sh) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +name="$(mktemp -u gate.XXXXXX)" +class="gate" +base=`basename $0` + +kldstat -q -m g_${class} || kldload geom_${class} || exit 1 + +. `dirname $0`/../geom_subr.sh Modified: stable/10/tools/regression/geom_gate/test-1.t ============================================================================== --- stable/10/tools/regression/geom_gate/test-1.t Sun Mar 13 22:54:14 2016 (r296813) +++ stable/10/tools/regression/geom_gate/test-1.t Sun Mar 13 23:29:11 2016 (r296814) @@ -1,40 +1,62 @@ #!/bin/sh # $FreeBSD$ -base=`basename $0` -us=45 -work="/dev/md${us}" -src="/dev/md`expr $us + 1`" -conf=`mktemp /tmp/$base.XXXXXX` || exit 1 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`cat $src | md5 -q` - -echo "127.0.0.1 RW $work" > $conf -ggated $conf -ggatec create -u $us 127.0.0.1 $work - -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +. `dirname $0`/conf.sh echo '1..2' -if [ `cat $work | md5 -q` != $sum ]; then - echo 'not ok 1 - md5 checksum' +base=`basename $0` +us=0 +while [ -c /dev/ggate${us} ]; do + : $(( us += 1 )) +done +conf=`mktemp $base.XXXXXX` || exit 1 +pidfile=/var/run/ggated.pid +port=33080 + +work=$(attach_md -t malloc -s 1M) +src=$(attach_md -t malloc -s 1M) + +test_cleanup() +{ + ggatec destroy -f -u $us + pkill -F $pidfile + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM + +dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync +dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync +src_checksum=$(md5 -q /dev/$src) + +echo "127.0.0.1 RW /dev/$work" > $conf + +if ! ggated -p $port $conf; then + echo 'ggated failed to start' + echo 'Bail out!' + exit 1 +fi +sleep 1 +if ! ggatec create -p $port -u $us 127.0.0.1 /dev/$work; then + echo 'ggatec create failed' + echo 'Bail out!' + exit 1 +fi + +dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 +sleep 1 + +work_checksum=$(md5 -q /dev/$work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)" + echo "not ok 2 # SKIP" else echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" else echo 'ok 2 - md5 checksum' fi fi - -ggatec destroy -u $us -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -pkill ggated $conf -rm -f $conf Modified: stable/10/tools/regression/geom_gate/test-2.t ============================================================================== --- stable/10/tools/regression/geom_gate/test-2.t Sun Mar 13 22:54:14 2016 (r296813) +++ stable/10/tools/regression/geom_gate/test-2.t Sun Mar 13 23:29:11 2016 (r296814) @@ -1,31 +1,48 @@ #!/bin/sh # $FreeBSD$ -base=`basename $0` -us=45 -work=`mktemp /tmp/$base.XXXXXX` || exit 1 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`md5 -q $src` +. `dirname $0`/conf.sh -ggatel create -u $us $work +base=`basename $0` +us=46 +work=`mktemp -u $base.XXXXXX` || exit 1 +src=`mktemp -u $base.XXXXXX` || exit 1 + +test_cleanup() +{ + ggatel destroy -f -u $us + rm -f $work $src + + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM + +dd if=/dev/random of=$work bs=1m count=1 conv=sync +dd if=/dev/random of=$src bs=1m count=1 conv=sync + +if ! ggatel create -u $us $work; then + echo 'ggatel create failed' + echo 'Bail out!' + exit 1 +fi -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +dd if=${src} of=/dev/ggate${us} bs=1m count=1 +sleep 1 echo '1..2' -if [ `md5 -q $work` != $sum ]; then - echo 'not ok 1 - md5 checksum' +src_checksum=$(md5 -q $src) +work_checksum=$(md5 -q $work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum) # TODO: bug 204616" + echo 'not ok 2 # SKIP' else echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' + + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" else echo 'ok 2 - md5 checksum' fi fi - -ggatel destroy -u $us -rm -f $work $src Modified: stable/10/tools/regression/geom_gate/test-3.t ============================================================================== --- stable/10/tools/regression/geom_gate/test-3.t Sun Mar 13 22:54:14 2016 (r296813) +++ stable/10/tools/regression/geom_gate/test-3.t Sun Mar 13 23:29:11 2016 (r296814) @@ -1,34 +1,48 @@ #!/bin/sh # $FreeBSD$ +. `dirname $0`/conf.sh + base=`basename $0` -us=45 -work="/dev/md${us}" -src="/dev/md`expr $us + 1`" - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`cat $src | md5 -q` +us=47 -ggatel create -u $us $work +test_cleanup() +{ + ggatel destroy -f -u $us + + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM + +work=$(attach_md -t malloc -s 1M) +src=$(attach_md -t malloc -s 1M) + +dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync +dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync +src_checksum=$(md5 -q /dev/$src) + +if ! ggatel create -u $us /dev/$work; then + echo 'ggatel create failed' + echo 'Bail out!' + exit 1 +fi -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=sync +sleep 1 echo '1..2' -if [ `cat $work | md5 -q` != $sum ]; then - echo 'not ok 1 - md5 checksum' +work_checksum=$(md5 -q /dev/$work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)" + echo 'not ok 2 # SKIP' else echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' + + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" else echo 'ok 2 - md5 checksum' fi fi - -ggatel destroy -u $us -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` From owner-svn-src-stable-10@freebsd.org Sun Mar 13 23:33:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1789ACE2C4; Sun, 13 Mar 2016 23:33:00 +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 A29BFE09; Sun, 13 Mar 2016 23:33:00 +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 u2DNWxlE006253; Sun, 13 Mar 2016 23:32:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DNWxMZ006250; Sun, 13 Mar 2016 23:32:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603132332.u2DNWxMZ006250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Mar 2016 23:32: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: r296815 - stable/10/sbin/ggate/ggated X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 23:33:01 -0000 Author: ngie Date: Sun Mar 13 23:32:59 2016 New Revision: 296815 URL: https://svnweb.freebsd.org/changeset/base/296815 Log: MFC r294973: Add pidfile support to ggated(8) The tests will manipulate the system daemon today, which can cause undesired service interruption when the tests are run. This change allows the geom_gate tests to be run with an arbitrary ggated(8) daemon / geom_gate(4) device pairing. Other changes: - Sort #includes - Use a more common idiom for parsing options with getopt(3) Modified: stable/10/sbin/ggate/ggated/Makefile stable/10/sbin/ggate/ggated/ggated.8 stable/10/sbin/ggate/ggated/ggated.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ggate/ggated/Makefile ============================================================================== --- stable/10/sbin/ggate/ggated/Makefile Sun Mar 13 23:29:11 2016 (r296814) +++ stable/10/sbin/ggate/ggated/Makefile Sun Mar 13 23:32:59 2016 (r296815) @@ -6,8 +6,8 @@ PROG= ggated MAN= ggated.8 SRCS= ggated.c ggate.c -DPADD= ${LIBPTHREAD} -LDADD= -lpthread +DPADD= ${LIBPTHREAD} ${LIBUTIL} +LDADD= -lpthread -lutil CFLAGS+= -I${.CURDIR}/../shared Modified: stable/10/sbin/ggate/ggated/ggated.8 ============================================================================== --- stable/10/sbin/ggate/ggated/ggated.8 Sun Mar 13 23:29:11 2016 (r296814) +++ stable/10/sbin/ggate/ggated/ggated.8 Sun Mar 13 23:32:59 2016 (r296815) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2004 +.Dd January 27, 2016 .Dt GGATED 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Op Fl v .Op Fl a Ar address .Op Fl p Ar port +.Op Fl F Ar pidfile .Op Fl R Ar rcvbuf .Op Fl S Ar sndbuf .Op Ar "exports file" @@ -67,6 +68,10 @@ Port on which .Nm listens for connection. Default is 3080. +.It Fl F Ar pidfile +PID file that +.Nm +uses. .It Fl R Ar rcvbuf Size of receive buffer to use. Default is 131072 (128kB). @@ -86,6 +91,13 @@ The format of an exports file is as foll 1.2.3.0/24 RW /tmp/test.img hostname WO /tmp/image .Ed +.Sh FILES +.Bl -tag -width ".Pa /var/run/ggated.pid" -compact +.It Pa /var/run/ggated.pid +The default location of the +.Nm +PID file. +.El .Sh EXIT STATUS Exit status is 0 on success, or 1 if the command fails. To get details about the failure, Modified: stable/10/sbin/ggate/ggated/ggated.c ============================================================================== --- stable/10/sbin/ggate/ggated/ggated.c Sun Mar 13 23:29:11 2016 (r296814) +++ stable/10/sbin/ggate/ggated/ggated.c Sun Mar 13 23:32:59 2016 (r296815) @@ -26,32 +26,34 @@ * $FreeBSD$ */ -#include -#include -#include -#include -#include -#include #include -#include +#include +#include #include -#include #include +#include +#include #include #include -#include -#include +#include #include #include -#include -#include #include #include #include -#include +#include #include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include "ggate.h" @@ -110,8 +112,8 @@ static void usage(void) { - fprintf(stderr, "usage: %s [-nv] [-a address] [-p port] [-R rcvbuf] " - "[-S sndbuf] [exports file]\n", getprogname()); + fprintf(stderr, "usage: %s [-nv] [-a address] [-F pidfile] [-p port] " + "[-R rcvbuf] [-S sndbuf] [exports file]\n", getprogname()); exit(EXIT_FAILURE); } @@ -946,20 +948,18 @@ huphandler(int sig __unused) int main(int argc, char *argv[]) { + const char *ggated_pidfile = _PATH_VARRUN "/ggated.pid"; + struct pidfh *pfh; struct sockaddr_in serv; struct sockaddr from; socklen_t fromlen; - int sfd, tmpsfd; + pid_t otherpid; + int ch, sfd, tmpsfd; unsigned port; bindaddr = htonl(INADDR_ANY); port = G_GATE_PORT; - for (;;) { - int ch; - - ch = getopt(argc, argv, "a:hnp:R:S:v"); - if (ch == -1) - break; + while ((ch = getopt(argc, argv, "a:hnp:F:R:S:v")) != -1) { switch (ch) { case 'a': bindaddr = g_gate_str2ip(optarg); @@ -968,6 +968,9 @@ main(int argc, char *argv[]) "Invalid IP/host name to bind to."); } break; + case 'F': + ggated_pidfile = optarg; + break; case 'n': nagle = 0; break; @@ -1004,12 +1007,23 @@ main(int argc, char *argv[]) exports_file = argv[0]; exports_get(); + pfh = pidfile_open(ggated_pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(EXIT_FAILURE, "Daemon already running, pid: %jd.", + (intmax_t)otherpid); + } + err(EXIT_FAILURE, "Cannot open/create pidfile"); + } + if (!g_gate_verbose) { /* Run in daemon mode. */ if (daemon(0, 0) == -1) g_gate_xlog("Cannot daemonize: %s", strerror(errno)); } + pidfile_write(pfh); + signal(SIGCHLD, SIG_IGN); sfd = socket(AF_INET, SOCK_STREAM, 0); @@ -1046,5 +1060,6 @@ main(int argc, char *argv[]) close(tmpsfd); } close(sfd); + pidfile_remove(pfh); exit(EXIT_SUCCESS); } From owner-svn-src-stable-10@freebsd.org Mon Mar 14 01:31:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ADE2AD0066; Mon, 14 Mar 2016 01:31:42 +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 0F0F7E3; Mon, 14 Mar 2016 01:31:41 +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 u2E1VfNd040029; Mon, 14 Mar 2016 01:31:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E1VeS5040027; Mon, 14 Mar 2016 01:31:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603140131.u2E1VeS5040027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 14 Mar 2016 01:31: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: r296821 - in stable/10: etc/mtree tests/sys tests/sys/geom tools/regression tools/regression/geom_concat tools/regression/geom_eli tools/regression/geom_gate tools/regression/geom_mirro... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 01:31:42 -0000 Author: ngie Date: Mon Mar 14 01:31:40 2016 New Revision: 296821 URL: https://svnweb.freebsd.org/changeset/base/296821 Log: MFC r293821: Integrate tools/regression/geom_{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip} in to the FreeBSD test suite as tests/sys/geom/class/{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip} The tools/regression/geom and tools/regression/geom_part testcases are being left alone because both test sets are both currently broken. The majority of this work was done on ^/user/ngie/more-tests2 . The differences are as follows: - tests/sys/geom/class/Makefile.inc is not present; it was inlined into the class's Makefiles for explicitness. - The testcases officially require root via kyua - The geom_gate(4) tests don't use the pidfile changes proposed in https://reviews.freebsd.org/D4836 . Added: stable/10/tests/sys/geom/ - copied from r293821, head/tests/sys/geom/ Deleted: stable/10/tools/regression/geom_concat/ stable/10/tools/regression/geom_eli/ stable/10/tools/regression/geom_gate/ stable/10/tools/regression/geom_mirror/ stable/10/tools/regression/geom_nop/ stable/10/tools/regression/geom_raid3/ stable/10/tools/regression/geom_shsec/ stable/10/tools/regression/geom_stripe/ stable/10/tools/regression/geom_subr.sh stable/10/tools/regression/geom_uzip/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/tests/sys/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Mar 14 01:07:34 2016 (r296820) +++ stable/10/etc/mtree/BSD.tests.dist Mon Mar 14 01:31:40 2016 (r296821) @@ -204,6 +204,32 @@ .. file .. + geom + class + concat + .. + eli + .. + gate + .. + gpt + .. + mirror + .. + nop + .. + raid3 + .. + shsec + .. + stripe + .. + uzip + etalon + .. + .. + .. + .. kern acct .. Modified: stable/10/tests/sys/Makefile ============================================================================== --- stable/10/tests/sys/Makefile Mon Mar 14 01:07:34 2016 (r296820) +++ stable/10/tests/sys/Makefile Mon Mar 14 01:31:40 2016 (r296821) @@ -8,6 +8,7 @@ TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file +TESTS_SUBDIRS+= geom TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= kqueue TESTS_SUBDIRS+= mac From owner-svn-src-stable-10@freebsd.org Mon Mar 14 01:35:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09EA7AD0243; Mon, 14 Mar 2016 01:35: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 C09DE6AC; Mon, 14 Mar 2016 01:35: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 u2E1Zkic042252; Mon, 14 Mar 2016 01:35:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E1Zkdn042248; Mon, 14 Mar 2016 01:35:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603140135.u2E1Zkdn042248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 14 Mar 2016 01:35:46 +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: r296822 - stable/10/tests/sys/geom/class/gate X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 01:35:48 -0000 Author: ngie Date: Mon Mar 14 01:35:46 2016 New Revision: 296822 URL: https://svnweb.freebsd.org/changeset/base/296822 Log: MFC r293878,r293880,r295116,r295117,r295477: r293878: Remove unnecessary kldload logic added to geom_subr.sh in r293028 r293880: PID file support hasn't been committed for ggated(8) yet. Unbreak running the testcase more than once by restoring the "killall ggated" r295116: Add an additional 1 second sleep to after calling ggatec before calling dd to defeat a race when writing out to the geom_gate(4) device This will quell the Jenkins failure emails until I come up with a better solution r295117: Use the pidfile support added to ggated(8) in r294973 to ensure that the ggated(8) daemon used by the tests is the instance specifically invoked by the tests instead of one or more daemon instances running on the system r295477: Similar to r295116, add an additional 1 second sleep after calling ggatel before calling dd to defeat a race when writing out to the geom_gate(4) device Modified: stable/10/tests/sys/geom/class/gate/1_test.sh stable/10/tests/sys/geom/class/gate/3_test.sh stable/10/tests/sys/geom/class/gate/conf.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/geom/class/gate/1_test.sh ============================================================================== --- stable/10/tests/sys/geom/class/gate/1_test.sh Mon Mar 14 01:31:40 2016 (r296821) +++ stable/10/tests/sys/geom/class/gate/1_test.sh Mon Mar 14 01:35:46 2016 (r296822) @@ -10,8 +10,8 @@ us=0 while [ -c /dev/ggate${us} ]; do : $(( us += 1 )) done +pidfile=ggated.$$.pid conf=`mktemp $base.XXXXXX` || exit 1 -pidfile=/var/run/ggated.pid port=33080 work=$(attach_md -t malloc -s 1M) @@ -31,7 +31,7 @@ src_checksum=$(md5 -q /dev/$src) echo "127.0.0.1 RW /dev/$work" > $conf -if ! ggated -p $port $conf; then +if ! ggated -p $port -F $pidfile $conf; then echo 'ggated failed to start' echo 'Bail out!' exit 1 @@ -42,6 +42,7 @@ if ! ggatec create -p $port -u $us 127.0 echo 'Bail out!' exit 1 fi +sleep 1 dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 sleep 1 Modified: stable/10/tests/sys/geom/class/gate/3_test.sh ============================================================================== --- stable/10/tests/sys/geom/class/gate/3_test.sh Mon Mar 14 01:31:40 2016 (r296821) +++ stable/10/tests/sys/geom/class/gate/3_test.sh Mon Mar 14 01:35:46 2016 (r296822) @@ -27,6 +27,7 @@ if ! ggatel create -u $us /dev/$work; th exit 1 fi +sleep 1 dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=sync sleep 1 Modified: stable/10/tests/sys/geom/class/gate/conf.sh ============================================================================== --- stable/10/tests/sys/geom/class/gate/conf.sh Mon Mar 14 01:31:40 2016 (r296821) +++ stable/10/tests/sys/geom/class/gate/conf.sh Mon Mar 14 01:35:46 2016 (r296822) @@ -5,6 +5,4 @@ name="$(mktemp -u gate.XXXXXX)" class="gate" base=`basename $0` -kldstat -q -m g_${class} || kldload geom_${class} || exit 1 - . `dirname $0`/../geom_subr.sh From owner-svn-src-stable-10@freebsd.org Mon Mar 14 23:21:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E04EDACFC33; Mon, 14 Mar 2016 23:21:07 +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 BB57D11A0; Mon, 14 Mar 2016 23:21:07 +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 u2ENL6td071231; Mon, 14 Mar 2016 23:21:06 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2ENL6se071230; Mon, 14 Mar 2016 23:21:06 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201603142321.u2ENL6se071230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 14 Mar 2016 23:21: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: r296876 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 23:21:08 -0000 Author: davidcs Date: Mon Mar 14 23:21:06 2016 New Revision: 296876 URL: https://svnweb.freebsd.org/changeset/base/296876 Log: MFC r296579 Fix code so that buf_ring allocation for Tx Queues and their mutexes is done during during bxe_attach() and freed during bxe_detach() Modified: stable/10/sys/dev/bxe/bxe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Mon Mar 14 22:26:45 2016 (r296875) +++ stable/10/sys/dev/bxe/bxe.c Mon Mar 14 23:21:06 2016 (r296876) @@ -680,6 +680,8 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); static int bxe_grc_dump(struct bxe_softc *sc); +static int bxe_alloc_buf_rings(struct bxe_softc *sc); +static void bxe_free_buf_rings(struct bxe_softc *sc); /* calculate crc32 on a buffer (NOTE: crc32_length MUST be aligned to 8) */ uint32_t @@ -4204,9 +4206,20 @@ bxe_nic_unload(struct bxe_softc *sc, { uint8_t global = FALSE; uint32_t val; + int i; BXE_CORE_LOCK_ASSERT(sc); + sc->ifnet->if_drv_flags &= ~IFF_DRV_RUNNING; + + for (i = 0; i < sc->num_queues; i++) { + struct bxe_fastpath *fp; + + fp = &sc->fp[i]; + BXE_FP_TX_LOCK(fp); + BXE_FP_TX_UNLOCK(fp); + } + BLOGD(sc, DBG_LOAD, "Starting NIC unload...\n"); /* mark driver as unloaded in shmem2 */ @@ -6245,8 +6258,6 @@ bxe_free_fp_buffers(struct bxe_softc *sc m_freem(m); BXE_FP_TX_UNLOCK(fp); } - buf_ring_free(fp->tx_br, M_DEVBUF); - fp->tx_br = NULL; } #endif @@ -6276,14 +6287,6 @@ bxe_free_fp_buffers(struct bxe_softc *sc } /* XXX verify all mbufs were reclaimed */ - - if (mtx_initialized(&fp->tx_mtx)) { - mtx_destroy(&fp->tx_mtx); - } - - if (mtx_initialized(&fp->rx_mtx)) { - mtx_destroy(&fp->rx_mtx); - } } } @@ -6505,15 +6508,6 @@ bxe_alloc_fp_buffers(struct bxe_softc *s for (i = 0; i < sc->num_queues; i++) { fp = &sc->fp[i]; -#if __FreeBSD_version >= 800000 - fp->tx_br = buf_ring_alloc(BXE_BR_SIZE, M_DEVBUF, - M_DONTWAIT, &fp->tx_mtx); - if (fp->tx_br == NULL) { - BLOGE(sc, "buf_ring alloc fail for fp[%02d]\n", i); - goto bxe_alloc_fp_buffers_error; - } -#endif - ring_prod = cqe_ring_prod = 0; fp->rx_bd_cons = 0; fp->rx_cq_cons = 0; @@ -9621,14 +9615,6 @@ bxe_init_eth_fp(struct bxe_softc *sc, fp->sc = sc; fp->index = idx; - snprintf(fp->tx_mtx_name, sizeof(fp->tx_mtx_name), - "bxe%d_fp%d_tx_lock", sc->unit, idx); - mtx_init(&fp->tx_mtx, fp->tx_mtx_name, NULL, MTX_DEF); - - snprintf(fp->rx_mtx_name, sizeof(fp->rx_mtx_name), - "bxe%d_fp%d_rx_lock", sc->unit, idx); - mtx_init(&fp->rx_mtx, fp->rx_mtx_name, NULL, MTX_DEF); - fp->igu_sb_id = (sc->igu_base_sb + idx + CNIC_SUPPORT(sc)); fp->fw_sb_id = (sc->base_fw_ndsb + idx + CNIC_SUPPORT(sc)); @@ -15820,6 +15806,89 @@ bxe_add_sysctls(struct bxe_softc *sc) } } +static int +bxe_alloc_buf_rings(struct bxe_softc *sc) +{ +#if __FreeBSD_version >= 800000 + + int i; + struct bxe_fastpath *fp; + + for (i = 0; i < sc->num_queues; i++) { + + fp = &sc->fp[i]; + + fp->tx_br = buf_ring_alloc(BXE_BR_SIZE, M_DEVBUF, + M_NOWAIT, &fp->tx_mtx); + if (fp->tx_br == NULL) + return (-1); + } +#endif + return (0); +} + +static void +bxe_free_buf_rings(struct bxe_softc *sc) +{ +#if __FreeBSD_version >= 800000 + + int i; + struct bxe_fastpath *fp; + + for (i = 0; i < sc->num_queues; i++) { + + fp = &sc->fp[i]; + + if (fp->tx_br) { + buf_ring_free(fp->tx_br, M_DEVBUF); + fp->tx_br = NULL; + } + } + +#endif +} + +static void +bxe_init_fp_mutexs(struct bxe_softc *sc) +{ + int i; + struct bxe_fastpath *fp; + + for (i = 0; i < sc->num_queues; i++) { + + fp = &sc->fp[i]; + + snprintf(fp->tx_mtx_name, sizeof(fp->tx_mtx_name), + "bxe%d_fp%d_tx_lock", sc->unit, i); + mtx_init(&fp->tx_mtx, fp->tx_mtx_name, NULL, MTX_DEF); + + snprintf(fp->rx_mtx_name, sizeof(fp->rx_mtx_name), + "bxe%d_fp%d_rx_lock", sc->unit, i); + mtx_init(&fp->rx_mtx, fp->rx_mtx_name, NULL, MTX_DEF); + } +} + +static void +bxe_destroy_fp_mutexs(struct bxe_softc *sc) +{ + int i; + struct bxe_fastpath *fp; + + for (i = 0; i < sc->num_queues; i++) { + + fp = &sc->fp[i]; + + if (mtx_initialized(&fp->tx_mtx)) { + mtx_destroy(&fp->tx_mtx); + } + + if (mtx_initialized(&fp->rx_mtx)) { + mtx_destroy(&fp->rx_mtx); + } + } +} + + /* * Device attach function. * @@ -15931,8 +16000,25 @@ bxe_attach(device_t dev) return (ENXIO); } + bxe_init_fp_mutexs(sc); + + if (bxe_alloc_buf_rings(sc) != 0) { + bxe_free_buf_rings(sc); + bxe_interrupt_free(sc); + bxe_del_cdev(sc); + if (sc->ifnet != NULL) { + ether_ifdetach(sc->ifnet); + } + ifmedia_removeall(&sc->ifmedia); + bxe_release_mutexes(sc); + bxe_deallocate_bars(sc); + pci_disable_busmaster(dev); + return (ENXIO); + } + /* allocate ilt */ if (bxe_alloc_ilt_mem(sc) != 0) { + bxe_free_buf_rings(sc); bxe_interrupt_free(sc); bxe_del_cdev(sc); if (sc->ifnet != NULL) { @@ -15948,6 +16034,7 @@ bxe_attach(device_t dev) /* allocate the host hardware/software hsi structures */ if (bxe_alloc_hsi_mem(sc) != 0) { bxe_free_ilt_mem(sc); + bxe_free_buf_rings(sc); bxe_interrupt_free(sc); bxe_del_cdev(sc); if (sc->ifnet != NULL) { @@ -16055,12 +16142,16 @@ bxe_detach(device_t dev) /* free ilt */ bxe_free_ilt_mem(sc); + bxe_free_buf_rings(sc); + /* release the interrupts */ bxe_interrupt_free(sc); /* Release the mutexes*/ + bxe_destroy_fp_mutexs(sc); bxe_release_mutexes(sc); + /* Release the PCIe BAR mapped memory */ bxe_deallocate_bars(sc); From owner-svn-src-stable-10@freebsd.org Tue Mar 15 10:45:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 058D9ACF2F2; Tue, 15 Mar 2016 10:45:57 +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 D5FCE216; Tue, 15 Mar 2016 10:45: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 u2FAjtCf082142; Tue, 15 Mar 2016 10:45:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FAjtK2082138; Tue, 15 Mar 2016 10:45:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603151045.u2FAjtK2082138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Mar 2016 10:45: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: r296896 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 10:45:57 -0000 Author: kib Date: Tue Mar 15 10:45:55 2016 New Revision: 296896 URL: https://svnweb.freebsd.org/changeset/base/296896 Log: MFC r296320: Adjust _callout_stop_safe() return value for the subr_sleepqueue.c needs when migrating callout was blocked, but running one was not. PR: 200992 Modified: stable/10/sys/kern/kern_timeout.c stable/10/sys/kern/subr_sleepqueue.c stable/10/sys/sys/callout.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_timeout.c ============================================================================== --- stable/10/sys/kern/kern_timeout.c Tue Mar 15 10:37:19 2016 (r296895) +++ stable/10/sys/kern/kern_timeout.c Tue Mar 15 10:45:55 2016 (r296896) @@ -1114,9 +1114,9 @@ callout_schedule(struct callout *c, int } int -_callout_stop_safe(c, safe) +_callout_stop_safe(c, flags) struct callout *c; - int safe; + int flags; { struct callout_cpu *cc, *old_cc; struct lock_class *class; @@ -1127,7 +1127,7 @@ _callout_stop_safe(c, safe) * Some old subsystems don't hold Giant while running a callout_stop(), * so just discard this check for the moment. */ - if (!safe && c->c_lock != NULL) { + if ((flags & CS_DRAIN) == 0 && c->c_lock != NULL) { if (c->c_lock == &Giant.lock_object) use_lock = mtx_owned(&Giant); else { @@ -1207,7 +1207,7 @@ again: return (0); } - if (safe) { + if ((flags & CS_DRAIN) != 0) { /* * The current callout is running (or just * about to run) and blocking is allowed, so @@ -1319,7 +1319,7 @@ again: CTR3(KTR_CALLOUT, "postponing stop %p func %p arg %p", c, c->c_func, c->c_arg); CC_UNLOCK(cc); - return (0); + return ((flags & CS_MIGRBLOCK) != 0); } CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p", c, c->c_func, c->c_arg); Modified: stable/10/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/10/sys/kern/subr_sleepqueue.c Tue Mar 15 10:37:19 2016 (r296895) +++ stable/10/sys/kern/subr_sleepqueue.c Tue Mar 15 10:45:55 2016 (r296896) @@ -572,7 +572,8 @@ sleepq_check_timeout(void) * another CPU, so synchronize with it to avoid having it * accidentally wake up a subsequent sleep. */ - else if (callout_stop(&td->td_slpcallout) == 0) { + else if (_callout_stop_safe(&td->td_slpcallout, CS_MIGRBLOCK) + == 0) { td->td_flags |= TDF_TIMEOUT; TD_SET_SLEEPING(td); mi_switch(SW_INVOL | SWT_SLEEPQTIMO, NULL); Modified: stable/10/sys/sys/callout.h ============================================================================== --- stable/10/sys/sys/callout.h Tue Mar 15 10:37:19 2016 (r296895) +++ stable/10/sys/sys/callout.h Tue Mar 15 10:45:55 2016 (r296896) @@ -62,6 +62,12 @@ struct callout_handle { struct callout *callout; }; +/* Flags for callout_stop_safe() */ +#define CS_DRAIN 0x0001 /* callout_drain(), wait allowed */ +#define CS_MIGRBLOCK 0x0002 /* Block migration, return value + indicates that the callout was + executing */ + #ifdef _KERNEL /* * Note the flags field is actually *two* fields. The c_flags @@ -81,7 +87,7 @@ struct callout_handle { */ #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) -#define callout_drain(c) _callout_stop_safe(c, 1) +#define callout_drain(c) _callout_stop_safe(c, CS_DRAIN) void callout_init(struct callout *, int); void _callout_init_lock(struct callout *, struct lock_object *, int); #define callout_init_mtx(c, mtx, flags) \ From owner-svn-src-stable-10@freebsd.org Tue Mar 15 17:05:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D90DEAD13A5; Tue, 15 Mar 2016 17:05:29 +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 A92BF1587; Tue, 15 Mar 2016 17:05:29 +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 u2FH5SHN005653; Tue, 15 Mar 2016 17:05:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FH5SD9005652; Tue, 15 Mar 2016 17:05:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603151705.u2FH5SD9005652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Mar 2016 17:05:28 +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: r296911 - stable/10/usr.bin/script X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 17:05:30 -0000 Author: bdrewery Date: Tue Mar 15 17:05:28 2016 New Revision: 296911 URL: https://svnweb.freebsd.org/changeset/base/296911 Log: MFC r296524: Filemon: Attach from the child to avoid racing with the parent attach. Relnotes: yes Modified: stable/10/usr.bin/script/script.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/script/script.c ============================================================================== --- stable/10/usr.bin/script/script.c Tue Mar 15 15:53:37 2016 (r296910) +++ stable/10/usr.bin/script/script.c Tue Mar 15 17:05:28 2016 (r296911) @@ -221,13 +221,19 @@ main(int argc, char *argv[]) warn("fork"); done(1); } - if (child == 0) + if (child == 0) { + if (fflg) { + int pid; + + pid = getpid(); + if (ioctl(fm_fd, FILEMON_SET_PID, &pid) < 0) + err(1, "Cannot set filemon PID"); + } + doshell(argv); + } close(slave); - if (fflg && ioctl(fm_fd, FILEMON_SET_PID, &child) < 0) - err(1, "Cannot set filemon PID"); - start = tvec = time(0); readstdin = 1; for (;;) { From owner-svn-src-stable-10@freebsd.org Tue Mar 15 17:06:41 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91485AD19A9; Tue, 15 Mar 2016 17:06: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 5A9151A60; Tue, 15 Mar 2016 17:06: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 u2FH6eD3005843; Tue, 15 Mar 2016 17:06:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FH6e2K005842; Tue, 15 Mar 2016 17:06:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603151706.u2FH6e2K005842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Mar 2016 17:06: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: r296912 - stable/10/usr.bin/script X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 17:06:41 -0000 Author: bdrewery Date: Tue Mar 15 17:06:40 2016 New Revision: 296912 URL: https://svnweb.freebsd.org/changeset/base/296912 Log: MFC r296525: Just exit in the child if execve(2) fails. Modified: stable/10/usr.bin/script/script.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/script/script.c ============================================================================== --- stable/10/usr.bin/script/script.c Tue Mar 15 17:05:28 2016 (r296911) +++ stable/10/usr.bin/script/script.c Tue Mar 15 17:06:40 2016 (r296912) @@ -80,7 +80,6 @@ static struct termios tt; static void done(int) __dead2; static void doshell(char **); -static void fail(void); static void finish(void); static void record(FILE *, char *, size_t, int); static void consume(FILE *, off_t, char *, int); @@ -342,14 +341,7 @@ doshell(char **av) execl(shell, shell, "-i", (char *)NULL); warn("%s", shell); } - fail(); -} - -static void -fail(void) -{ - (void)kill(0, SIGTERM); - done(1); + exit(1); } static void From owner-svn-src-stable-10@freebsd.org Wed Mar 16 01:48:33 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77DADAD2CC0; Wed, 16 Mar 2016 01:48:33 +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 48C01789; Wed, 16 Mar 2016 01:48:33 +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 u2G1mWdW063992; Wed, 16 Mar 2016 01:48:32 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G1mWT1063991; Wed, 16 Mar 2016 01:48:32 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201603160148.u2G1mWT1063991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 16 Mar 2016 01:48: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: r296923 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 01:48:33 -0000 Author: cy Date: Wed Mar 16 01:48:32 2016 New Revision: 296923 URL: https://svnweb.freebsd.org/changeset/base/296923 Log: MFC r296299 - Remove redundant NULL pointer comparison. Reported by: PVS-Studio (V595) in Differential Revision D5245 Modified: stable/10/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c Wed Mar 16 01:41:55 2016 (r296922) +++ stable/10/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c Wed Mar 16 01:48:32 2016 (r296923) @@ -1951,10 +1951,6 @@ ipf_p_ftp_epsv(softf, fin, ip, nat, ftp, ap += *s++ - '0'; } - if (!s) { - return 0; -} - if (*s == '|') s++; if (*s == ')') From owner-svn-src-stable-10@freebsd.org Wed Mar 16 15:34:17 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5EE8AD3125; Wed, 16 Mar 2016 15:34: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 8D70429F; Wed, 16 Mar 2016 15:34: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 u2GFYGHi016782; Wed, 16 Mar 2016 15:34:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GFYGTT016779; Wed, 16 Mar 2016 15:34:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603161534.u2GFYGTT016779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Mar 2016 15:34:16 +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: r296939 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 15:34:17 -0000 Author: kib Date: Wed Mar 16 15:34:16 2016 New Revision: 296939 URL: https://svnweb.freebsd.org/changeset/base/296939 Log: MFC r296319: Fix handling of DT_TEXTREL for an object with more than one read-only segment. PR: 207631 Modified: stable/10/libexec/rtld-elf/map_object.c stable/10/libexec/rtld-elf/rtld.c stable/10/libexec/rtld-elf/rtld.h Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/map_object.c ============================================================================== --- stable/10/libexec/rtld-elf/map_object.c Wed Mar 16 15:31:09 2016 (r296938) +++ stable/10/libexec/rtld-elf/map_object.c Wed Mar 16 15:34:16 2016 (r296939) @@ -39,7 +39,6 @@ #include "rtld.h" static Elf_Ehdr *get_elf_header(int, const char *); -static int convert_prot(int); /* Elf flags -> mmap protection */ static int convert_flags(int); /* Elf flags -> mmap flags */ /* @@ -439,7 +438,7 @@ obj_new(void) * Given a set of ELF protection flags, return the corresponding protection * flags for MMAP. */ -static int +int convert_prot(int elfflags) { int prot = 0; Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Wed Mar 16 15:31:09 2016 (r296938) +++ stable/10/libexec/rtld-elf/rtld.c Wed Mar 16 15:34:16 2016 (r296939) @@ -2578,6 +2578,40 @@ relocate_object_dag(Obj_Entry *root, boo } /* + * Prepare for, or clean after, relocating an object marked with + * DT_TEXTREL or DF_TEXTREL. Before relocating, all read-only + * segments are remapped read-write. After relocations are done, the + * segment's permissions are returned back to the modes specified in + * the phdrs. If any relocation happened, or always for wired + * program, COW is triggered. + */ +static int +reloc_textrel_prot(Obj_Entry *obj, bool before) +{ + const Elf_Phdr *ph; + void *base; + size_t l, sz; + int prot; + + for (l = obj->phsize / sizeof(*ph), ph = obj->phdr; l > 0; + l--, ph++) { + if (ph->p_type != PT_LOAD || (ph->p_flags & PF_W) != 0) + continue; + base = obj->relocbase + trunc_page(ph->p_vaddr); + sz = round_page(ph->p_vaddr + ph->p_filesz) - + trunc_page(ph->p_vaddr); + prot = convert_prot(ph->p_flags) | (before ? PROT_WRITE : 0); + if (mprotect(base, sz, prot) == -1) { + _rtld_error("%s: Cannot write-%sable text segment: %s", + obj->path, before ? "en" : "dis", + rtld_strerror(errno)); + return (-1); + } + } + return (0); +} + +/* * Relocate single object. * Returns 0 on success, or -1 on failure. */ @@ -2599,28 +2633,17 @@ relocate_object(Obj_Entry *obj, bool bin return (-1); } - if (obj->textrel) { - /* There are relocations to the write-protected text segment. */ - if (mprotect(obj->mapbase, obj->textsize, - PROT_READ|PROT_WRITE|PROT_EXEC) == -1) { - _rtld_error("%s: Cannot write-enable text segment: %s", - obj->path, rtld_strerror(errno)); - return (-1); - } - } + /* There are relocations to the write-protected text segment. */ + if (obj->textrel && reloc_textrel_prot(obj, true) != 0) + return (-1); /* Process the non-PLT non-IFUNC relocations. */ if (reloc_non_plt(obj, rtldobj, flags, lockstate)) return (-1); - if (obj->textrel) { /* Re-protected the text segment. */ - if (mprotect(obj->mapbase, obj->textsize, - PROT_READ|PROT_EXEC) == -1) { - _rtld_error("%s: Cannot write-protect text segment: %s", - obj->path, rtld_strerror(errno)); - return (-1); - } - } + /* Re-protected the text segment. */ + if (obj->textrel && reloc_textrel_prot(obj, false) != 0) + return (-1); /* Set the special PLT or GOT entries. */ init_pltgot(obj); Modified: stable/10/libexec/rtld-elf/rtld.h ============================================================================== --- stable/10/libexec/rtld-elf/rtld.h Wed Mar 16 15:31:09 2016 (r296938) +++ stable/10/libexec/rtld-elf/rtld.h Wed Mar 16 15:34:16 2016 (r296939) @@ -398,6 +398,7 @@ void *allocate_module_tls(int index); bool allocate_tls_offset(Obj_Entry *obj); void free_tls_offset(Obj_Entry *obj); const Ver_Entry *fetch_ventry(const Obj_Entry *obj, unsigned long); +int convert_prot(int elfflags); /* * MD function declarations. From owner-svn-src-stable-10@freebsd.org Wed Mar 16 16:21:31 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B742FAD211F; Wed, 16 Mar 2016 16:21:31 +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 83F88DD4; Wed, 16 Mar 2016 16:21:31 +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 u2GGLUOM031989; Wed, 16 Mar 2016 16:21:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GGLUIL031987; Wed, 16 Mar 2016 16:21:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603161621.u2GGLUIL031987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 16 Mar 2016 16:21: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: r296940 - in stable/10: contrib/llvm/tools/clang/lib/Driver etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 16:21:31 -0000 Author: ian Date: Wed Mar 16 16:21:30 2016 New Revision: 296940 URL: https://svnweb.freebsd.org/changeset/base/296940 Log: MFC r296807: Require firewall setup before running rc.d/netwait, otherwise the ping packets sent by netwait may not get through. PR: 207916 Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp stable/10/etc/rc.d/netwait Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Wed Mar 16 15:34:16 2016 (r296939) +++ stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Wed Mar 16 16:21:30 2016 (r296940) @@ -5777,7 +5777,7 @@ void freebsd::Assemble::ConstructJob(Com } } else if (getToolChain().getArch() == llvm::Triple::arm || getToolChain().getArch() == llvm::Triple::thumb) { - CmdArgs.push_back("-mfpu=softvfp"); + CmdArgs.push_back("-mfpu=vfpv3"); switch(getToolChain().getTriple().getEnvironment()) { case llvm::Triple::GNUEABI: case llvm::Triple::EABI: Modified: stable/10/etc/rc.d/netwait ============================================================================== --- stable/10/etc/rc.d/netwait Wed Mar 16 15:34:16 2016 (r296939) +++ stable/10/etc/rc.d/netwait Wed Mar 16 16:21:30 2016 (r296940) @@ -3,7 +3,7 @@ # $FreeBSD$ # # PROVIDE: netwait -# REQUIRE: devd routing +# REQUIRE: devd ipfilter ipfw pf routing # KEYWORD: nojail # # The netwait script helps handle two situations: From owner-svn-src-stable-10@freebsd.org Wed Mar 16 16:42:03 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B4CBAD28E1; Wed, 16 Mar 2016 16:42: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 B778DAC7; Wed, 16 Mar 2016 16:42:02 +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 u2GGg1U9035972; Wed, 16 Mar 2016 16:42:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GGg1lf035970; Wed, 16 Mar 2016 16:42:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603161642.u2GGg1lf035970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Mar 2016 16:42:01 +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: r296941 - in stable/10/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 16:42:03 -0000 Author: kib Date: Wed Mar 16 16:42:01 2016 New Revision: 296941 URL: https://svnweb.freebsd.org/changeset/base/296941 Log: MFC r296908: Force the desired alignment of the user save area. Modified: stable/10/sys/amd64/amd64/vm_machdep.c stable/10/sys/i386/i386/vm_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/vm_machdep.c Wed Mar 16 16:21:30 2016 (r296940) +++ stable/10/sys/amd64/amd64/vm_machdep.c Wed Mar 16 16:42:01 2016 (r296941) @@ -100,8 +100,8 @@ get_pcb_user_save_td(struct thread *td) vm_offset_t p; p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - cpu_max_ext_state_size; - KASSERT((p % 64) == 0, ("Unaligned pcb_user_save area")); + roundup2(cpu_max_ext_state_size, XSAVE_AREA_ALIGN); + KASSERT((p % XSAVE_AREA_ALIGN) == 0, ("Unaligned pcb_user_save area")); return ((struct savefpu *)p); } @@ -120,7 +120,8 @@ get_pcb_td(struct thread *td) vm_offset_t p; p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - cpu_max_ext_state_size - sizeof(struct pcb); + roundup2(cpu_max_ext_state_size, XSAVE_AREA_ALIGN) - + sizeof(struct pcb); return ((struct pcb *)p); } Modified: stable/10/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/10/sys/i386/i386/vm_machdep.c Wed Mar 16 16:21:30 2016 (r296940) +++ stable/10/sys/i386/i386/vm_machdep.c Wed Mar 16 16:42:01 2016 (r296941) @@ -159,8 +159,8 @@ get_pcb_user_save_td(struct thread *td) { vm_offset_t p; p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - cpu_max_ext_state_size; - KASSERT((p % 64) == 0, ("Unaligned pcb_user_save area")); + roundup2(cpu_max_ext_state_size, XSAVE_AREA_ALIGN); + KASSERT((p % XSAVE_AREA_ALIGN) == 0, ("Unaligned pcb_user_save area")); return ((union savefpu *)p); } @@ -179,7 +179,8 @@ get_pcb_td(struct thread *td) vm_offset_t p; p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - cpu_max_ext_state_size - sizeof(struct pcb); + roundup2(cpu_max_ext_state_size, XSAVE_AREA_ALIGN) - + sizeof(struct pcb); return ((struct pcb *)p); } From owner-svn-src-stable-10@freebsd.org Wed Mar 16 16:50:15 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3637FAD2B05; Wed, 16 Mar 2016 16:50:15 +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 F3A7AEE4; Wed, 16 Mar 2016 16:50:14 +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 u2GGoEUp038522; Wed, 16 Mar 2016 16:50:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GGoE1A038520; Wed, 16 Mar 2016 16:50:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603161650.u2GGoE1A038520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 16 Mar 2016 16:50:13 +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: r296942 - in stable/10: contrib/llvm/tools/clang/lib/Driver etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 16:50:15 -0000 Author: ian Date: Wed Mar 16 16:50:13 2016 New Revision: 296942 URL: https://svnweb.freebsd.org/changeset/base/296942 Log: Revert r296940, it contained unintended changes, and will be redone. Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp stable/10/etc/rc.d/netwait Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Wed Mar 16 16:42:01 2016 (r296941) +++ stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Wed Mar 16 16:50:13 2016 (r296942) @@ -5777,7 +5777,7 @@ void freebsd::Assemble::ConstructJob(Com } } else if (getToolChain().getArch() == llvm::Triple::arm || getToolChain().getArch() == llvm::Triple::thumb) { - CmdArgs.push_back("-mfpu=vfpv3"); + CmdArgs.push_back("-mfpu=softvfp"); switch(getToolChain().getTriple().getEnvironment()) { case llvm::Triple::GNUEABI: case llvm::Triple::EABI: Modified: stable/10/etc/rc.d/netwait ============================================================================== --- stable/10/etc/rc.d/netwait Wed Mar 16 16:42:01 2016 (r296941) +++ stable/10/etc/rc.d/netwait Wed Mar 16 16:50:13 2016 (r296942) @@ -3,7 +3,7 @@ # $FreeBSD$ # # PROVIDE: netwait -# REQUIRE: devd ipfilter ipfw pf routing +# REQUIRE: devd routing # KEYWORD: nojail # # The netwait script helps handle two situations: From owner-svn-src-stable-10@freebsd.org Wed Mar 16 16:52:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1668AD2CE2; Wed, 16 Mar 2016 16:52:32 +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 72B2612E4; Wed, 16 Mar 2016 16:52:32 +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 u2GGqV7B041249; Wed, 16 Mar 2016 16:52:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GGqVmP041248; Wed, 16 Mar 2016 16:52:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603161652.u2GGqVmP041248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 16 Mar 2016 16:52: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: r296943 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 16:52:32 -0000 Author: ian Date: Wed Mar 16 16:52:31 2016 New Revision: 296943 URL: https://svnweb.freebsd.org/changeset/base/296943 Log: MFC r296807: (this time with 100% fewer unintended changes mixed in)... Require firewall setup before running rc.d/netwait, otherwise the ping packets sent by netwait may not get through. PR: 207916 Modified: stable/10/etc/rc.d/netwait Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/netwait ============================================================================== --- stable/10/etc/rc.d/netwait Wed Mar 16 16:50:13 2016 (r296942) +++ stable/10/etc/rc.d/netwait Wed Mar 16 16:52:31 2016 (r296943) @@ -3,7 +3,7 @@ # $FreeBSD$ # # PROVIDE: netwait -# REQUIRE: devd routing +# REQUIRE: devd ipfilter ipfw pf routing # KEYWORD: nojail # # The netwait script helps handle two situations: From owner-svn-src-stable-10@freebsd.org Wed Mar 16 22:35:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CE8CAD3C40; Wed, 16 Mar 2016 22:35:57 +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 F0BD5896; Wed, 16 Mar 2016 22:35:56 +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 u2GMZuTg046156; Wed, 16 Mar 2016 22:35:56 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GMZuku046155; Wed, 16 Mar 2016 22:35:56 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603162235.u2GMZuku046155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 16 Mar 2016 22:35:56 +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: r296957 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 22:35:57 -0000 Author: glebius Date: Wed Mar 16 22:35:55 2016 New Revision: 296957 URL: https://svnweb.freebsd.org/changeset/base/296957 Log: Merge r296956: Due to invalid use of a signed intermediate value in the bounds checking during argument validity verification, unbound zero'ing of the process LDT and adjacent memory can be initiated from usermode. Submitted by: CORE Security Patch by: kib Security: SA-16:15 Modified: stable/10/sys/amd64/amd64/sys_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/sys_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/sys_machdep.c Wed Mar 16 22:33:12 2016 (r296956) +++ stable/10/sys/amd64/amd64/sys_machdep.c Wed Mar 16 22:35:55 2016 (r296957) @@ -591,8 +591,8 @@ amd64_set_ldt(td, uap, descs) struct i386_ldt_args *uap; struct user_segment_descriptor *descs; { - int error = 0, i; - int largest_ld; + int error = 0; + unsigned int largest_ld, i; struct mdproc *mdp = &td->td_proc->p_md; struct proc_ldt *pldt; struct user_segment_descriptor *dp; From owner-svn-src-stable-10@freebsd.org Thu Mar 17 00:32:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4DFFAD2C36; Thu, 17 Mar 2016 00:32:30 +0000 (UTC) (envelope-from mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86219213; Thu, 17 Mar 2016 00:32:30 +0000 (UTC) (envelope-from mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2H0WT6a082648; Thu, 17 Mar 2016 00:32:29 GMT (envelope-from mp@FreeBSD.org) Received: (from mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H0WTDm082647; Thu, 17 Mar 2016 00:32:29 GMT (envelope-from mp@FreeBSD.org) Message-Id: <201603170032.u2H0WTDm082647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mp set sender to mp@FreeBSD.org using -f From: Mark Peek Date: Thu, 17 Mar 2016 00:32:29 +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: r296969 - stable/10/bin/csh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 00:32:30 -0000 Author: mp Date: Thu Mar 17 00:32:29 2016 New Revision: 296969 URL: https://svnweb.freebsd.org/changeset/base/296969 Log: MFC 296416: Signal handling within tcsh vfork code path will conflict with some system libraries (such as libthr) which maintain their own signal state. This change adds the tcsh SAVESIGVEC option to save and restore the sigvecs for the signals the child modifies before it execs. Reviewed by: kib, rwatson Reported by: kib Modified: stable/10/bin/csh/config_p.h Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/csh/config_p.h ============================================================================== --- stable/10/bin/csh/config_p.h Wed Mar 16 23:59:29 2016 (r296968) +++ stable/10/bin/csh/config_p.h Thu Mar 17 00:32:29 2016 (r296969) @@ -80,6 +80,7 @@ /****************** local defines *********************/ #if defined(__FreeBSD__) +#define SAVESIGVEC #define NLS_BUGS #define BSD_STYLE_COLORLS /* Use LC_MESSAGES locale category to open the message catalog */ From owner-svn-src-stable-10@freebsd.org Thu Mar 17 01:02:35 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEA6FAD355E; Thu, 17 Mar 2016 01:02: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 9012E6C9; Thu, 17 Mar 2016 01:02: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 u2H12YDC091857; Thu, 17 Mar 2016 01:02:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H12YXS091856; Thu, 17 Mar 2016 01:02:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603170102.u2H12YXS091856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 17 Mar 2016 01:02: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: r296972 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 01:02:35 -0000 Author: bdrewery Date: Thu Mar 17 01:02:34 2016 New Revision: 296972 URL: https://svnweb.freebsd.org/changeset/base/296972 Log: MFC r296623: Remove redundant files already tracked by tools/build/mk/OptionalObsoleteFiles.inc. Modified: stable/10/ObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Thu Mar 17 00:46:36 2016 (r296971) +++ stable/10/ObsoleteFiles.inc Thu Mar 17 01:02:34 2016 (r296972) @@ -6217,22 +6217,6 @@ OLD_FILES+=usr/share/bsnmp/mibs/FOKUS-MI OLD_FILES+=usr/share/bsnmp/mibs/BEGEMOT-MIB.txt OLD_FILES+=usr/share/bsnmp/mibs/BEGEMOT-SNMPD.txt OLD_FILES+=usr/share/bsnmp/mibs/BEGEMOT-NETGRAPH.txt -OLD_FILES+=usr/libdata/ldscripts/elf64_sparc.x -OLD_FILES+=usr/libdata/ldscripts/elf64_sparc.xbn -OLD_FILES+=usr/libdata/ldscripts/elf64_sparc.xn -OLD_FILES+=usr/libdata/ldscripts/elf64_sparc.xr -OLD_FILES+=usr/libdata/ldscripts/elf64_sparc.xs -OLD_FILES+=usr/libdata/ldscripts/elf64_sparc.xu -OLD_FILES+=usr/libdata/ldscripts/elf64_sparc.xc -OLD_FILES+=usr/libdata/ldscripts/elf64_sparc.xsc -OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.x -OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xbn -OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xn -OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xr -OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xs -OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xu -OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xc -OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xsc OLD_FILES+=usr/libdata/msdosfs/iso22dos OLD_FILES+=usr/libdata/msdosfs/iso72dos OLD_FILES+=usr/libdata/msdosfs/koi2dos From owner-svn-src-stable-10@freebsd.org Thu Mar 17 19:28:17 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0F9BAD393E; Thu, 17 Mar 2016 19:28:17 +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 41DB39E0; Thu, 17 Mar 2016 19:28:17 +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 u2HJSGZW029339; Thu, 17 Mar 2016 19:28:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HJSFBj029325; Thu, 17 Mar 2016 19:28:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603171928.u2HJSFBj029325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 17 Mar 2016 19:28:15 +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: r296992 - in stable/10/sys: conf fs/ext2fs modules/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 19:28:17 -0000 Author: pfg Date: Thu Mar 17 19:28:15 2016 New Revision: 296992 URL: https://svnweb.freebsd.org/changeset/base/296992 Log: MFC r294504, r294652, r294653, r294655: ext2fs: Bring back the htree dir_index implementation. The htree dir_index is perhaps one of the most characteristic features of the linux ext3 implementation. It was removed in r281670, due to repeated bug reports. Damjan Jovanic detected and fixed three bugs and did some stress testing by building Apache OpenOffice on top of it so it is now in good shape to bring back. Differential Revision: https://reviews.freebsd.org/D5007 Submitted by: Damjan Jovanovic Reviewed by: pfg RelNotes: yes Added: stable/10/sys/fs/ext2fs/ext2_hash.c - copied unchanged from r294504, head/sys/fs/ext2fs/ext2_hash.c stable/10/sys/fs/ext2fs/ext2_htree.c - copied, changed from r294504, head/sys/fs/ext2fs/ext2_htree.c Modified: stable/10/sys/conf/files stable/10/sys/fs/ext2fs/ext2_alloc.c stable/10/sys/fs/ext2fs/ext2_dinode.h stable/10/sys/fs/ext2fs/ext2_dir.h stable/10/sys/fs/ext2fs/ext2_extern.h stable/10/sys/fs/ext2fs/ext2_inode_cnv.c stable/10/sys/fs/ext2fs/ext2_lookup.c stable/10/sys/fs/ext2fs/ext2_vfsops.c stable/10/sys/fs/ext2fs/ext2fs.h stable/10/sys/fs/ext2fs/inode.h stable/10/sys/modules/ext2fs/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Mar 17 19:01:44 2016 (r296991) +++ stable/10/sys/conf/files Thu Mar 17 19:28:15 2016 (r296992) @@ -2946,6 +2946,8 @@ fs/ext2fs/ext2_bmap.c optional ext2fs fs/ext2fs/ext2_extents.c optional ext2fs fs/ext2fs/ext2_inode.c optional ext2fs fs/ext2fs/ext2_inode_cnv.c optional ext2fs +fs/ext2fs/ext2_hash.c optional ext2fs +fs/ext2fs/ext2_htree.c optional ext2fs fs/ext2fs/ext2_lookup.c optional ext2fs fs/ext2fs/ext2_subr.c optional ext2fs fs/ext2fs/ext2_vfsops.c optional ext2fs Modified: stable/10/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_alloc.c Thu Mar 17 19:01:44 2016 (r296991) +++ stable/10/sys/fs/ext2fs/ext2_alloc.c Thu Mar 17 19:28:15 2016 (r296992) @@ -393,6 +393,7 @@ ext2_valloc(struct vnode *pvp, int mode, * Linux doesn't read the old inode in when it is allocating a * new one. I will set at least i_size and i_blocks to zero. */ + ip->i_flag = 0; ip->i_size = 0; ip->i_blocks = 0; ip->i_mode = 0; Modified: stable/10/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_dinode.h Thu Mar 17 19:01:44 2016 (r296991) +++ stable/10/sys/fs/ext2fs/ext2_dinode.h Thu Mar 17 19:28:15 2016 (r296992) @@ -51,7 +51,7 @@ /* * Inode flags * The system supports EXT2_IMMUTABLE, EXT2_APPEND and EXT2_NODUMP flags. - * The current implementation also uses EXT4_INDEX, EXT4_EXTENTS and + * The current implementation also uses EXT3_INDEX, EXT4_EXTENTS and * EXT4_HUGE_FILE with some restrictions, imposed the lack of write * support. */ @@ -63,7 +63,7 @@ #define EXT2_APPEND 0x00000020 /* Writes to file may only append */ #define EXT2_NODUMP 0x00000040 /* Do not dump file */ #define EXT2_NOATIME 0x00000080 /* Do not update atime */ -#define EXT4_INDEX 0x00001000 /* Hash-indexed directory */ +#define EXT3_INDEX 0x00001000 /* Hash-indexed directory */ #define EXT4_IMAGIC 0x00002000 /* AFS directory */ #define EXT4_JOURNAL_DATA 0x00004000 /* File data should be journaled */ #define EXT4_NOTAIL 0x00008000 /* File tail should not be merged */ Modified: stable/10/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_dir.h Thu Mar 17 19:01:44 2016 (r296991) +++ stable/10/sys/fs/ext2fs/ext2_dir.h Thu Mar 17 19:28:15 2016 (r296992) @@ -40,6 +40,21 @@ struct ext2fs_direct { uint16_t e2d_namlen; /* length of string in e2d_name */ char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */ }; + +enum slotstatus { + NONE, + COMPACT, + FOUND +}; + +struct ext2fs_searchslot { + enum slotstatus slotstatus; + doff_t slotoffset; /* offset of area with free space */ + int slotsize; /* size of area at slotoffset */ + int slotfreespace; /* amount of space free in slot */ + int slotneeded; /* sizeof the entry we are seeking */ +}; + /* * The new version of the directory entry. Since EXT2 structures are * stored in intel byte order, and the name_len field could never be Modified: stable/10/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_extern.h Thu Mar 17 19:01:44 2016 (r296991) +++ stable/10/sys/fs/ext2fs/ext2_extern.h Thu Mar 17 19:28:15 2016 (r296992) @@ -40,12 +40,15 @@ #define _FS_EXT2FS_EXT2_EXTERN_H_ struct ext2fs_dinode; +struct ext2fs_direct_2; +struct ext2fs_searchslot; struct indir; struct inode; struct mount; struct vfsconf; struct vnode; +int ext2_add_entry(struct vnode *, struct ext2fs_direct_2 *); int ext2_alloc(struct inode *, daddr_t, e4fs_daddr_t, int, struct ucred *, e4fs_daddr_t *); int ext2_balloc(struct inode *, @@ -83,6 +86,18 @@ int ext2_dirempty(struct inode *, ino_t, int ext2_checkpath(struct inode *, struct inode *, struct ucred *); int cg_has_sb(int i); int ext2_inactive(struct vop_inactive_args *); +int ext2_htree_add_entry(struct vnode *, struct ext2fs_direct_2 *, + struct componentname *); +int ext2_htree_create_index(struct vnode *, struct componentname *, + struct ext2fs_direct_2 *); +int ext2_htree_has_idx(struct inode *); +int ext2_htree_hash(const char *, int, uint32_t *, int, uint32_t *, + uint32_t *); +int ext2_htree_lookup(struct inode *, const char *, int, struct buf **, + int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *); +int ext2_search_dirblock(struct inode *, void *, int *, const char *, int, + int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *); + /* Flags to low-level allocation routines. * The low 16-bits are reserved for IO_ flags from vnode.h. Copied: stable/10/sys/fs/ext2fs/ext2_hash.c (from r294504, head/sys/fs/ext2fs/ext2_hash.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/fs/ext2fs/ext2_hash.c Thu Mar 17 19:28:15 2016 (r296992, copy of r294504, head/sys/fs/ext2fs/ext2_hash.c) @@ -0,0 +1,316 @@ +/*- + * Copyright (c) 2010, 2013 Zheng Liu + * Copyright (c) 2012, Vyacheslav Matyushin + * 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 REGENTS 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 REGENTS 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$ + */ + +/* + * The following notice applies to the code in ext2_half_md4(): + * + * Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. + * + * License to copy and use this software is granted provided that it + * is identified as the "RSA Data Security, Inc. MD4 Message-Digest + * Algorithm" in all material mentioning or referencing this software + * or this function. + * + * License is also granted to make and use derivative works provided + * that such works are identified as "derived from the RSA Data + * Security, Inc. MD4 Message-Digest Algorithm" in all material + * mentioning or referencing the derived work. + * + * RSA Data Security, Inc. makes no representations concerning either + * the merchantability of this software or the suitability of this + * software for any particular purpose. It is provided "as is" + * without express or implied warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* F, G, and H are MD4 functions */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) + +/* ROTATE_LEFT rotates x left n bits */ +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) + +/* + * FF, GG, and HH are transformations for rounds 1, 2, and 3. + * Rotation is separated from addition to prevent recomputation. + */ +#define FF(a, b, c, d, x, s) { \ + (a) += F ((b), (c), (d)) + (x); \ + (a) = ROTATE_LEFT ((a), (s)); \ +} + +#define GG(a, b, c, d, x, s) { \ + (a) += G ((b), (c), (d)) + (x) + (uint32_t)0x5A827999; \ + (a) = ROTATE_LEFT ((a), (s)); \ +} + +#define HH(a, b, c, d, x, s) { \ + (a) += H ((b), (c), (d)) + (x) + (uint32_t)0x6ED9EBA1; \ + (a) = ROTATE_LEFT ((a), (s)); \ +} + +/* + * MD4 basic transformation. It transforms state based on block. + * + * This is a half md4 algorithm since Linux uses this algorithm for dir + * index. This function is derived from the RSA Data Security, Inc. MD4 + * Message-Digest Algorithm and was modified as necessary. + * + * The return value of this function is uint32_t in Linux, but actually we don't + * need to check this value, so in our version this function doesn't return any + * value. + */ +static void +ext2_half_md4(uint32_t hash[4], uint32_t data[8]) +{ + uint32_t a = hash[0], b = hash[1], c = hash[2], d = hash[3]; + + /* Round 1 */ + FF(a, b, c, d, data[0], 3); + FF(d, a, b, c, data[1], 7); + FF(c, d, a, b, data[2], 11); + FF(b, c, d, a, data[3], 19); + FF(a, b, c, d, data[4], 3); + FF(d, a, b, c, data[5], 7); + FF(c, d, a, b, data[6], 11); + FF(b, c, d, a, data[7], 19); + + /* Round 2 */ + GG(a, b, c, d, data[1], 3); + GG(d, a, b, c, data[3], 5); + GG(c, d, a, b, data[5], 9); + GG(b, c, d, a, data[7], 13); + GG(a, b, c, d, data[0], 3); + GG(d, a, b, c, data[2], 5); + GG(c, d, a, b, data[4], 9); + GG(b, c, d, a, data[6], 13); + + /* Round 3 */ + HH(a, b, c, d, data[3], 3); + HH(d, a, b, c, data[7], 9); + HH(c, d, a, b, data[2], 11); + HH(b, c, d, a, data[6], 15); + HH(a, b, c, d, data[1], 3); + HH(d, a, b, c, data[5], 9); + HH(c, d, a, b, data[0], 11); + HH(b, c, d, a, data[4], 15); + + hash[0] += a; + hash[1] += b; + hash[2] += c; + hash[3] += d; +} + +/* + * Tiny Encryption Algorithm. + */ +static void +ext2_tea(uint32_t hash[4], uint32_t data[8]) +{ + uint32_t tea_delta = 0x9E3779B9; + uint32_t sum; + uint32_t x = hash[0], y = hash[1]; + int n = 16; + int i = 1; + + while (n-- > 0) { + sum = i * tea_delta; + x += ((y << 4) + data[0]) ^ (y + sum) ^ ((y >> 5) + data[1]); + y += ((x << 4) + data[2]) ^ (x + sum) ^ ((x >> 5) + data[3]); + i++; + } + + hash[0] += x; + hash[1] += y; +} + +static uint32_t +ext2_legacy_hash(const char *name, int len, int unsigned_char) +{ + uint32_t h0, h1 = 0x12A3FE2D, h2 = 0x37ABE8F9; + uint32_t multi = 0x6D22F5; + const unsigned char *uname = (const unsigned char *)name; + const signed char *sname = (const signed char *)name; + int val, i; + + for (i = 0; i < len; i++) { + if (unsigned_char) + val = (u_int)*uname++; + else + val = (int)*sname++; + + h0 = h2 + (h1 ^ (val * multi)); + if (h0 & 0x80000000) + h0 -= 0x7FFFFFFF; + h2 = h1; + h1 = h0; + } + + return (h1 << 1); +} + +static void +ext2_prep_hashbuf(const char *src, int slen, uint32_t *dst, int dlen, + int unsigned_char) +{ + uint32_t padding = slen | (slen << 8) | (slen << 16) | (slen << 24); + uint32_t buf_val; + const unsigned char *ubuf = (const unsigned char *)src; + const signed char *sbuf = (const signed char *)src; + int len, i; + int buf_byte; + + if (slen > dlen) + len = dlen; + else + len = slen; + + buf_val = padding; + + for (i = 0; i < len; i++) { + if (unsigned_char) + buf_byte = (u_int)ubuf[i]; + else + buf_byte = (int)sbuf[i]; + + if ((i % 4) == 0) + buf_val = padding; + + buf_val <<= 8; + buf_val += buf_byte; + + if ((i % 4) == 3) { + *dst++ = buf_val; + dlen -= sizeof(uint32_t); + buf_val = padding; + } + } + + dlen -= sizeof(uint32_t); + if (dlen >= 0) + *dst++ = buf_val; + + dlen -= sizeof(uint32_t); + while (dlen >= 0) { + *dst++ = padding; + dlen -= sizeof(uint32_t); + } +} + +int +ext2_htree_hash(const char *name, int len, + uint32_t *hash_seed, int hash_version, + uint32_t *hash_major, uint32_t *hash_minor) +{ + uint32_t hash[4]; + uint32_t data[8]; + uint32_t major = 0, minor = 0; + int unsigned_char = 0; + + if (!name || !hash_major) + return (-1); + + if (len < 1 || len > 255) + goto error; + + hash[0] = 0x67452301; + hash[1] = 0xEFCDAB89; + hash[2] = 0x98BADCFE; + hash[3] = 0x10325476; + + if (hash_seed) + memcpy(hash, hash_seed, sizeof(hash)); + + switch (hash_version) { + case EXT2_HTREE_TEA_UNSIGNED: + unsigned_char = 1; + /* FALLTHROUGH */ + case EXT2_HTREE_TEA: + while (len > 0) { + ext2_prep_hashbuf(name, len, data, 16, unsigned_char); + ext2_tea(hash, data); + len -= 16; + name += 16; + } + major = hash[0]; + minor = hash[1]; + break; + case EXT2_HTREE_LEGACY_UNSIGNED: + unsigned_char = 1; + /* FALLTHROUGH */ + case EXT2_HTREE_LEGACY: + major = ext2_legacy_hash(name, len, unsigned_char); + break; + case EXT2_HTREE_HALF_MD4_UNSIGNED: + unsigned_char = 1; + /* FALLTHROUGH */ + case EXT2_HTREE_HALF_MD4: + while (len > 0) { + ext2_prep_hashbuf(name, len, data, 32, unsigned_char); + ext2_half_md4(hash, data); + len -= 32; + name += 32; + } + major = hash[1]; + minor = hash[2]; + break; + default: + goto error; + } + + major &= ~1; + if (major == (EXT2_HTREE_EOF << 1)) + major = (EXT2_HTREE_EOF - 1) << 1; + *hash_major = major; + if (hash_minor) + *hash_minor = minor; + + return (0); + +error: + *hash_major = 0; + if (hash_minor) + *hash_minor = 0; + return (-1); +} Copied and modified: stable/10/sys/fs/ext2fs/ext2_htree.c (from r294504, head/sys/fs/ext2fs/ext2_htree.c) ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Thu Jan 21 14:50:28 2016 (r294504, copy source) +++ stable/10/sys/fs/ext2fs/ext2_htree.c Thu Mar 17 19:28:15 2016 (r296992) @@ -90,7 +90,7 @@ int ext2_htree_has_idx(struct inode *ip) { if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) && - ip->i_flag & IN_E4INDEX) + ip->i_flag & IN_E3INDEX) return (1); else return (0); @@ -653,7 +653,7 @@ ext2_htree_create_index(struct vnode *vp ((char *)ep + ep->e2d_reclen); ep->e2d_reclen = buf1 + blksize - (char *)ep; - dp->i_flag |= IN_E4INDEX; + dp->i_flag |= IN_E3INDEX; /* * Initialize index root. Modified: stable/10/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Thu Mar 17 19:01:44 2016 (r296991) +++ stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Thu Mar 17 19:28:15 2016 (r296992) @@ -110,7 +110,7 @@ ext2_ei2i(struct ext2fs_dinode *ei, stru ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0; ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0; ip->i_flags |= (ei->e2di_flags & EXT2_NODUMP) ? UF_NODUMP : 0; - ip->i_flag |= (ei->e2di_flags & EXT4_INDEX) ? IN_E4INDEX : 0; + ip->i_flag |= (ei->e2di_flags & EXT3_INDEX) ? IN_E3INDEX : 0; ip->i_flag |= (ei->e2di_flags & EXT4_EXTENTS) ? IN_E4EXTENTS : 0; ip->i_blocks = ei->e2di_nblock; if (E2DI_HAS_HUGE_FILE(ip)) { @@ -160,7 +160,7 @@ ext2_i2ei(struct inode *ip, struct ext2f ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0; ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0; ei->e2di_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP: 0; - ei->e2di_flags |= (ip->i_flag & IN_E4INDEX) ? EXT4_INDEX: 0; + ei->e2di_flags |= (ip->i_flag & IN_E3INDEX) ? EXT3_INDEX: 0; ei->e2di_flags |= (ip->i_flag & IN_E4EXTENTS) ? EXT4_EXTENTS: 0; ei->e2di_nblock = ip->i_blocks & 0xffffffff; ei->e2di_nblock_high = ip->i_blocks >> 32 & 0xffff; Modified: stable/10/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_lookup.c Thu Mar 17 19:01:44 2016 (r296991) +++ stable/10/sys/fs/ext2fs/ext2_lookup.c Thu Mar 17 19:28:15 2016 (r296992) @@ -113,9 +113,19 @@ static u_char dt_to_ext2_ft[] = { static int ext2_dirbadentry(struct vnode *dp, struct ext2fs_direct_2 *de, int entryoffsetinblock); +static int ext2_is_dot_entry(struct componentname *cnp); static int ext2_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp, ino_t *dd_ino); +static int +ext2_is_dot_entry(struct componentname *cnp) +{ + if (cnp->cn_namelen <= 2 && cnp->cn_nameptr[0] == '.' && + (cnp->cn_nameptr[1] == '.' || cnp->cn_nameptr[1] == '\0')) + return (1); + return (0); +} + /* * Vnode op for reading directories. */ @@ -296,13 +306,9 @@ ext2_lookup_ino(struct vnode *vdp, struc struct buf *bp; /* a buffer of directory entries */ struct ext2fs_direct_2 *ep; /* the current directory entry */ int entryoffsetinblock; /* offset of ep in bp's buffer */ - enum {NONE, COMPACT, FOUND} slotstatus; - doff_t slotoffset; /* offset of area with free space */ + struct ext2fs_searchslot ss; doff_t i_diroff; /* cached i_diroff value */ doff_t i_offset; /* cached i_offset value */ - int slotsize; /* size of area at slotoffset */ - int slotfreespace; /* amount of space free in slot */ - int slotneeded; /* size of the entry we're seeking */ int numdirpasses; /* strategy for directory search */ doff_t endsearch; /* offset to end directory search */ doff_t prevoff; /* prev entry dp->i_offset */ @@ -310,12 +316,13 @@ ext2_lookup_ino(struct vnode *vdp, struc struct vnode *tdp; /* returned by VFS_VGET */ doff_t enduseful; /* pointer past last used dir slot */ u_long bmask; /* block offset mask */ - int namlen, error; + int error; struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; ino_t ino, ino1; int ltype; + int entry_found = 0; int DIRBLKSIZ = VTOI(vdp)->i_e2fs->e2fs_bsize; @@ -326,31 +333,57 @@ ext2_lookup_ino(struct vnode *vdp, struc bmask = VFSTOEXT2(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; restart: bp = NULL; - slotoffset = -1; + ss.slotoffset = -1; /* * We now have a segment name to search for, and a directory to search. - */ - - /* + * * Suppress search for slots unless creating * file and at end of pathname, in which case * we watch for a place to put the new file in * case it doesn't already exist. */ i_diroff = dp->i_diroff; - slotstatus = FOUND; - slotfreespace = slotsize = slotneeded = 0; + ss.slotstatus = FOUND; + ss.slotfreespace = ss.slotsize = ss.slotneeded = 0; if ((nameiop == CREATE || nameiop == RENAME) && (flags & ISLASTCN)) { - slotstatus = NONE; - slotneeded = EXT2_DIR_REC_LEN(cnp->cn_namelen); + ss.slotstatus = NONE; + ss.slotneeded = EXT2_DIR_REC_LEN(cnp->cn_namelen); /* was - slotneeded = (sizeof(struct direct) - MAXNAMLEN + + ss.slotneeded = (sizeof(struct direct) - MAXNAMLEN + cnp->cn_namelen + 3) &~ 3; */ } /* + * Try to lookup dir entry using htree directory index. + * + * If we got an error or we want to find '.' or '..' entry, + * we will fall back to linear search. + */ + if (!ext2_is_dot_entry(cnp) && ext2_htree_has_idx(dp)) { + numdirpasses = 1; + entryoffsetinblock = 0; + switch (ext2_htree_lookup(dp, cnp->cn_nameptr, cnp->cn_namelen, + &bp, &entryoffsetinblock, &i_offset, &prevoff, + &enduseful, &ss)) { + case 0: + ep = (struct ext2fs_direct_2 *)((char *)bp->b_data + + (i_offset & bmask)); + goto foundentry; + case ENOENT: + i_offset = roundup2(dp->i_size, DIRBLKSIZ); + goto notfound; + default: + /* + * Something failed; just fallback to do a linear + * search. + */ + break; + } + } + + /* * If there is cached information on a previous search of * this directory, pick up where we last left off. * We cache only lookups as these are the most common @@ -384,96 +417,38 @@ searchloop: /* * If necessary, get the next directory block. */ - if ((i_offset & bmask) == 0) { - if (bp != NULL) - brelse(bp); - if ((error = - ext2_blkatoff(vdp, (off_t)i_offset, NULL, - &bp)) != 0) - return (error); - entryoffsetinblock = 0; - } + if (bp != NULL) + brelse(bp); + error = ext2_blkatoff(vdp, (off_t)i_offset, NULL, &bp); + if (error != 0) + return (error); + entryoffsetinblock = 0; /* * If still looking for a slot, and at a DIRBLKSIZE * boundary, have to start looking for free space again. */ - if (slotstatus == NONE && + if (ss.slotstatus == NONE && (entryoffsetinblock & (DIRBLKSIZ - 1)) == 0) { - slotoffset = -1; - slotfreespace = 0; + ss.slotoffset = -1; + ss.slotfreespace = 0; } - /* - * Get pointer to next entry. - * Full validation checks are slow, so we only check - * enough to insure forward progress through the - * directory. Complete checks can be run by setting - * "vfs.e2fs.dirchk" to be true. - */ - ep = (struct ext2fs_direct_2 *) - ((char *)bp->b_data + entryoffsetinblock); - if (ep->e2d_reclen == 0 || - (dirchk && ext2_dirbadentry(vdp, ep, entryoffsetinblock))) { - int i; - ext2_dirbad(dp, i_offset, "mangled entry"); - i = DIRBLKSIZ - (entryoffsetinblock & (DIRBLKSIZ - 1)); - i_offset += i; - entryoffsetinblock += i; - continue; - } - - /* - * If an appropriate sized slot has not yet been found, - * check to see if one is available. Also accumulate space - * in the current block so that we can determine if - * compaction is viable. - */ - if (slotstatus != FOUND) { - int size = ep->e2d_reclen; - - if (ep->e2d_ino != 0) - size -= EXT2_DIR_REC_LEN(ep->e2d_namlen); - if (size > 0) { - if (size >= slotneeded) { - slotstatus = FOUND; - slotoffset = i_offset; - slotsize = ep->e2d_reclen; - } else if (slotstatus == NONE) { - slotfreespace += size; - if (slotoffset == -1) - slotoffset = i_offset; - if (slotfreespace >= slotneeded) { - slotstatus = COMPACT; - slotsize = i_offset + - ep->e2d_reclen - slotoffset; - } - } - } + error = ext2_search_dirblock(dp, bp->b_data, &entry_found, + cnp->cn_nameptr, cnp->cn_namelen, + &entryoffsetinblock, &i_offset, &prevoff, + &enduseful, &ss); + if (error != 0) { + brelse(bp); + return (error); } - - /* - * Check for a name match. - */ - if (ep->e2d_ino) { - namlen = ep->e2d_namlen; - if (namlen == cnp->cn_namelen && - !bcmp(cnp->cn_nameptr, ep->e2d_name, - (unsigned)namlen)) { - /* - * Save directory entry's inode number and - * reclen in ndp->ni_ufs area, and release - * directory buffer. - */ - ino = ep->e2d_ino; - goto found; - } + if (entry_found) { + ep = (struct ext2fs_direct_2 *)((char *)bp->b_data + + (entryoffsetinblock & bmask)); +foundentry: + ino = ep->e2d_ino; + goto found; } - prevoff = i_offset; - i_offset += ep->e2d_reclen; - entryoffsetinblock += ep->e2d_reclen; - if (ep->e2d_ino) - enduseful = i_offset; } -/* notfound: */ +notfound: /* * If we started in the middle of the directory and failed * to find our target, we must check the beginning as well. @@ -508,15 +483,15 @@ searchloop: * can be put in the range from dp->i_offset to * dp->i_offset + dp->i_count. */ - if (slotstatus == NONE) { + if (ss.slotstatus == NONE) { dp->i_offset = roundup2(dp->i_size, DIRBLKSIZ); dp->i_count = 0; enduseful = dp->i_offset; } else { - dp->i_offset = slotoffset; - dp->i_count = slotsize; - if (enduseful < slotoffset + slotsize) - enduseful = slotoffset + slotsize; + dp->i_offset = ss.slotoffset; + dp->i_count = ss.slotsize; + if (enduseful < ss.slotoffset + ss.slotsize) + enduseful = ss.slotoffset + ss.slotsize; } dp->i_endoff = roundup2(enduseful, DIRBLKSIZ); /* @@ -722,6 +697,102 @@ found: return (0); } +int +ext2_search_dirblock(struct inode *ip, void *data, int *foundp, + const char *name, int namelen, int *entryoffsetinblockp, + doff_t *offp, doff_t *prevoffp, doff_t *endusefulp, + struct ext2fs_searchslot *ssp) +{ + struct vnode *vdp; + struct ext2fs_direct_2 *ep, *top; + uint32_t bsize = ip->i_e2fs->e2fs_bsize; + int offset = *entryoffsetinblockp; + int namlen; + + vdp = ITOV(ip); + + ep = (struct ext2fs_direct_2 *)((char *)data + offset); + top = (struct ext2fs_direct_2 *)((char *)data + + bsize - EXT2_DIR_REC_LEN(0)); + + while (ep < top) { + /* + * Full validation checks are slow, so we only check + * enough to insure forward progress through the + * directory. Complete checks can be run by setting + * "vfs.e2fs.dirchk" to be true. + */ + if (ep->e2d_reclen == 0 || + (dirchk && ext2_dirbadentry(vdp, ep, offset))) { + int i; + ext2_dirbad(ip, *offp, "mangled entry"); + i = bsize - (offset & (bsize - 1)); + *offp += i; + offset += i; + continue; + } + + /* + * If an appropriate sized slot has not yet been found, + * check to see if one is available. Also accumulate space + * in the current block so that we can determine if + * compaction is viable. + */ + if (ssp->slotstatus != FOUND) { + int size = ep->e2d_reclen; + + if (ep->e2d_ino != 0) + size -= EXT2_DIR_REC_LEN(ep->e2d_namlen); + if (size > 0) { + if (size >= ssp->slotneeded) { + ssp->slotstatus = FOUND; + ssp->slotoffset = *offp; + ssp->slotsize = ep->e2d_reclen; + } else if (ssp->slotstatus == NONE) { + ssp->slotfreespace += size; + if (ssp->slotoffset == -1) + ssp->slotoffset = *offp; + if (ssp->slotfreespace >= ssp->slotneeded) { + ssp->slotstatus = COMPACT; + ssp->slotsize = *offp + + ep->e2d_reclen - + ssp->slotoffset; + } + } + } + } + + /* + * Check for a name match. + */ + if (ep->e2d_ino) { + namlen = ep->e2d_namlen; + if (namlen == namelen && + !bcmp(name, ep->e2d_name, (unsigned)namlen)) { + /* + * Save directory entry's inode number and + * reclen in ndp->ni_ufs area, and release + * directory buffer. + */ + *foundp = 1; + return (0); + } + } + *prevoffp = *offp; + *offp += ep->e2d_reclen; + offset += ep->e2d_reclen; + *entryoffsetinblockp = offset; + if (ep->e2d_ino) + *endusefulp = *offp; + /* + * Get pointer to the next entry. + */ + ep = (struct ext2fs_direct_2 *)((char *)data + offset); + } + + return (0); +} + void ext2_dirbad(struct inode *ip, doff_t offset, char *how) { @@ -789,16 +860,12 @@ ext2_dirbadentry(struct vnode *dp, struc int ext2_direnter(struct inode *ip, struct vnode *dvp, struct componentname *cnp) { - struct ext2fs_direct_2 *ep, *nep; struct inode *dp; - struct buf *bp; struct ext2fs_direct_2 newdir; struct iovec aiov; struct uio auio; - u_int dsize; - int error, loc, newentrysize, spacefree; - char *dirbuf; - int DIRBLKSIZ = ip->i_e2fs->e2fs_bsize; + int error, newentrysize; + int DIRBLKSIZ = ip->i_e2fs->e2fs_bsize; #ifdef INVARIANTS @@ -815,6 +882,28 @@ ext2_direnter(struct inode *ip, struct v newdir.e2d_type = EXT2_FT_UNKNOWN; bcopy(cnp->cn_nameptr, newdir.e2d_name, (unsigned)cnp->cn_namelen + 1); newentrysize = EXT2_DIR_REC_LEN(newdir.e2d_namlen); + + if (ext2_htree_has_idx(dp)) { + error = ext2_htree_add_entry(dvp, &newdir, cnp); + if (error) { + dp->i_flag &= ~IN_E3INDEX; + dp->i_flag |= IN_CHANGE | IN_UPDATE; + } + return (error); + } + + if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) && + !ext2_htree_has_idx(dp)) { + if ((dp->i_size / DIRBLKSIZ) == 1 && + dp->i_offset == DIRBLKSIZ) { + /* + * Making indexed directory when one block is not + * enough to save all entries. + */ + return ext2_htree_create_index(dvp, cnp, &newdir); + } + } + if (dp->i_count == 0) { /* * If dp->i_count is 0, then namei could find no @@ -846,6 +935,29 @@ ext2_direnter(struct inode *ip, struct v return (error); } + error = ext2_add_entry(dvp, &newdir); + if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) + error = ext2_truncate(dvp, (off_t)dp->i_endoff, IO_SYNC, + cnp->cn_cred, cnp->cn_thread); + return (error); +} + +/* + * Insert an entry into the directory block. + * Compact the contents. + */ +int +ext2_add_entry(struct vnode *dvp, struct ext2fs_direct_2 *entry) +{ + struct ext2fs_direct_2 *ep, *nep; + struct inode *dp; + struct buf *bp; + u_int dsize; + int error, loc, newentrysize, spacefree; + char *dirbuf; + + dp = VTOI(dvp); + /* * If dp->i_count is non-zero, then namei found space * for the new entry in the range dp->i_offset to @@ -877,6 +989,7 @@ ext2_direnter(struct inode *ip, struct v * dp->i_offset + dp->i_count would yield the * space. */ + newentrysize = EXT2_DIR_REC_LEN(entry->e2d_namlen); ep = (struct ext2fs_direct_2 *)dirbuf; dsize = EXT2_DIR_REC_LEN(ep->e2d_namlen); spacefree = ep->e2d_reclen - dsize; @@ -902,15 +1015,15 @@ ext2_direnter(struct inode *ip, struct v if (ep->e2d_ino == 0) { if (spacefree + dsize < newentrysize) panic("ext2_direnter: compact1"); - newdir.e2d_reclen = spacefree + dsize; + entry->e2d_reclen = spacefree + dsize; } else { if (spacefree < newentrysize) panic("ext2_direnter: compact2"); - newdir.e2d_reclen = spacefree; + entry->e2d_reclen = spacefree; ep->e2d_reclen = dsize; ep = (struct ext2fs_direct_2 *)((char *)ep + dsize); } - bcopy((caddr_t)&newdir, (caddr_t)ep, (u_int)newentrysize); + bcopy((caddr_t)entry, (caddr_t)ep, (u_int)newentrysize); if (DOINGASYNC(dvp)) { bdwrite(bp); error = 0; @@ -918,9 +1031,6 @@ ext2_direnter(struct inode *ip, struct v error = bwrite(bp); } dp->i_flag |= IN_CHANGE | IN_UPDATE; - if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) - error = ext2_truncate(dvp, (off_t)dp->i_endoff, IO_SYNC, - cnp->cn_cred, cnp->cn_thread); return (error); } Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vfsops.c Thu Mar 17 19:01:44 2016 (r296991) +++ stable/10/sys/fs/ext2fs/ext2_vfsops.c Thu Mar 17 19:28:15 2016 (r296992) @@ -399,8 +399,22 @@ compute_sb_data(struct vnode *devvp, str if (es->e2fs_rev == E2FS_REV0 || !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_LARGEFILE)) fs->e2fs_maxfilesize = 0x7fffffff; - else - fs->e2fs_maxfilesize = 0x7fffffffffffffff; + else { + fs->e2fs_maxfilesize = 0xffffffffffff; + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_HUGE_FILE)) + fs->e2fs_maxfilesize = 0x7fffffffffffffff; + } + if (es->e4fs_flags & E2FS_UNSIGNED_HASH) { + fs->e2fs_uhash = 3; + } else if ((es->e4fs_flags & E2FS_SIGNED_HASH) == 0) { +#ifdef __CHAR_UNSIGNED__ + es->e4fs_flags |= E2FS_UNSIGNED_HASH; + fs->e2fs_uhash = 3; +#else + es->e4fs_flags |= E2FS_SIGNED_HASH; +#endif + } + return (0); } Modified: stable/10/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2fs.h Thu Mar 17 19:01:44 2016 (r296991) +++ stable/10/sys/fs/ext2fs/ext2fs.h Thu Mar 17 19:28:15 2016 (r296992) @@ -147,6 +147,7 @@ struct m_ext2fs { int32_t e2fs_contigsumsize; /* size of cluster summary array */ int32_t *e2fs_maxcluster; /* max cluster in each cyl group */ struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ + int32_t e2fs_uhash; /* 3 if hash should be signed, 0 if not */ }; /* cluster summary information */ @@ -213,6 +214,7 @@ struct csum { * - EXT2F_INCOMPAT_FLEX_BG * - EXT2F_INCOMPAT_META_BG */ +#define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX #define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ EXT2F_ROCOMPAT_LARGEFILE | \ EXT2F_ROCOMPAT_EXTRA_ISIZE) @@ -243,6 +245,12 @@ struct csum { #define E2FS_ISCLEAN 0x0001 /* Unmounted cleanly */ #define E2FS_ERRORS 0x0002 /* Errors detected */ +/* + * Filesystem miscellaneous flags + */ +#define E2FS_SIGNED_HASH 0x0001 +#define E2FS_UNSIGNED_HASH 0x0002 + /* ext2 file system block group descriptor */ struct ext2_gd { Modified: stable/10/sys/fs/ext2fs/inode.h ============================================================================== --- stable/10/sys/fs/ext2fs/inode.h Thu Mar 17 19:01:44 2016 (r296991) +++ stable/10/sys/fs/ext2fs/inode.h Thu Mar 17 19:28:15 2016 (r296992) @@ -157,7 +157,7 @@ struct inode { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Thu Mar 17 20:00:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B00B0AD444C; Thu, 17 Mar 2016 20:00:51 +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 77780D1; Thu, 17 Mar 2016 20:00:51 +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 u2HK0oiZ038779; Thu, 17 Mar 2016 20:00:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HK0oDK038772; Thu, 17 Mar 2016 20:00:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201603172000.u2HK0oDK038772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 17 Mar 2016 20:00:50 +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: r296994 - in stable/10: etc/mtree usr.sbin/rpcbind usr.sbin/rpcbind/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 20:00:51 -0000 Author: asomers Date: Thu Mar 17 20:00:49 2016 New Revision: 296994 URL: https://svnweb.freebsd.org/changeset/base/296994 Log: MFC r293229, r293833 to usr.sbin/rpcbind r293833 | asomers | 2016-01-13 10:33:50 -0700 (Wed, 13 Jan 2016) | 16 lines Fix Coverity warnings regarding r293229 rpcbind/check_bound.c Fix CID1347798, a memory leak in mergeaddr. rpcbind/tests/addrmerge_test.c Fix CID1347800 through CID1347803, memory leaks in ATF tests. They are harmless because each ATF test case runs in its own process, but they are trivial to fix. Fix a few other leaks that Coverity didn't detect, too. r293229 | asomers | 2016-01-05 17:00:11 -0700 (Tue, 05 Jan 2016) | 36 lines "source routing" in rpcbind Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on two separate subnets, and a client on the first subnet contacted rpcbind at the address on the second subnet, rpcbind would advertise addresses on the first subnet. This is a bug, because it should prefer to advertise the address where it was contacted. The requested service might be firewalled off from the address on the first subnet, for example. usr.sbin/rpcbind/check_bound.c If the address on which a request was received is known, pass that to addrmerge as the clnt_uaddr parameter. That is what addrmerge's comment indicates the parameter is supposed to mean. The previous behavior is that clnt_uaddr would contain the address from which the client sent the request. usr.sbin/rpcbind/util.c Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr, if one is found. Refactor the relevant portion of the function for clarity, and to reduce the number of ifdefs. etc/mtree/BSD.tests.dist usr.sbin/rpcbind/tests/Makefile usr.sbin/rpcbind/tests/addrmerge_test.c Add unit tests for usr.sbin/rpcbind/util.c:addrmerge. usr.sbin/rpcbind/check_bound.c usr.sbin/rpcbind/rpcbind.h usr.sbin/rpcbind/util.c Constify some function arguments Added: stable/10/usr.sbin/rpcbind/tests/ - copied from r293229, head/usr.sbin/rpcbind/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.sbin/rpcbind/Makefile stable/10/usr.sbin/rpcbind/check_bound.c stable/10/usr.sbin/rpcbind/rpcbind.h stable/10/usr.sbin/rpcbind/tests/Makefile stable/10/usr.sbin/rpcbind/tests/addrmerge_test.c stable/10/usr.sbin/rpcbind/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Thu Mar 17 19:35:08 2016 (r296993) +++ stable/10/etc/mtree/BSD.tests.dist Thu Mar 17 20:00:49 2016 (r296994) @@ -464,6 +464,8 @@ .. pw .. + rpcbind + .. sa .. .. Modified: stable/10/usr.sbin/rpcbind/Makefile ============================================================================== --- stable/10/usr.sbin/rpcbind/Makefile Thu Mar 17 19:35:08 2016 (r296993) +++ stable/10/usr.sbin/rpcbind/Makefile Thu Mar 17 20:00:49 2016 (r296994) @@ -14,6 +14,10 @@ CFLAGS+= -DPORTMAP -DLIBWRAP CFLAGS+= -DINET6 .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + WARNS?= 1 DPADD= ${LIBWRAP} ${LIBUTIL} Modified: stable/10/usr.sbin/rpcbind/check_bound.c ============================================================================== --- stable/10/usr.sbin/rpcbind/check_bound.c Thu Mar 17 19:35:08 2016 (r296993) +++ stable/10/usr.sbin/rpcbind/check_bound.c Thu Mar 17 20:00:49 2016 (r296994) @@ -51,6 +51,7 @@ static char sccsid[] = "@(#)check_bound. #include #include #include +#include #include #include #include @@ -160,6 +161,7 @@ char * mergeaddr(SVCXPRT *xprt, char *netid, char *uaddr, char *saddr) { struct fdlist *fdl; + struct svc_dg_data *dg_data; char *c_uaddr, *s_uaddr, *m_uaddr, *allocated_uaddr = NULL; for (fdl = fdhead; fdl; fdl = fdl->next) @@ -171,21 +173,31 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch /* that server died */ return (nullstring); /* + * Try to determine the local address on which the client contacted us, + * so we can send a reply from the same address. If it's unknown, then + * try to determine which address the client used, and pick a nearby + * local address. + * * If saddr is not NULL, the remote client may have included the * address by which it contacted us. Use that for the "client" uaddr, * otherwise use the info from the SVCXPRT. */ - if (saddr != NULL) { + dg_data = (struct svc_dg_data*)xprt->xp_p2; + if (dg_data != NULL && dg_data->su_srcaddr.buf != NULL) { + c_uaddr = taddr2uaddr(fdl->nconf, &dg_data->su_srcaddr); + allocated_uaddr = c_uaddr; + } + else if (saddr != NULL) { c_uaddr = saddr; } else { c_uaddr = taddr2uaddr(fdl->nconf, svc_getrpccaller(xprt)); - if (c_uaddr == NULL) { - syslog(LOG_ERR, "taddr2uaddr failed for %s", - fdl->nconf->nc_netid); - return (NULL); - } allocated_uaddr = c_uaddr; } + if (c_uaddr == NULL) { + syslog(LOG_ERR, "taddr2uaddr failed for %s", + fdl->nconf->nc_netid); + return (NULL); + } #ifdef ND_DEBUG if (debugging) { @@ -218,7 +230,7 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch * structure should not be freed. */ struct netconfig * -rpcbind_get_conf(char *netid) +rpcbind_get_conf(const char *netid) { struct fdlist *fdl; Modified: stable/10/usr.sbin/rpcbind/rpcbind.h ============================================================================== --- stable/10/usr.sbin/rpcbind/rpcbind.h Thu Mar 17 19:35:08 2016 (r296993) +++ stable/10/usr.sbin/rpcbind/rpcbind.h Thu Mar 17 20:00:49 2016 (r296994) @@ -83,7 +83,7 @@ extern char *tcp_uaddr; /* Universal TC int add_bndlist(struct netconfig *, struct netbuf *); bool_t is_bound(char *, char *); char *mergeaddr(SVCXPRT *, char *, char *, char *); -struct netconfig *rpcbind_get_conf(char *); +struct netconfig *rpcbind_get_conf(const char *); void rpcbs_init(void); void rpcbs_procinfo(rpcvers_t, rpcproc_t); @@ -132,8 +132,8 @@ extern void pmap_service(struct svc_req void write_warmstart(void); void read_warmstart(void); -char *addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr, - char *netid); +char *addrmerge(struct netbuf *caller, const char *serv_uaddr, + const char *clnt_uaddr, char const *netid); int listen_addr(const struct sockaddr *sa); void network_init(void); struct sockaddr *local_sa(int); Modified: stable/10/usr.sbin/rpcbind/tests/Makefile ============================================================================== --- head/usr.sbin/rpcbind/tests/Makefile Wed Jan 6 00:00:11 2016 (r293229) +++ stable/10/usr.sbin/rpcbind/tests/Makefile Thu Mar 17 20:00:49 2016 (r296994) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include .PATH: ${.CURDIR}/.. Modified: stable/10/usr.sbin/rpcbind/tests/addrmerge_test.c ============================================================================== --- head/usr.sbin/rpcbind/tests/addrmerge_test.c Wed Jan 6 00:00:11 2016 (r293229) +++ stable/10/usr.sbin/rpcbind/tests/addrmerge_test.c Thu Mar 17 20:00:49 2016 (r296994) @@ -435,6 +435,7 @@ ATF_TC_BODY(addrmerge_localhost_only, tc /* We must return localhost if there is nothing better */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("127.0.0.1.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_singlehomed); @@ -450,6 +451,7 @@ ATF_TC_BODY(addrmerge_singlehomed, tc) ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet); @@ -466,6 +468,7 @@ ATF_TC_BODY(addrmerge_one_addr_on_each_s /* We must return the address on the caller's subnet */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); + free(maddr); } @@ -488,6 +491,7 @@ ATF_TC_BODY(addrmerge_one_addr_on_each_s /* We must return the address on the caller's subnet */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_point2point); @@ -505,6 +509,7 @@ ATF_TC_BODY(addrmerge_point2point, tc) /* addrmerge should disprefer P2P interfaces */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.130.3.46", maddr); + free(maddr); } /* Like addrerge_point2point, but getifaddrs returns a different order */ @@ -523,6 +528,7 @@ ATF_TC_BODY(addrmerge_point2point_rev, t /* addrmerge should disprefer P2P interfaces */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.130.3.46", maddr); + free(maddr); } /* @@ -544,6 +550,7 @@ ATF_TC_BODY(addrmerge_bindip, tc) /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.3.3.46", maddr); + free(maddr); } /* Like addrmerge_bindip, but getifaddrs returns a different order */ @@ -562,6 +569,7 @@ ATF_TC_BODY(addrmerge_bindip_rev, tc) /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.3.3.46", maddr); + free(maddr); } /* @@ -582,6 +590,7 @@ ATF_TC_BODY(addrmerge_recvdstaddr, tc) /* We must return the address on which the request was received */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr_rev); @@ -598,6 +607,7 @@ ATF_TC_BODY(addrmerge_recvdstaddr_rev, t /* We must return the address on which the request was received */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); + free(maddr); } #ifdef INET6 @@ -614,6 +624,7 @@ ATF_TC_BODY(addrmerge_localhost_only6, t /* We must return localhost if there is nothing better */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("::1.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_singlehomed6); @@ -629,6 +640,7 @@ ATF_TC_BODY(addrmerge_singlehomed6, tc) ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet6); @@ -645,6 +657,7 @@ ATF_TC_BODY(addrmerge_one_addr_on_each_s /* We must return the address on the caller's subnet */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); + free(maddr); } @@ -667,6 +680,7 @@ ATF_TC_BODY(addrmerge_one_addr_on_each_s /* We must return the address on the caller's subnet */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_point2point6); @@ -684,6 +698,7 @@ ATF_TC_BODY(addrmerge_point2point6, tc) /* addrmerge should disprefer P2P interfaces */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8:1::2.3.46", maddr); + free(maddr); } /* Like addrerge_point2point, but getifaddrs returns a different order */ @@ -702,6 +717,7 @@ ATF_TC_BODY(addrmerge_point2point6_rev, /* addrmerge should disprefer P2P interfaces */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8:1::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_bindip6); @@ -719,6 +735,7 @@ ATF_TC_BODY(addrmerge_bindip6, tc) /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::3.3.46", maddr); + free(maddr); } /* Like addrerge_bindip, but getifaddrs returns a different order */ @@ -737,6 +754,7 @@ ATF_TC_BODY(addrmerge_bindip6_rev, tc) /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::3.3.46", maddr); + free(maddr); } /* @@ -761,6 +779,7 @@ ATF_TC_BODY(addrmerge_ipv6_linklocal, tc /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("fe80::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_ipv6_linklocal_rev); @@ -781,6 +800,7 @@ ATF_TC_BODY(addrmerge_ipv6_linklocal_rev /* We must return the address to which we are bound */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("fe80::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr6); @@ -797,6 +817,7 @@ ATF_TC_BODY(addrmerge_recvdstaddr6, tc) /* We must return the address on which the request was received */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); + free(maddr); } ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr6_rev); @@ -813,6 +834,7 @@ ATF_TC_BODY(addrmerge_recvdstaddr6_rev, /* We must return the address on which the request was received */ ATF_REQUIRE(maddr != NULL); ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); + free(maddr); } #endif /* INET6 */ Modified: stable/10/usr.sbin/rpcbind/util.c ============================================================================== --- stable/10/usr.sbin/rpcbind/util.c Thu Mar 17 19:35:08 2016 (r296993) +++ stable/10/usr.sbin/rpcbind/util.c Thu Mar 17 20:00:49 2016 (r296994) @@ -56,7 +56,7 @@ static struct sockaddr_in *local_in4; static struct sockaddr_in6 *local_in6; #endif -static int bitmaskcmp(void *, void *, void *, int); +static int bitmaskcmp(struct sockaddr *, struct sockaddr *, struct sockaddr *); /* * For all bits set in "mask", compare the corresponding bits in @@ -64,10 +64,34 @@ static int bitmaskcmp(void *, void *, vo * match. */ static int -bitmaskcmp(void *dst, void *src, void *mask, int bytelen) +bitmaskcmp(struct sockaddr *dst, struct sockaddr *src, struct sockaddr *mask) { int i; - u_int8_t *p1 = dst, *p2 = src, *netmask = mask; + u_int8_t *p1, *p2, *netmask; + int bytelen; + + if (dst->sa_family != src->sa_family || + dst->sa_family != mask->sa_family) + return (1); + + switch (dst->sa_family) { + case AF_INET: + p1 = (uint8_t*) &SA2SINADDR(dst); + p2 = (uint8_t*) &SA2SINADDR(src); + netmask = (uint8_t*) &SA2SINADDR(mask); + bytelen = sizeof(struct in_addr); + break; +#ifdef INET6 + case AF_INET6: + p1 = (uint8_t*) &SA2SIN6ADDR(dst); + p2 = (uint8_t*) &SA2SIN6ADDR(src); + netmask = (uint8_t*) &SA2SIN6ADDR(mask); + bytelen = sizeof(struct in6_addr); + break; +#endif + default: + return (1); + } for (i = 0; i < bytelen; i++) if ((p1[i] & netmask[i]) != (p2[i] & netmask[i])) @@ -86,16 +110,18 @@ bitmaskcmp(void *dst, void *src, void *m * string which should be freed by the caller. On error, returns NULL. */ char * -addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr, - char *netid) +addrmerge(struct netbuf *caller, const char *serv_uaddr, const char *clnt_uaddr, + const char *netid) { struct ifaddrs *ifap, *ifp = NULL, *bestif; struct netbuf *serv_nbp = NULL, *hint_nbp = NULL, tbuf; struct sockaddr *caller_sa, *hint_sa, *ifsa, *ifmasksa, *serv_sa; struct sockaddr_storage ss; struct netconfig *nconf; - char *caller_uaddr = NULL, *hint_uaddr = NULL; + char *caller_uaddr = NULL; + const char *hint_uaddr = NULL; char *ret = NULL; + int bestif_goodness; #ifdef ND_DEBUG if (debugging) @@ -139,19 +165,29 @@ addrmerge(struct netbuf *caller, char *s goto freeit; /* - * Loop through all interfaces. For each interface, see if it - * is either the loopback interface (which we always listen - * on) or is one of the addresses the program bound to (the - * wildcard by default, or a subset if -h is specified) and - * the network portion of its address is equal to that of the - * client. If so, we have found the interface that we want to - * use. + * Loop through all interface addresses. We are listening to an address + * if any of the following are true: + * a) It's a loopback address + * b) It was specified with the -h command line option + * c) There were no -h command line options. + * + * Among addresses on which we are listening, choose in order of + * preference an address that is: + * + * a) Equal to the hint + * b) A link local address with the same scope ID as the client's + * address, if the client's address is also link local + * c) An address on the same subnet as the client's address + * d) A non-localhost, non-p2p address + * e) Any usable address */ bestif = NULL; + bestif_goodness = 0; for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) { ifsa = ifap->ifa_addr; ifmasksa = ifap->ifa_netmask; + /* Skip addresses where we don't listen */ if (ifsa == NULL || ifsa->sa_family != hint_sa->sa_family || !(ifap->ifa_flags & IFF_UP)) continue; @@ -159,21 +195,29 @@ addrmerge(struct netbuf *caller, char *s if (!(ifap->ifa_flags & IFF_LOOPBACK) && !listen_addr(ifsa)) continue; - switch (hint_sa->sa_family) { - case AF_INET: - /* - * If the hint address matches this interface - * address/netmask, then we're done. - */ - if (!bitmaskcmp(&SA2SINADDR(ifsa), - &SA2SINADDR(hint_sa), &SA2SINADDR(ifmasksa), - sizeof(struct in_addr))) { - bestif = ifap; - goto found; - } - break; + if ((hint_sa->sa_family == AF_INET) && + ((((struct sockaddr_in*)hint_sa)->sin_addr.s_addr == + ((struct sockaddr_in*)ifsa)->sin_addr.s_addr))) { + const int goodness = 4; + + bestif_goodness = goodness; + bestif = ifap; + goto found; + } #ifdef INET6 - case AF_INET6: + if ((hint_sa->sa_family == AF_INET6) && + (0 == memcmp(&((struct sockaddr_in6*)hint_sa)->sin6_addr, + &((struct sockaddr_in6*)ifsa)->sin6_addr, + sizeof(struct in6_addr))) && + (((struct sockaddr_in6*)hint_sa)->sin6_scope_id == + (((struct sockaddr_in6*)ifsa)->sin6_scope_id))) { + const int goodness = 4; + + bestif_goodness = goodness; + bestif = ifap; + goto found; + } + if (hint_sa->sa_family == AF_INET6) { /* * For v6 link local addresses, if the caller is on * a link-local address then use the scope id to see @@ -184,28 +228,33 @@ addrmerge(struct netbuf *caller, char *s IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(hint_sa))) { if (SA2SIN6(ifsa)->sin6_scope_id == SA2SIN6(caller_sa)->sin6_scope_id) { - bestif = ifap; - goto found; + const int goodness = 3; + + if (bestif_goodness < goodness) { + bestif = ifap; + bestif_goodness = goodness; + } } - } else if (!bitmaskcmp(&SA2SIN6ADDR(ifsa), - &SA2SIN6ADDR(hint_sa), &SA2SIN6ADDR(ifmasksa), - sizeof(struct in6_addr))) { + } + } +#endif /* INET6 */ + if (0 == bitmaskcmp(hint_sa, ifsa, ifmasksa)) { + const int goodness = 2; + + if (bestif_goodness < goodness) { bestif = ifap; - goto found; + bestif_goodness = goodness; } - break; -#endif - default: - continue; } + if (!(ifap->ifa_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { + const int goodness = 1; - /* - * Remember the first possibly useful interface, preferring - * "normal" to point-to-point and loopback ones. - */ - if (bestif == NULL || - (!(ifap->ifa_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) && - (bestif->ifa_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)))) + if (bestif_goodness < goodness) { + bestif = ifap; + bestif_goodness = goodness; + } + } + if (bestif == NULL) bestif = ifap; } if (bestif == NULL) From owner-svn-src-stable-10@freebsd.org Thu Mar 17 20:29:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75A6CAD4EA6; Thu, 17 Mar 2016 20:29:11 +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 50711955; Thu, 17 Mar 2016 20:29:11 +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 u2HKTAhW048382; Thu, 17 Mar 2016 20:29:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HKTAMN048380; Thu, 17 Mar 2016 20:29:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201603172029.u2HKTAMN048380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 17 Mar 2016 20:29: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: r296995 - stable/10/usr.sbin/iostat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 20:29:11 -0000 Author: asomers Date: Thu Mar 17 20:29:10 2016 New Revision: 296995 URL: https://svnweb.freebsd.org/changeset/base/296995 Log: MFC r295900, r295768 to usr.sbin/iostat r295768 | asomers | 2016-02-18 13:08:01 -0700 (Thu, 18 Feb 2016) | 14 lines Fix compiler warnings in iostat Raise WARNS from 1 to 6 (the default) Fix warnings: * Use C99 designated initializers for structs, and initialize all fields * Mark global variables as static * Mark unused function arguments * Be careful about signed/unsigned comparisons r295900 | asomers | 2016-02-22 14:40:53 -0700 (Mon, 22 Feb 2016) | 10 lines Fix the usr.sbin/iostat build with GCC, broken by r295768 Renamed some local variables for compatibility with -Wshadow Modified: stable/10/usr.sbin/iostat/Makefile stable/10/usr.sbin/iostat/iostat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/iostat/Makefile ============================================================================== --- stable/10/usr.sbin/iostat/Makefile Thu Mar 17 20:00:49 2016 (r296994) +++ stable/10/usr.sbin/iostat/Makefile Thu Mar 17 20:29:10 2016 (r296995) @@ -7,6 +7,4 @@ MAN= iostat.8 DPADD= ${LIBDEVSTAT} ${LIBKVM} ${LIBM} LDADD= -ldevstat -lkvm -lm -WARNS?= 1 - .include Modified: stable/10/usr.sbin/iostat/iostat.c ============================================================================== --- stable/10/usr.sbin/iostat/iostat.c Thu Mar 17 20:00:49 2016 (r296994) +++ stable/10/usr.sbin/iostat/iostat.c Thu Mar 17 20:29:10 2016 (r296995) @@ -117,30 +117,34 @@ #include #include -struct nlist namelist[] = { +static struct nlist namelist[] = { #define X_TK_NIN 0 - { "_tk_nin" }, + { .n_name = "_tk_nin", + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, #define X_TK_NOUT 1 - { "_tk_nout" }, + { .n_name = "_tk_nout", + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, #define X_BOOTTIME 2 - { "_boottime" }, + { .n_name = "_boottime", + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, #define X_END 2 - { NULL }, + { .n_name = NULL, + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, }; #define IOSTAT_DEFAULT_ROWS 20 /* Traditional default `wrows' */ -struct statinfo cur, last; -int num_devices; -struct device_selection *dev_select; -int maxshowdevs; -volatile sig_atomic_t headercount; -volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ -volatile sig_atomic_t alarm_rang; -volatile sig_atomic_t return_requested; -unsigned short wrows; /* Current number of tty rows. */ -int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; -int xflag = 0, zflag = 0; +static struct statinfo cur, last; +static int num_devices; +static struct device_selection *dev_select; +static int maxshowdevs; +static volatile sig_atomic_t headercount; +static volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +static volatile sig_atomic_t alarm_rang; +static volatile sig_atomic_t return_requested; +static unsigned short wrows; /* Current number of tty rows. */ +static int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; +static int xflag = 0, zflag = 0; /* local function declarations */ static void usage(void); @@ -650,7 +654,7 @@ main(int argc, char **argv) * Force a header to be prepended to the next output. */ void -needhdr(int signo) +needhdr(int signo __unused) { headercount = 1; @@ -662,7 +666,7 @@ needhdr(int signo) * prepended to the next output. */ void -needresize(int signo) +needresize(int signo __unused) { wresized = 1; @@ -673,7 +677,7 @@ needresize(int signo) * Record the alarm so the main loop can break its sleep */ void -alarm_clock(int signo) +alarm_clock(int signo __unused) { alarm_rang = 1; } @@ -682,7 +686,7 @@ alarm_clock(int signo) * Request that the main loop exit soon */ void -needreturn(int signo) +needreturn(int signo __unused) { return_requested = 1; } @@ -791,7 +795,7 @@ devstats(int perf_select, long double et long double total_mb; long double blocks_per_second, ms_per_transaction, total_duration; int firstline = 1; - char *devname; + char *devicename; if (xflag > 0) { printf(" extended device statistics "); @@ -862,7 +866,7 @@ devstats(int perf_select, long double et } if (xflag > 0) { - if (asprintf(&devname, "%s%d", + if (asprintf(&devicename, "%s%d", cur.dinfo->devices[di].device_name, cur.dinfo->devices[di].unit_number) == -1) err(1, "asprintf"); @@ -876,7 +880,8 @@ devstats(int perf_select, long double et busy_pct > 0.5) { if (Iflag == 0) printf("%-8.8s %5.1Lf %5.1Lf %7.1Lf %7.1Lf %4" PRIu64 " %5.1Lf %3.0Lf ", - devname, transfers_per_second_read, + devicename, + transfers_per_second_read, transfers_per_second_write, mb_per_second_read * 1024, mb_per_second_write * 1024, @@ -886,7 +891,7 @@ devstats(int perf_select, long double et printf("%-8.8s %11.1Lf %11.1Lf " "%12.1Lf %12.1Lf %4" PRIu64 " %10.1Lf %9.1Lf ", - devname, + devicename, (long double)total_transfers_read, (long double)total_transfers_write, (long double) @@ -911,7 +916,7 @@ devstats(int perf_select, long double et } printf("\n"); } - free(devname); + free(devicename); } else if (oflag > 0) { int msdig = (ms_per_transaction < 100.0) ? 1 : 0; @@ -965,15 +970,15 @@ static void cpustats(void) { int state; - double time; + double cptime; - time = 0.0; + cptime = 0.0; for (state = 0; state < CPUSTATES; ++state) - time += cur.cp_time[state]; + cptime += cur.cp_time[state]; for (state = 0; state < CPUSTATES; ++state) printf(" %2.0f", - rint(100. * cur.cp_time[state] / (time ? time : 1))); + rint(100. * cur.cp_time[state] / (cptime ? cptime : 1))); } static int @@ -988,8 +993,7 @@ readvar(kvm_t *kd, const char *name, int warnx("kvm_read(%s): %s", namelist[nlid].n_name, kvm_geterr(kd)); return (1); - } - if (nbytes != len) { + } else if ((size_t)nbytes != len) { warnx("kvm_read(%s): expected %zu bytes, got %zd bytes", namelist[nlid].n_name, len, nbytes); return (1); From owner-svn-src-stable-10@freebsd.org Thu Mar 17 21:00:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2421AD4918; Thu, 17 Mar 2016 21:00:44 +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 8867FD37; Thu, 17 Mar 2016 21:00:44 +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 u2HL0hQl058027; Thu, 17 Mar 2016 21:00:43 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HL0hjP058026; Thu, 17 Mar 2016 21:00:43 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201603172100.u2HL0hjP058026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 17 Mar 2016 21:00:43 +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: r296996 - stable/10/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 21:00:44 -0000 Author: allanjude Date: Thu Mar 17 21:00:43 2016 New Revision: 296996 URL: https://svnweb.freebsd.org/changeset/base/296996 Log: MFC: r296988 Remove 50% ZFS conditional from bsdinstall/zfsboot Approved by: re (marius) Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Mar 17 20:29:10 2016 (r296995) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Mar 17 21:00:43 2016 (r296996) @@ -302,7 +302,7 @@ msg_swap_mirror_help="Mirror swap partit msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" msg_swap_toosmall="The selected swap size (%s) is to small. Please enter a value greater than 100MB or enter 0 for no swap" -msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." +msg_these_disks_are_too_small="These disks are smaller than the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 100%% or more of each of the following selected disks:\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of disks." msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" msg_unsupported_partition_scheme="%s is an unsupported partition scheme" msg_user_cancelled="User Cancelled." @@ -1480,11 +1480,12 @@ while :; do # NB: dialog_menu_layout supports running non-interactively dialog_menu_layout || continue - # Make sure each disk will be at least 50% ZFS + # Make sure each disk will have room for ZFS if f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize && - f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize + f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize && + f_expand_number "1g" zpoolmin then - minsize=$swapsize teeny_disks= + minsize=$(( $swapsize + $zpoolmin )) teeny_disks= [ "$ZFSBOOT_BOOT_POOL" ] && minsize=$(( $minsize + $bootsize )) for disk in $ZFSBOOT_DISKS; do @@ -1492,7 +1493,6 @@ while :; do $disk $DEVICE_TYPE_DISK device $device get capacity disksize || continue [ ${disksize:-0} -ge 0 ] || disksize=0 - disksize=$(( $disksize - $minsize )) [ $disksize -lt $minsize ] && teeny_disks="$teeny_disks $disk" done From owner-svn-src-stable-10@freebsd.org Fri Mar 18 01:35:05 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22EE9AD4370; Fri, 18 Mar 2016 01:35:05 +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 E704FAB; Fri, 18 Mar 2016 01:35:04 +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 u2I1Z4We042571; Fri, 18 Mar 2016 01:35:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I1Z434042570; Fri, 18 Mar 2016 01:35:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603180135.u2I1Z434042570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 18 Mar 2016 01:35:04 +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: r297002 - stable/10/sys/fs/nullfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 01:35:05 -0000 Author: kib Date: Fri Mar 18 01:35:03 2016 New Revision: 297002 URL: https://svnweb.freebsd.org/changeset/base/297002 Log: MFC r296388: Pass MNTK_NO_IOPF and MNTK_UNMAPPED_BUFS flags from the lower filesystem to the nullfs mount. Modified: stable/10/sys/fs/nullfs/null_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nullfs/null_vfsops.c ============================================================================== --- stable/10/sys/fs/nullfs/null_vfsops.c Fri Mar 18 01:30:58 2016 (r297001) +++ stable/10/sys/fs/nullfs/null_vfsops.c Fri Mar 18 01:35:03 2016 (r297002) @@ -199,7 +199,7 @@ nullfs_mount(struct mount *mp) } mp->mnt_kern_flag |= MNTK_LOOKUP_EXCL_DOTDOT; mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & - MNTK_USES_BCACHE; + (MNTK_USES_BCACHE | MNTK_NO_IOPF | MNTK_UNMAPPED_BUFS); MNT_IUNLOCK(mp); mp->mnt_data = xmp; vfs_getnewfsid(mp); From owner-svn-src-stable-10@freebsd.org Fri Mar 18 13:29:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99F9FAD4DE7; Fri, 18 Mar 2016 13:29:44 +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 6BB161BF4; Fri, 18 Mar 2016 13:29:44 +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 u2IDThZ5047155; Fri, 18 Mar 2016 13:29:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IDTh8v047154; Fri, 18 Mar 2016 13:29:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603181329.u2IDTh8v047154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 18 Mar 2016 13:29:43 +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: r297019 - stable/10/sbin/geom/core X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 13:29:44 -0000 Author: mav Date: Fri Mar 18 13:29:43 2016 New Revision: 297019 URL: https://svnweb.freebsd.org/changeset/base/297019 Log: MFC r296653: Allow standard commands for "unknown" classes in RESCUE mode. For example, it allows quite useful `geom disk list` command. Modified: stable/10/sbin/geom/core/geom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/core/geom.c ============================================================================== --- stable/10/sbin/geom/core/geom.c Fri Mar 18 13:26:16 2016 (r297018) +++ stable/10/sbin/geom/core/geom.c Fri Mar 18 13:29:43 2016 (r297019) @@ -635,8 +635,7 @@ get_class(int *argc, char ***argv) } else if (!strcasecmp(class_name, "label")) { version = &glabel_version; class_commands = glabel_class_commands; - } else - errx(EXIT_FAILURE, "Invalid class name."); + } #endif /* !STATIC_GEOM_CLASSES */ set_class_name(); From owner-svn-src-stable-10@freebsd.org Fri Mar 18 13:32:01 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC94CAD3023; Fri, 18 Mar 2016 13:32:01 +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 8E3C81058; Fri, 18 Mar 2016 13:32:01 +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 u2IDW0sx049333; Fri, 18 Mar 2016 13:32:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IDW0kA049332; Fri, 18 Mar 2016 13:32:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603181332.u2IDW0kA049332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 18 Mar 2016 13:32:00 +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: r297021 - stable/10/sys/cddl/compat/opensolaris/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-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 13:32:01 -0000 Author: mav Date: Fri Mar 18 13:32:00 2016 New Revision: 297021 URL: https://svnweb.freebsd.org/changeset/base/297021 Log: MFC r296919: Fix small memory leak on attempt to access deleted snapshot. Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Fri Mar 18 13:30:40 2016 (r297020) +++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Fri Mar 18 13:32:00 2016 (r297021) @@ -196,6 +196,7 @@ mount_snapshot(kthread_t *td, vnode_t ** VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); + vfs_freeopts(mp->mnt_optnew); vfs_mount_destroy(mp); *vpp = NULL; return (error); From owner-svn-src-stable-10@freebsd.org Fri Mar 18 18:24:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C77F0AD55B1; Fri, 18 Mar 2016 18:24:37 +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 995B1386; Fri, 18 Mar 2016 18:24:37 +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 u2IIOagP038858; Fri, 18 Mar 2016 18:24:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IIOa6F038857; Fri, 18 Mar 2016 18:24:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603181824.u2IIOa6F038857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 18 Mar 2016 18:24:36 +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: r297035 - 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-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 18:24:37 -0000 Author: bdrewery Date: Fri Mar 18 18:24:36 2016 New Revision: 297035 URL: https://svnweb.freebsd.org/changeset/base/297035 Log: MFC r296643: Fix make -n upgrade_checks. Modified: stable/10/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile ============================================================================== --- stable/10/Makefile Fri Mar 18 17:32:20 2016 (r297034) +++ stable/10/Makefile Fri Mar 18 18:24:36 2016 (r297035) @@ -336,7 +336,7 @@ kernel: buildkernel installkernel upgrade_checks: .if ${HAVE_MAKE} != ${WANT_MAKE} || \ (defined(WANT_MAKE_VERSION) && ${MAKE_VERSION} < ${WANT_MAKE_VERSION}) - @(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) + @${_+_}(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) .elif ${WANT_MAKE} == "fmake" @if ! (cd ${.CURDIR}/tools/build/make_check && \ PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ From owner-svn-src-stable-10@freebsd.org Fri Mar 18 18:26:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED8A3AD5667; Fri, 18 Mar 2016 18:26:08 +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 BF33A784; Fri, 18 Mar 2016 18:26:08 +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 u2IIQ78V038952; Fri, 18 Mar 2016 18:26:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IIQ7PS038951; Fri, 18 Mar 2016 18:26:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603181826.u2IIQ7PS038951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 18 Mar 2016 18:26:07 +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: r297036 - stable/10/lib/libc++ X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 18:26:09 -0000 Author: bdrewery Date: Fri Mar 18 18:26:07 2016 New Revision: 297036 URL: https://svnweb.freebsd.org/changeset/base/297036 Log: MFC r296707: Add missing CLEANFILES. Modified: stable/10/lib/libc++/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc++/Makefile ============================================================================== --- stable/10/lib/libc++/Makefile Fri Mar 18 18:24:36 2016 (r297035) +++ stable/10/lib/libc++/Makefile Fri Mar 18 18:26:07 2016 (r297036) @@ -51,6 +51,7 @@ CXXRT_SRCS+= libelftc_dem_gnu3.c\ guard.cc .for _S in ${CXXRT_SRCS} +CLEANFILES+= cxxrt_${_S} STATICOBJS+= cxxrt_${_S:R}.o cxxrt_${_S}: ln -sf ${LIBCXXRTDIR}/${_S} ${.TARGET} From owner-svn-src-stable-10@freebsd.org Fri Mar 18 22:52:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 852A6AD4405; Fri, 18 Mar 2016 22:52:12 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 519E61168; Fri, 18 Mar 2016 22:52:12 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2IMqBka020295; Fri, 18 Mar 2016 22:52:11 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IMqBPd020294; Fri, 18 Mar 2016 22:52:11 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201603182252.u2IMqBPd020294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Fri, 18 Mar 2016 22:52:11 +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: r297046 - stable/10/sys/dev/drm2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 22:52:12 -0000 Author: dumbbell Date: Fri Mar 18 22:52:11 2016 New Revision: 297046 URL: https://svnweb.freebsd.org/changeset/base/297046 Log: drm: Fix dev->ioctl_count references leak This fixes the following error: kernel: error: [drm:pid1167:drm_release] *ERROR* Device busy: 2 Because of that, drm_lastclose() was not called, leading to a few memory leaks once the driver was unloaded. MFC of: r296674 Modified: stable/10/sys/dev/drm2/drm_drv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_drv.c ============================================================================== --- stable/10/sys/dev/drm2/drm_drv.c Fri Mar 18 21:15:04 2016 (r297045) +++ stable/10/sys/dev/drm2/drm_drv.c Fri Mar 18 22:52:11 2016 (r297046) @@ -386,17 +386,21 @@ int drm_ioctl(struct cdev *kdev, u_long switch (cmd) { case FIONBIO: case FIOASYNC: + atomic_dec(&dev->ioctl_count); return 0; case FIOSETOWN: + atomic_dec(&dev->ioctl_count); return fsetown(*(int *)data, &file_priv->minor->buf_sigio); case FIOGETOWN: + atomic_dec(&dev->ioctl_count); *(int *) data = fgetown(&file_priv->minor->buf_sigio); return 0; } if (IOCGROUP(cmd) != DRM_IOCTL_BASE) { + atomic_dec(&dev->ioctl_count); DRM_DEBUG("Bad ioctl group 0x%x\n", (int)IOCGROUP(cmd)); return EINVAL; } From owner-svn-src-stable-10@freebsd.org Sat Mar 19 11:35:55 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A81FAD5E9F; Sat, 19 Mar 2016 11:35:55 +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 D82CF1E72; Sat, 19 Mar 2016 11:35:54 +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 u2JBZsIo050848; Sat, 19 Mar 2016 11:35:54 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2JBZrY1050847; Sat, 19 Mar 2016 11:35:53 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201603191135.u2JBZrY1050847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sat, 19 Mar 2016 11:35:53 +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: r297050 - stable/10/sys/dev/ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Mar 2016 11:35:55 -0000 Author: smh Date: Sat Mar 19 11:35:53 2016 New Revision: 297050 URL: https://svnweb.freebsd.org/changeset/base/297050 Log: MFC r296922: Prevent invalid ixgbe advertise setting warning Sponsored by: Multiplay Modified: stable/10/sys/dev/ixgbe/if_ix.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Sat Mar 19 09:20:18 2016 (r297049) +++ stable/10/sys/dev/ixgbe/if_ix.c Sat Mar 19 11:35:53 2016 (r297050) @@ -4756,10 +4756,6 @@ ixgbe_sysctl_advertise(SYSCTL_HANDLER_AR if ((error) || (req->newptr == NULL)) return (error); - /* Checks to validate new value */ - if (adapter->advertise == advertise) /* no change */ - return (0); - return ixgbe_set_advertise(adapter, advertise); } @@ -4770,6 +4766,10 @@ ixgbe_set_advertise(struct adapter *adap struct ixgbe_hw *hw; ixgbe_link_speed speed; + /* Checks to validate new value */ + if (adapter->advertise == advertise) /* no change */ + return (0); + hw = &adapter->hw; dev = adapter->dev; From owner-svn-src-stable-10@freebsd.org Sat Mar 19 22:56:21 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF22AD5FA3; Sat, 19 Mar 2016 22:56:21 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A49B15E8; Sat, 19 Mar 2016 22:56:21 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2JMuKeo059315; Sat, 19 Mar 2016 22:56:20 GMT (envelope-from jgh@FreeBSD.org) Received: (from jgh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2JMuKpG059314; Sat, 19 Mar 2016 22:56:20 GMT (envelope-from jgh@FreeBSD.org) Message-Id: <201603192256.u2JMuKpG059314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jgh set sender to jgh@FreeBSD.org using -f From: Jason Helfman Date: Sat, 19 Mar 2016 22:56:20 +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: r297054 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Mar 2016 22:56:22 -0000 Author: jgh (doc,ports committer) Date: Sat Mar 19 22:56:20 2016 New Revision: 297054 URL: https://svnweb.freebsd.org/changeset/base/297054 Log: MFC: 296167 - address obsolete Kerberos options PR: 205168 Submitted by: kevin@bostoncrypto.com Reviewed by: bjk MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5430 Modified: stable/10/share/man/man5/rc.conf.5 Modified: stable/10/share/man/man5/rc.conf.5 ============================================================================== --- stable/10/share/man/man5/rc.conf.5 Sat Mar 19 16:16:56 2016 (r297053) +++ stable/10/share/man/man5/rc.conf.5 Sat Mar 19 22:56:20 2016 (r297054) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 9, 2015 +.Dd February 28, 2016 .Dt RC.CONF 5 .Os .Sh NAME @@ -2120,25 +2120,25 @@ If set to run the .Xr unbound 8 daemon as a local caching resolver. -.It Va kerberos5_server_enable +.It Va kdc_enable .Pq Vt bool Set to .Dq Li YES to start a Kerberos 5 authentication server at boot time. -.It Va kerberos5_server +.It Va kdc_program .Pq Vt str If -.Va kerberos5_server_enable +.Va kdc_enable is set to .Dq Li YES this is the path to Kerberos 5 Authentication Server. -.It Va kerberos5_server_flags +.It Va kdc_flags .Pq Vt str Empty by default. This variable contains additional flags to be passed to the Kerberos 5 authentication server. -.It Va kadmind5_server_enable +.It Va kadmind_enable .Pq Vt bool Set to .Dq Li YES @@ -2147,14 +2147,14 @@ to start the Kerberos 5 Administration Daemon; set to .Dq Li NO on a slave server. -.It Va kadmind5_server +.It Va kadmind_program .Pq Vt str If -.Va kadmind5_server_enable +.Va kadmind_enable is set to .Dq Li YES this is the path to Kerberos 5 Administration Daemon. -.It Va kpasswdd_server_enable +.It Va kpasswdd_enable .Pq Vt bool Set to .Dq Li YES @@ -2163,10 +2163,10 @@ to start the Kerberos 5 Password-Changing Daemon; set to .Dq Li NO on a slave server. -.It Va kpasswdd_server +.It Va kpasswdd_program .Pq Vt str If -.Va kpasswdd_server_enable +.Va kpasswdd_enable is set to .Dq Li YES this is the path to Kerberos 5 Password-Changing Daemon. From owner-svn-src-stable-10@freebsd.org Sat Mar 19 23:07:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53333AD622F; Sat, 19 Mar 2016 23:07:06 +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 2241AA94; Sat, 19 Mar 2016 23:07:06 +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 u2JN755c062320; Sat, 19 Mar 2016 23:07:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2JN7560062319; Sat, 19 Mar 2016 23:07:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603192307.u2JN7560062319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 19 Mar 2016 23:07:05 +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: r297055 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Mar 2016 23:07:06 -0000 Author: pfg Date: Sat Mar 19 23:07:05 2016 New Revision: 297055 URL: https://svnweb.freebsd.org/changeset/base/297055 Log: MFC r295811: Ext2: cleanup setting of ctime/mtime/birthtime. This adopts the same change as r291936 for UFS. Directly clear IN_ACCESS or IN_UPDATE when user supplied the time, and copy the value into the inode. This keeps the behaviour cleaner and is consistent with UFS. Reviewed by: bde Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vnops.c Sat Mar 19 22:56:20 2016 (r297054) +++ stable/10/sys/fs/ext2fs/ext2_vnops.c Sat Mar 19 23:07:05 2016 (r297055) @@ -464,16 +464,14 @@ ext2_setattr(struct vop_setattr_args *ap ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(vp, VWRITE, cred, td)))) return (error); - if (vap->va_atime.tv_sec != VNOVAL) - ip->i_flag |= IN_ACCESS; - if (vap->va_mtime.tv_sec != VNOVAL) - ip->i_flag |= IN_CHANGE | IN_UPDATE; - ext2_itimes(vp); + ip->i_flag |= IN_CHANGE | IN_MODIFIED; if (vap->va_atime.tv_sec != VNOVAL) { + ip->i_flag &= ~IN_ACCESS; ip->i_atime = vap->va_atime.tv_sec; ip->i_atimensec = vap->va_atime.tv_nsec; } if (vap->va_mtime.tv_sec != VNOVAL) { + ip->i_flag &= ~IN_UPDATE; ip->i_mtime = vap->va_mtime.tv_sec; ip->i_mtimensec = vap->va_mtime.tv_nsec; }