From owner-svn-src-user@FreeBSD.ORG Sun Sep 8 21:04:43 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B9D89322; Sun, 8 Sep 2013 21:04:43 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A753B2160; Sun, 8 Sep 2013 21:04:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88L4heh061341; Sun, 8 Sep 2013 21:04:43 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88L4hO0061340; Sun, 8 Sep 2013 21:04:43 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201309082104.r88L4hO0061340@svn.freebsd.org> From: Colin Percival Date: Sun, 8 Sep 2013 21:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255406 - user/cperciva/freebsd-update-mirror X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2013 21:04:43 -0000 Author: cperciva Date: Sun Sep 8 21:04:43 2013 New Revision: 255406 URL: http://svnweb.freebsd.org/changeset/base/255406 Log: Refuse to package up files for publication if their permissions are set such that they will not be readable by the web server. Modified: user/cperciva/freebsd-update-mirror/umirror-package.sh Modified: user/cperciva/freebsd-update-mirror/umirror-package.sh ============================================================================== --- user/cperciva/freebsd-update-mirror/umirror-package.sh Sun Sep 8 20:48:23 2013 (r255405) +++ user/cperciva/freebsd-update-mirror/umirror-package.sh Sun Sep 8 21:04:43 2013 (r255406) @@ -17,6 +17,14 @@ if [ -z "${ID}" ]; then ID=`date "+%s"` fi +# Check that the files we're publishing have publishable permissions +if find "${PRIVDIR}" \! -perm -444 | grep -q .; then + echo "Files to be published have bad permissions:" + find "${PRIVDIR}" \! -perm -444 + echo + echo "You should fix this before publishing them." +fi + # Create a tarball tar -cf "${PRIVDIR}/dec-${ID}" -C "${STAGEDIR}" . From owner-svn-src-user@FreeBSD.ORG Sun Sep 8 21:07:42 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1873C636; Sun, 8 Sep 2013 21:07:42 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 04F3B2186; Sun, 8 Sep 2013 21:07:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88L7fHe062995; Sun, 8 Sep 2013 21:07:41 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88L7fuH062994; Sun, 8 Sep 2013 21:07:41 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201309082107.r88L7fuH062994@svn.freebsd.org> From: Colin Percival Date: Sun, 8 Sep 2013 21:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255407 - user/cperciva/freebsd-update-mirror X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2013 21:07:42 -0000 Author: cperciva Date: Sun Sep 8 21:07:41 2013 New Revision: 255407 URL: http://svnweb.freebsd.org/changeset/base/255407 Log: Don't just print an error message, actually refuse to keep going. Modified: user/cperciva/freebsd-update-mirror/umirror-package.sh Modified: user/cperciva/freebsd-update-mirror/umirror-package.sh ============================================================================== --- user/cperciva/freebsd-update-mirror/umirror-package.sh Sun Sep 8 21:04:43 2013 (r255406) +++ user/cperciva/freebsd-update-mirror/umirror-package.sh Sun Sep 8 21:07:41 2013 (r255407) @@ -23,6 +23,7 @@ if find "${PRIVDIR}" \! -perm -444 | gre find "${PRIVDIR}" \! -perm -444 echo echo "You should fix this before publishing them." + exit 1 fi # Create a tarball From owner-svn-src-user@FreeBSD.ORG Sun Sep 8 21:10:49 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 07EA47AB; Sun, 8 Sep 2013 21:10:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E8A4821A8; Sun, 8 Sep 2013 21:10:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88LAmJZ065907; Sun, 8 Sep 2013 21:10:48 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88LAmef065906; Sun, 8 Sep 2013 21:10:48 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201309082110.r88LAmef065906@svn.freebsd.org> From: Colin Percival Date: Sun, 8 Sep 2013 21:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255408 - user/cperciva/freebsd-update-mirror X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2013 21:10:49 -0000 Author: cperciva Date: Sun Sep 8 21:10:48 2013 New Revision: 255408 URL: http://svnweb.freebsd.org/changeset/base/255408 Log: Refuse to create a new package of bits with the same name as an old package. The mirroring code keeps track of which packages it has downloaded already, so this would result in bits never reaching the mirrors. Submitted by: delphij Modified: user/cperciva/freebsd-update-mirror/umirror-package.sh Modified: user/cperciva/freebsd-update-mirror/umirror-package.sh ============================================================================== --- user/cperciva/freebsd-update-mirror/umirror-package.sh Sun Sep 8 21:07:41 2013 (r255407) +++ user/cperciva/freebsd-update-mirror/umirror-package.sh Sun Sep 8 21:10:48 2013 (r255408) @@ -15,6 +15,13 @@ fi # Set an ID if we don't have one already if [ -z "${ID}" ]; then ID=`date "+%s"` +else + while read EID X Y; do + if [ "${EID}" = "${ID}" ]; then + echo "Error: ${ID} already exists, this may be not what you want." + exit 1 + fi + done < "${PRIVDIR}/flist" fi # Check that the files we're publishing have publishable permissions From owner-svn-src-user@FreeBSD.ORG Tue Sep 10 05:59:10 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C74462AF; Tue, 10 Sep 2013 05:59:10 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4AE92C0E; Tue, 10 Sep 2013 05:59:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8A5xAsU044734; Tue, 10 Sep 2013 05:59:10 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8A5xABV044731; Tue, 10 Sep 2013 05:59:10 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201309100559.r8A5xABV044731@svn.freebsd.org> From: Peter Holm Date: Tue, 10 Sep 2013 05:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255441 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2013 05:59:10 -0000 Author: pho Date: Tue Sep 10 05:59:09 2013 New Revision: 255441 URL: http://svnweb.freebsd.org/changeset/base/255441 Log: Added three new mmap(2) test scenarios. Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/mmap5.sh (contents, props changed) user/pho/stress2/misc/mmap6.sh (contents, props changed) user/pho/stress2/misc/mmap7.sh (contents, props changed) Added: user/pho/stress2/misc/mmap5.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mmap5.sh Tue Sep 10 05:59:09 2013 (r255441) @@ -0,0 +1,129 @@ +#!/bin/sh + +# +# Copyright (c) 2013 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Test scenario inspired by alc@ +# "panic: vm_page_dirty: page is invalid!" seen. + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/wire_no_page.c +cc -o mmap5 -Wall -Wextra wire_no_page.c || exit 1 +rm -f wire_no_page.c +cd $odir + +cp /tmp/mmap5 /tmp/mmap5.inputfile +(cd ../testcases/swap; ./swap -t 1m -i 2) & +cp /tmp/mmap5 /tmp/mmap5.inputfile +/tmp/mmap5 /tmp/mmap5.inputfile +while ps auxww | grep -v grep | grep -qw swap; do + killall -9 swap 2>/dev/null + sleep .1 +done +wait +rm -f /tmp/mmap5 /tmp/mmap5.inputfile +exit + +EOF +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const char *file; + +void +test2(void) +{ + struct stat st; + char *p; + size_t len; + int error, fd; + + if ((fd = open(file, O_RDWR)) == -1) + err(1, "open %s", file); + if ((error = fstat(fd, &st)) == -1) + err(1, "stat(%s)", file); + len = round_page(st.st_size); + if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) + err(1, "mmap"); + p[arc4random() % len] = 1; + if (arc4random() % 100 < 50) + if ((error = mlock(p, len)) == -1) + err(1, "mlock"); + p[arc4random() % len] = 1; + if (arc4random() % 100 < 50) + if ((error = msync(p, len, MS_SYNC | MS_INVALIDATE)) == -1) + if (errno != EBUSY) + err(1, "msync"); + if (munmap(p, len) == -1) + err(1, "unmap()"); + close(fd); + _exit(0); + +} + +void +test(void) +{ + int i; + + for (i = 0; i < 3; i++) + if (fork() == 0) + test2(); + for (i = 0; i < 3; i++) + wait(NULL); + + _exit(0); +} + +int +main(int argc, char *argv[]) +{ + int i; + + if (argc != 2) + errx(1, "Usage: %s ", argv[0]); + file = argv[1]; + + for (i = 0; i < 30000; i++) { + if (fork() == 0) + test(); + wait(NULL); + } + + return (0); +} Added: user/pho/stress2/misc/mmap6.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mmap6.sh Tue Sep 10 05:59:09 2013 (r255441) @@ -0,0 +1,174 @@ +#!/bin/sh + +# +# Copyright (c) 2013 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Test scenario inspired by alc@ +# "panic: vm_page_dirty: page is invalid!" seen. + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/wire_no_page.c +cc -o mmap6 -Wall -Wextra wire_no_page.c || exit 1 +rm -f wire_no_page.c +cd $odir + +cp /tmp/mmap6 /tmp/mmap6.inputfile +(cd ../testcases/swap; ./swap -t 1m -i 2) & +cp /tmp/mmap6 /tmp/mmap6.inputfile +/tmp/mmap6 /tmp/mmap6.inputfile +while ps auxww | grep -v grep | grep -qw swap; do + killall -9 swap 2>/dev/null + sleep .1 +done +wait +rm -f /tmp/mmap6 /tmp/mmap6.inputfile +exit + +EOF +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const char *file; +char c; + +void +rd(void) +{ + struct stat st; + char *p1, *p2; + size_t len; + int error, fd; + + if ((fd = open(file, O_RDONLY)) == -1) + err(1, "open %s", file); + if ((error = fstat(fd, &st)) == -1) + err(1, "stat(%s)", file); + len = round_page(st.st_size); + if ((p1 = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) + err(1, "mmap"); + if ((p2 = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) + err(1, "mmap"); + c = p1[arc4random() % len]; + c = p2[arc4random() % len]; + if (arc4random() % 100 < 50) + if ((error = mlock(p1, len)) == -1) + err(1, "mlock"); + c = p1[arc4random() % len]; + if (munmap(p2, len) == -1) + err(1, "unmap()"); + if (munmap(p1, len) == -1) + err(1, "unmap()"); + close(fd); + +} +void +wr(void) +{ + struct stat st; + char *p1, *p2; + size_t len; + int error, fd; + + if ((fd = open(file, O_RDWR)) == -1) + err(1, "open %s", file); + if ((error = fstat(fd, &st)) == -1) + err(1, "stat(%s)", file); + len = round_page(st.st_size); + if ((p1 = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) + err(1, "mmap"); + if ((p2 = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) + err(1, "mmap"); + p1[arc4random() % len] = 1; + p2[arc4random() % len] = 1; + if (arc4random() % 100 < 50) + if ((error = mlock(p1, len)) == -1) + err(1, "mlock"); + p1[arc4random() % len] = 1; + if (arc4random() % 100 < 50) + if ((error = msync(p1, len, MS_SYNC | MS_INVALIDATE)) == -1) + if (errno != EBUSY) + err(1, "msync"); + if (munmap(p2, len) == -1) + err(1, "unmap()"); + if (munmap(p1, len) == -1) + err(1, "unmap()"); + close(fd); + +} + +void +test2(void) +{ + if (arc4random() % 100 < 30) + rd(); + else + wr(); + _exit(0); +} + +void +test(void) +{ + int i; + + for (i = 0; i < 3; i++) + if (fork() == 0) + test2(); + for (i = 0; i < 3; i++) + wait(NULL); + + _exit(0); +} + +int +main(int argc, char *argv[]) +{ + int i; + + if (argc != 2) + errx(1, "Usage: %s ", argv[0]); + file = argv[1]; + + for (i = 0; i < 30000; i++) { + if (fork() == 0) + test(); + wait(NULL); + } + + return (0); +} Added: user/pho/stress2/misc/mmap7.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mmap7.sh Tue Sep 10 05:59:09 2013 (r255441) @@ -0,0 +1,147 @@ +#!/bin/sh + +# +# Copyright (c) 2013 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Test scenario inspired by alc@ +# Threaded version in order to "use the same pmap", as pointed out by kib@ + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/wire_no_page.c +cc -o mmap7 -Wall -Wextra wire_no_page.c -lpthread || exit 1 +rm -f wire_no_page.c +cd $odir + +cp /tmp/mmap7 /tmp/mmap7.inputfile +(cd ../testcases/swap; ./swap -t 1m -i 2) & +cp /tmp/mmap7 /tmp/mmap7.inputfile +/tmp/mmap7 /tmp/mmap7.inputfile +while ps | grep -v grep | grep -qw swap; do + killall -9 swap 2>/dev/null + sleep .1 +done +wait +rm -f /tmp/mmap7 /tmp/mmap7.inputfile +exit + +EOF +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +char *p1, *p2, *p3; +char c; +const char *file; +int fd; +size_t len; +struct stat st; + +void * +test2(void *arg __unused) +{ + int error, i; + + p1[arc4random() % len] = 1; + p2[arc4random() % len] = 1; + + if (arc4random() % 100 < 30) + i = p3[arc4random() % len]; + + if (arc4random() % 100 < 50) + if ((error = mlock(p1, len)) == -1) + err(1, "mlock"); + if (arc4random() % 100 < 50) + if ((error = msync(p1, len, MS_SYNC | MS_INVALIDATE)) == -1) + if (errno != EBUSY) + err(1, "msync"); + return (0); +} + +void +test(void) +{ + int error, i; + pthread_t cp[3]; + + if ((fd = open(file, O_RDWR)) == -1) + err(1, "open %s", file); + if ((error = fstat(fd, &st)) == -1) + err(1, "stat(%s)", file); + len = round_page(st.st_size); + if ((p1 = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) + err(1, "mmap"); + if ((p2 = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) + err(1, "mmap"); + if ((p3 = mmap(NULL, len, PROT_READ , MAP_SHARED, fd, 0)) == MAP_FAILED) + err(1, "mmap"); + + for (i = 0; i < 3; i++) + if (pthread_create(&cp[i], NULL, test2, NULL) != 0) + perror("pthread_create"); + for (i = 0; i < 3; i++) + pthread_join(cp[i], NULL); + + if (munmap(p3, len) == -1) + err(1, "unmap()"); + if (munmap(p2, len) == -1) + err(1, "unmap()"); + if (munmap(p1, len) == -1) + err(1, "unmap()"); + close(fd); + + _exit(0); +} + +int +main(int argc, char *argv[]) +{ + int i; + + if (argc != 2) + errx(1, "Usage: %s ", argv[0]); + file = argv[1]; + + for (i = 0; i < 30000; i++) { + if (fork() == 0) + test(); + wait(NULL); + } + + return (0); +} From owner-svn-src-user@FreeBSD.ORG Tue Sep 10 21:09:20 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EAEA6921; Tue, 10 Sep 2013 21:09:20 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D80392C0F; Tue, 10 Sep 2013 21:09:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8AL9Kp2008056; Tue, 10 Sep 2013 21:09:20 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8AL9KZ3008054; Tue, 10 Sep 2013 21:09:20 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201309102109.r8AL9KZ3008054@svn.freebsd.org> From: Colin Percival Date: Tue, 10 Sep 2013 21:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255458 - user/cperciva/freebsd-update-mirror X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2013 21:09:21 -0000 Author: cperciva Date: Tue Sep 10 21:09:20 2013 New Revision: 255458 URL: http://svnweb.freebsd.org/changeset/base/255458 Log: Fix my previous commit here: It's the *staging* directory which needs to have world-readable files in it, not our private state directory. [1] While here, don't warn about the directory itself, since we only tar up the contents to send out to the mirrors. [2] Pointy hat to: cperciva [1] Submitted by: des [2] Modified: user/cperciva/freebsd-update-mirror/umirror-package.sh Modified: user/cperciva/freebsd-update-mirror/umirror-package.sh ============================================================================== --- user/cperciva/freebsd-update-mirror/umirror-package.sh Tue Sep 10 20:56:01 2013 (r255457) +++ user/cperciva/freebsd-update-mirror/umirror-package.sh Tue Sep 10 21:09:20 2013 (r255458) @@ -25,9 +25,9 @@ else fi # Check that the files we're publishing have publishable permissions -if find "${PRIVDIR}" \! -perm -444 | grep -q .; then +if find "${STAGEDIR}" \! -type f -perm -444 | grep -q .; then echo "Files to be published have bad permissions:" - find "${PRIVDIR}" \! -perm -444 + find "${STAGEDIR}" \! -type f -perm -444 echo echo "You should fix this before publishing them." exit 1 From owner-svn-src-user@FreeBSD.ORG Wed Sep 11 06:16:13 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 83D3535E; Wed, 11 Sep 2013 06:16:13 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 61A772766; Wed, 11 Sep 2013 06:16:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8B6GDRa008250; Wed, 11 Sep 2013 06:16:13 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8B6GDbJ008249; Wed, 11 Sep 2013 06:16:13 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201309110616.r8B6GDbJ008249@svn.freebsd.org> From: Peter Holm Date: Wed, 11 Sep 2013 06:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255466 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2013 06:16:13 -0000 Author: pho Date: Wed Sep 11 06:16:12 2013 New Revision: 255466 URL: http://svnweb.freebsd.org/changeset/base/255466 Log: Added one more "umount -f" test scenario. Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/umountf7.sh (contents, props changed) Added: user/pho/stress2/misc/umountf7.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/umountf7.sh Wed Sep 11 06:16:12 2013 (r255466) @@ -0,0 +1,170 @@ +#!/bin/sh + +# +# Copyright (c) 2013 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# "panic: handle_written_inodeblock: live inodedep 0xcc731200" seen. +# http://people.freebsd.org/~pho/stress/log/umountf7.txt +# Problem only seen with SU+J. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/mv4.c +cc -o mv4 -Wall -Wextra mv4.c -lpthread || exit 1 +rm -f mv4.c +cd $odir + +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 3g -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto +newfs -j md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint + +daemon sh -c '(cd ../testcases/swap; ./swap -t 2m -i 4)' +parallel=4 +for j in `jot $parallel`; do + [ -d $mntpoint/$j ] || mkdir $mntpoint/$j +done +for j in `jot $parallel`; do + (cd $mntpoint/$j; /tmp/mv4 100000) & +done +sleep 60 +umount -f $mntpoint +killall mv4 +for j in `jot $parallel`; do + wait +done +while ps auxww | grep -v grep | grep -qw swap; do + killall -9 swap 2>/dev/null +done +find $mntpoint -type f + +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart +rm -f /tmp/mv4 +exit + +EOF +#include +#include +#include +#include +#include +#include + +pid_t pid; +volatile int n, n2; +int mx; + +void * +cr(void *arg __unused) +{ + char file[80]; + int fd, i; + + for (i = 0; i < mx; i++) { + snprintf(file, sizeof(file), "f%06d.%06d", pid, i); + if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC, 0600)) < 0) + err(1, "open(%s)", file); + close(fd); + n++; + } + return (0); + +} + +void * +mv(void *arg __unused) +{ + char from[80], to[80]; + int i; + + for (i = 0; i < mx; i++) { + while (n == -1 || i > n) + pthread_yield(); + snprintf(from, sizeof(from), "f%06d.%06d", pid, i); + snprintf(to , sizeof(to ), "g%06d.%06d", pid, i); + if (rename(from, to) == -1) + warn("rename(%s, %s)", from, to); + n2++; + } + + return (0); +} + +void * +rm(void *arg __unused) +{ + char file[80]; + int i; + + for (i = 0; i < mx; i++) { + while (n2 == -1 || i > n2) + pthread_yield(); + snprintf(file, sizeof(file), "g%06d.%06d", pid, i); + if (unlink(file) == -1) + warn("unlink(%s)", file); + } + + return (0); +} + +int +main(int argc, char **argv) +{ + pthread_t rp[3]; + int i; + + if (argc != 2) + errx(1, "Usage: %s ", argv[0]); + mx = atoi(argv[1]); + n = n2 = -1; + pid = getpid(); + + if (pthread_create(&rp[0], NULL, cr, NULL) != 0) + err(1, "pthread_create"); + usleep(arc4random() % 1000); + if (pthread_create(&rp[1], NULL, mv, NULL) != 0) + err(1, "pthread_mv"); + usleep(arc4random() % 1000); + if (pthread_create(&rp[2], NULL, rm, NULL) != 0) + perror("pthread_rm"); + + for (i = 0; i < 3; i++) + pthread_join(rp[i], NULL); + + return (0); +} From owner-svn-src-user@FreeBSD.ORG Wed Sep 11 10:51:02 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D15B0860; Wed, 11 Sep 2013 10:51:02 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B126222E6; Wed, 11 Sep 2013 10:51:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BAp2A2023807; Wed, 11 Sep 2013 10:51:02 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BAp2gb023806; Wed, 11 Sep 2013 10:51:02 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201309111051.r8BAp2gb023806@svn.freebsd.org> From: Peter Holm Date: Wed, 11 Sep 2013 10:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255473 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2013 10:51:03 -0000 Author: pho Date: Wed Sep 11 10:51:02 2013 New Revision: 255473 URL: http://svnweb.freebsd.org/changeset/base/255473 Log: Added sendfile(2) for the posix shared memory segment file descriptor test scenario. Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/sendfile_shm.sh (contents, props changed) Added: user/pho/stress2/misc/sendfile_shm.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/sendfile_shm.sh Wed Sep 11 10:51:02 2013 (r255473) @@ -0,0 +1,206 @@ +#!/bin/sh + +# +# Copyright (c) 2013 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Sendfile(2) over posix shmfd +# Test scenario by kib@ + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +[ -r /boot/kernel/kernel ] || exit 0 +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > sendfile_shm.c +cc -o sendfile_shm -Wall -Wextra -O2 sendfile_shm.c || exit 1 +rm -f sendfile_shm.c +cd $here + +daemon ../testcases/swap/swap -t 2m -i 20 > /dev/null 2>&1 +sleep 5 +for i in `jot 10`; do + /tmp/sendfile_shm /boot/kernel/kernel /tmp/sendfile_shm.$i > \ + /dev/null & +done +for i in `jot 10`; do + wait +done +while ps aux | grep -v grep | grep -q swap; do + killall -9 swap + sleep .5 +done +for i in `jot 10`; do + cmp -s /boot/kernel/kernel /tmp/sendfile_shm.$i 2>/dev/null || + e=1 + rm -f /tmp/sendfile_shm.$i +done +[ -n "$e" ] && echo FAIL +wait + +rm -f /tmp/sendfile_shm +exit +EOF +/* $Id: sendfile_shm1.c,v 1.2 2013/08/25 14:35:14 kostik Exp kostik $ */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PAGE_SIZE 4096 +static const char zerob[PAGE_SIZE]; + +static void +load(int infd, int shmfd, off_t size) +{ + off_t c, r; + char buf[100]; + + for (c = 0; c < size; c += r) { + r = read(infd, buf, sizeof(buf)); + if (r == -1) + err(1, "read disk"); + else if (r == 0) + errx(1, "too short"); + write(shmfd, buf, r); + } +} + +static void +sendfd(int s, int shmfd, off_t size) +{ + off_t sbytes; + int error; + + error = sendfile(shmfd, s, 0, size, NULL, &sbytes, 0); + if (error == -1) + err(1, "sendfile(%d, %d, %jd)", s, shmfd, size); + printf("sent %jd bytes, requested %jd\n", (uintmax_t)sbytes, + (uintmax_t)size); +} + +static void +receivefd(int s, int outfd, off_t size) +{ + char buf[100]; + off_t c, r, r1; + + for (c = 0; c < size; c += r) { + r = read(s, buf, sizeof(buf)); + if (r == -1) + err(1, "read sock"); + else if (r == 0) + break; + else { + r1 = write(outfd, buf, r); + if (r1 == -1) + err(1, "write disk"); + else if (r1 != r) { + err(1, "short write %jd %jd", + (uintmax_t)r, (uintmax_t)r1); + } + } + } + printf("received %jd bytes\n", (uintmax_t)c); +} + +int +main(int argc, char *argv[]) +{ + struct stat st; + struct sigaction sa; + pid_t child; + int s[2], infd, outfd, shmfd, error; + + if (argc != 3) { + fprintf(stderr, "usage: sendfile_shm infile outfile\n"); + exit(2); + } + + memset(&sa, 0, sizeof(sa)); + sa.sa_handler = SIG_IGN; + error = sigaction(SIGPIPE, &sa, NULL); + if (error == -1) + err(1, "sigaction SIGPIPE"); + + infd = open(argv[1], O_RDONLY); + if (infd == -1) + err(1, "open %s", argv[1]); + error = fstat(infd, &st); + if (error == -1) + err(1, "stat"); + + outfd = open(argv[2], O_RDWR | O_CREAT | O_TRUNC, 0666); + if (outfd == -1) + err(1, "open %s", argv[2]); + + shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); + if (shmfd == -1) + err(1, "shm_open"); + error = ftruncate(shmfd, st.st_size); + if (error == -1) + err(1, "ftruncate"); + load(infd, shmfd, st.st_size); + + error = socketpair(AF_UNIX, SOCK_STREAM, 0, s); + if (error == -1) + err(1, "socketpair"); + + fflush(stdout); + fflush(stderr); + child = fork(); + if (child == -1) + err(1, "fork"); + else if (child == 0) { + close(s[1]); + sendfd(s[0], shmfd, st.st_size); + exit(0); + } else { + close(shmfd); + close(s[0]); + sleep(1); + receivefd(s[1], outfd, st.st_size); + } + + return (0); +} From owner-svn-src-user@FreeBSD.ORG Wed Sep 11 23:36:38 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2AA767A8; Wed, 11 Sep 2013 23:36:38 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3BA0208B; Wed, 11 Sep 2013 23:36:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BNabBH033172; Wed, 11 Sep 2013 23:36:37 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BNabQc033171; Wed, 11 Sep 2013 23:36:37 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201309112336.r8BNabQc033171@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 11 Sep 2013 23:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255481 - user/obrien/libmd-ossl X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2013 23:36:38 -0000 Author: obrien Date: Wed Sep 11 23:36:37 2013 New Revision: 255481 URL: http://svnweb.freebsd.org/changeset/base/255481 Log: OBE Deleted: user/obrien/libmd-ossl/ From owner-svn-src-user@FreeBSD.ORG Wed Sep 11 23:36:56 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A4EE588B; Wed, 11 Sep 2013 23:36:56 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 79F552091; Wed, 11 Sep 2013 23:36:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8BNau18033270; Wed, 11 Sep 2013 23:36:56 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8BNauOq033269; Wed, 11 Sep 2013 23:36:56 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201309112336.r8BNauOq033269@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 11 Sep 2013 23:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255482 - user/obrien/libmd-ossl X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2013 23:36:56 -0000 Author: obrien Date: Wed Sep 11 23:36:56 2013 New Revision: 255482 URL: http://svnweb.freebsd.org/changeset/base/255482 Log: Branch for a WIP. Added: - copied from r255481, head/ Directory Properties: user/obrien/libmd-ossl/ (props changed) From owner-svn-src-user@FreeBSD.ORG Fri Sep 13 11:01:27 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 326E7243; Fri, 13 Sep 2013 11:01:27 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06E4529CB; Fri, 13 Sep 2013 11:01:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DB1QUm009817; Fri, 13 Sep 2013 11:01:26 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DB1QdX009816; Fri, 13 Sep 2013 11:01:26 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201309131101.r8DB1QdX009816@svn.freebsd.org> From: Peter Holm Date: Fri, 13 Sep 2013 11:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255512 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2013 11:01:27 -0000 Author: pho Date: Fri Sep 13 11:01:26 2013 New Revision: 255512 URL: http://svnweb.freebsd.org/changeset/base/255512 Log: Fix compiler warning. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/tmpfs6.sh Modified: user/pho/stress2/misc/tmpfs6.sh ============================================================================== --- user/pho/stress2/misc/tmpfs6.sh Fri Sep 13 10:37:24 2013 (r255511) +++ user/pho/stress2/misc/tmpfs6.sh Fri Sep 13 11:01:26 2013 (r255512) @@ -101,7 +101,7 @@ test(void) } int -main(int argc, char **argv) +main(void) { int i; From owner-svn-src-user@FreeBSD.ORG Fri Sep 13 11:25:44 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2D53577B; Fri, 13 Sep 2013 11:25:44 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1936C2B14; Fri, 13 Sep 2013 11:25:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DBPi3C023269; Fri, 13 Sep 2013 11:25:44 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DBPhuG023264; Fri, 13 Sep 2013 11:25:43 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201309131125.r8DBPhuG023264@svn.freebsd.org> From: Peter Holm Date: Fri, 13 Sep 2013 11:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255513 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2013 11:25:44 -0000 Author: pho Date: Fri Sep 13 11:25:42 2013 New Revision: 255513 URL: http://svnweb.freebsd.org/changeset/base/255513 Log: Added more SU+J test scenarios. Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/suj28.sh (contents, props changed) user/pho/stress2/misc/suj29.sh (contents, props changed) user/pho/stress2/misc/suj30.sh (contents, props changed) user/pho/stress2/misc/suj31.sh (contents, props changed) user/pho/stress2/misc/suj33.sh (contents, props changed) Added: user/pho/stress2/misc/suj28.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/suj28.sh Fri Sep 13 11:25:42 2013 (r255513) @@ -0,0 +1,89 @@ +#!/bin/sh + +# +# Copyright (c) 2012 Peter Holm +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Variation of suj26.sh where a missing "umount /mnt2" causes the following +# mksnap_ffs to loop. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 2g -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto + +[ $# -eq 1 ] && opt="$1" || opt="-j" +newfs $opt md${mdstart}$part > /dev/null 2>&1 + +mount /dev/md${mdstart}$part $mntpoint +mount +chmod 777 $mntpoint + +export runRUNTIME=5m +export RUNDIR=$mntpoint/stressX +export creatINCARNATIONS=2 + +export TESTPROGS=" +testcases/creat/creat +testcases/mkdir/mkdir +testcases/swap/swap +" +su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > /dev/null 2>&1 & +rpid=$! +mdstart2=$((mdstart + 1)) +mntpoint2=${mntpoint}2 +[ -d $mntpoint2 ] || mkdir $mntpoint2 +mount | grep $mntpoint2 | grep -q /dev/md && umount -f $mntpoint2 +mdconfig -l | grep -q md$mdstart2 && mdconfig -d -u $mdstart2 +while kill -0 $rpid 2> /dev/null; do + rm -f /mnt/.snap/suj28 + { mksnap_ffs /mnt /mnt/.snap/suj28 || continue; } 2>&1 | \ + grep -v "Resource temporarily unavailable" + [ ! -s /mnt/.snap/suj28 ] && continue + mdconfig -a -t vnode -f /mnt/.snap/suj28 -u $mdstart2 -o readonly + mount -r /dev/md$mdstart2 $mntpoint2 + + ls -l $mntpoint2 > /dev/null + +# Missing "umount $mntpoint2" causing the following mksnap_ffs to loop + mdconfig -d -u $mdstart2 +done +wait + +while mount | grep $mntpoint2 | grep -q /dev/md; do + umount $mntpoint2 || sleep 1 +done +mdconfig -l | grep -q md$mdstart2 && mdconfig -d -u $mdstart2 +while mount | grep "$mntpoint " | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart Added: user/pho/stress2/misc/suj29.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/suj29.sh Fri Sep 13 11:25:42 2013 (r255513) @@ -0,0 +1,71 @@ +#!/bin/sh + +# +# Copyright (c) 2012 Peter Holm +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# tunefs -j enable -S xxx regression test +# causes "Sparse journal inode 4." + +. ../default.cfg + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 2g -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto + +newfs -U md${mdstart}$part > /dev/null +echo "tunefs -j enable -S 10000000 /dev/md${mdstart}$part" +tunefs -j enable -S 10000000 /dev/md${mdstart}$part + +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +export runRUNTIME=5m +export RUNDIR=$mntpoint/stressX + +export LOAD=80 +export rwLOAD=80 +export TESTPROGS=" +testcases/creat/creat +testcases/rw/rw +testcases/swap/swap +testcases/mkdir/mkdir +" + +su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' + +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +checkfs /dev/md${mdstart}$part +tunefs -j disable /dev/md${mdstart}$part +checkfs /dev/md${mdstart}$part +mdconfig -d -u $mdstart Added: user/pho/stress2/misc/suj30.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/suj30.sh Fri Sep 13 11:25:42 2013 (r255513) @@ -0,0 +1,282 @@ +#!/bin/sh + +# +# Copyright (c) 2012 Peter Holm +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# SUJ rename test scenario by Andrey Zonov +# "panic: flush_pagedep_deps: MKDIR_PARENT" seen: +# http://people.freebsd.org/~pho/stress/log/suj30.txt + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > suj30.c +cc -o suj30 -Wall -Wextra -O2 suj30.c -lpthread +rm -f suj30.c + +mount | grep "on $mntpoint " | grep -q md$mdstart && umount $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 4g -u ${mdstart} +bsdlabel -w md$mdstart auto +newfs -j md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +for i in `jot 10`; do + /tmp/suj30 $mntpoint/test-$i 100000 & +done +for i in `jot 10`; do + wait +done + +while mount | grep -q $mntpoint; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart +rm -f /tmp/suj30 +exit 0 +EOF +/* + * Andrey Zonov (c) 2012 + * + * compile as `cc -o rename rename.c -lpthread' + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef __FreeBSD__ +#include +#define __NP__ +#endif +#include +#include +#include +#include +#include +#include + +#define LOCK(x) pthread_mutex_lock(&x.mtx) +#define UNLOCK(x) pthread_mutex_unlock(&x.mtx) +#define SIGNAL(x) pthread_cond_signal(&x.wait) +#define WAIT(x) pthread_cond_wait(&x.wait, &x.mtx) + +int max; +int exited; +char *dirname1; +char *dirname2; + +struct file { + char *name; + STAILQ_ENTRY(file) next; +}; + +struct files { + pthread_mutex_t mtx; + pthread_cond_t wait; + STAILQ_HEAD(, file) list; +}; + +static struct files newfiles; +static struct files renamedfiles; + +void *loop_create(void *arg __unused); +void *loop_rename(void *arg __unused); +void *loop_unlink(void *arg __unused); + +int +main(int argc, char **argv) +{ + int i; + int rc; + pthread_t tid[3]; + + if (argc != 3) + errx(1, "usage: pthread_count "); + + asprintf(&dirname1, "%s.1", argv[1]); + asprintf(&dirname2, "%s.2", argv[1]); + if (mkdir(dirname1, 0755) == -1) + err(1, "mkdir(%s)", dirname1); + if (mkdir(dirname2, 0755) == -1) + err(1, "mkdir(%s)", dirname2); + max = atoi(argv[2]); + + STAILQ_INIT(&newfiles.list); + STAILQ_INIT(&renamedfiles.list); + + rc = pthread_mutex_init(&newfiles.mtx, NULL); + if (rc != 0) + errc(1, rc, "pthread_mutex_init()"); + rc = pthread_cond_init(&newfiles.wait, NULL); + if (rc != 0) + errc(1, rc, "pthread_cond_init()"); + rc = pthread_mutex_init(&renamedfiles.mtx, NULL); + if (rc != 0) + errc(1, rc, "pthread_mutex_init()"); + rc = pthread_cond_init(&renamedfiles.wait, NULL); + if (rc != 0) + errc(1, rc, "pthread_cond_init()"); + + rc = pthread_create(&tid[0], NULL, loop_create, NULL); + if (rc != 0) + errc(1, rc, "pthread_create()"); + rc = pthread_create(&tid[1], NULL, loop_rename, NULL); + if (rc != 0) + errc(1, rc, "pthread_create()"); + rc = pthread_create(&tid[2], NULL, loop_unlink, NULL); + if (rc != 0) + errc(1, rc, "pthread_create()"); + + for (i = 0; i < 3; i++) { + rc = pthread_join(tid[i], NULL); + if (rc != 0) + errc(1, rc, "pthread_join(%d)", i); + } + + rc = pthread_mutex_destroy(&newfiles.mtx); + if (rc != 0) + errc(1, rc, "pthread_mutex_destroy(newfiles)"); + rc = pthread_cond_destroy(&newfiles.wait); + if (rc != 0) + errc(1, rc, "pthread_cond_destroy(newfiles)"); + rc = pthread_mutex_destroy(&renamedfiles.mtx); + if (rc != 0) + errc(1, rc, "pthread_mutex_destroy(renamedfiles)"); + rc = pthread_cond_destroy(&renamedfiles.wait); + if (rc != 0) + errc(1, rc, "pthread_cond_destroy(renamedfiles)"); + rmdir(dirname1); + rmdir(dirname2); + free(dirname1); + free(dirname2); + + exit(0); +} + +void * +loop_create(void *arg __unused) +{ + int i; + struct file *file; + +#ifdef __NP__ + pthread_set_name_np(pthread_self(), __func__); +#endif + + for (i = 0; i < max; i++) { + file = malloc(sizeof(*file)); + asprintf(&file->name, "%s/filename_too-long:%d", dirname1, i); + if (mkdir(file->name, 0666) == -1) { + warn("mkdir(%s)", file->name); + free(file->name); + free(file); + break; + } + LOCK(newfiles); + STAILQ_INSERT_TAIL(&newfiles.list, file, next); + UNLOCK(newfiles); + SIGNAL(newfiles); + } + exited = 1; + SIGNAL(newfiles); + pthread_exit(NULL); +} + +void * +loop_rename(void *arg __unused) +{ + char *filename, *newname; + struct file *file; + +#ifdef __NP__ + pthread_set_name_np(pthread_self(), __func__); +#endif + + for ( ;; ) { + LOCK(newfiles); + while (STAILQ_EMPTY(&newfiles.list) && exited < 1) + WAIT(newfiles); + if (STAILQ_EMPTY(&newfiles.list) && exited == 1) { + UNLOCK(newfiles); + break; + } + file = STAILQ_FIRST(&newfiles.list); + STAILQ_REMOVE_HEAD(&newfiles.list, next); + UNLOCK(newfiles); + filename = strrchr(file->name, '/'); + asprintf(&newname, "%s/%s", dirname2, filename); + if (rename(file->name, newname) == -1) + err(1, "rename(%s, %s)", file->name, newname); + free(file->name); + file->name = newname; + LOCK(renamedfiles); + STAILQ_INSERT_TAIL(&renamedfiles.list, file, next); + UNLOCK(renamedfiles); + SIGNAL(renamedfiles); + } + exited = 2; + SIGNAL(renamedfiles); + pthread_exit(NULL); +} + +void * +loop_unlink(void *arg __unused) +{ + struct file *file; + +#ifdef __NP__ + pthread_set_name_np(pthread_self(), __func__); +#endif + + for ( ;; ) { + LOCK(renamedfiles); + while (STAILQ_EMPTY(&renamedfiles.list) && exited < 2) + WAIT(renamedfiles); + if (STAILQ_EMPTY(&renamedfiles.list) && exited == 2) { + UNLOCK(renamedfiles); + break; + } + file = STAILQ_FIRST(&renamedfiles.list); + STAILQ_REMOVE_HEAD(&renamedfiles.list, next); + UNLOCK(renamedfiles); + rmdir(file->name); + free(file->name); + free(file); + } + pthread_exit(NULL); +} Added: user/pho/stress2/misc/suj31.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/suj31.sh Fri Sep 13 11:25:42 2013 (r255513) @@ -0,0 +1,63 @@ +#!/bin/sh + +# +# Copyright (c) 2013 Peter Holm +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD: projects/stress2/misc/suj.sh 210724 2010-08-01 10:33:03Z pho $ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Run with marcus.cfg on a 2g swap backed MD +# Scenario: Update old disk to SU+J + +. ../default.cfg + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 2g -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto +newfs -U md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +export runRUNTIME=10m +export RUNDIR=$mntpoint/stressX +su $testuser -c 'cd ..; ./run.sh marcus.cfg' > /dev/null 2>&1 +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done + +tunefs -j enable /dev/md${mdstart}$part +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint +su $testuser -c 'cd ..; ./run.sh marcus.cfg' > /dev/null 2>&1 +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done + +checkfs /dev/md${mdstart}$part +mdconfig -d -u $mdstart Added: user/pho/stress2/misc/suj33.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/suj33.sh Fri Sep 13 11:25:42 2013 (r255513) @@ -0,0 +1,60 @@ +#!/bin/sh + +# +# Copyright (c) 2013 Peter Holm +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Test "umount" of active file system + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +mount | grep "$mntpoint" | grep -q md${mdstart}$part && umount $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +set -x +mdconfig -a -t swap -s 1g -u $mdstart +bsdlabel -w md$mdstart auto +newfs -j md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint +export RUNDIR=$mntpoint/stressX +export runRUNTIME=3m # Run tests for three minutes +chmod 777 $mntpoint + +su $testuser -c '(cd ..; ./run.sh disk.cfg)' > /dev/null 2>&1 & +sleep 20 +umount $mntpoint +killall -u $testuser +wait + +while mount | grep -q "$mntpoint "; do + umount $mntpoint || sleep 1 +done +set +x +checkfs /dev/md${mdstart}$part +mdconfig -d -u $mdstart From owner-svn-src-user@FreeBSD.ORG Sat Sep 14 06:43:10 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 886B7E4F; Sat, 14 Sep 2013 06:43:10 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7623C2535; Sat, 14 Sep 2013 06:43:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E6hAH7008156; Sat, 14 Sep 2013 06:43:10 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E6hAT3008154; Sat, 14 Sep 2013 06:43:10 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201309140643.r8E6hAT3008154@svn.freebsd.org> From: Peter Holm Date: Sat, 14 Sep 2013 06:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r255533 - user/pho/stress2 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2013 06:43:10 -0000 Author: pho Date: Sat Sep 14 06:43:09 2013 New Revision: 255533 URL: http://svnweb.freebsd.org/changeset/base/255533 Log: Fixed typo. Submitted by: yaneurabeya Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/README Modified: user/pho/stress2/README ============================================================================== --- user/pho/stress2/README Fri Sep 13 23:10:53 2013 (r255532) +++ user/pho/stress2/README Sat Sep 14 06:43:09 2013 (r255533) @@ -14,7 +14,7 @@ sh ./run.sh The "run.sh" script accepts an optional configuration file in order to test specific areas. For example: -./run.sh vfs.sh +./run.sh vfs.cfg To run all of the different test scenarios type: