From owner-svn-src-projects@FreeBSD.ORG Thu Dec 29 11:37:16 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 944161065678; Thu, 29 Dec 2011 11:37:16 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64D7F8FC13; Thu, 29 Dec 2011 11:37:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBTBbGnJ054409; Thu, 29 Dec 2011 11:37:16 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBTBbG34054407; Thu, 29 Dec 2011 11:37:16 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201112291137.pBTBbG34054407@svn.freebsd.org> From: Peter Holm Date: Thu, 29 Dec 2011 11:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228950 - projects/stress2/misc X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2011 11:37:16 -0000 Author: pho Date: Thu Dec 29 11:37:15 2011 New Revision: 228950 URL: http://svn.freebsd.org/changeset/base/228950 Log: Use the global configuration file for MD(4) operations. Limit run time to half an hour. Modified: projects/stress2/misc/snap3.sh Modified: projects/stress2/misc/snap3.sh ============================================================================== --- projects/stress2/misc/snap3.sh Thu Dec 29 11:36:24 2011 (r228949) +++ projects/stress2/misc/snap3.sh Thu Dec 29 11:37:15 2011 (r228950) @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2008 Peter Holm +# Copyright (c) 2008, 2011 Peter Holm # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -30,29 +30,35 @@ [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + # Test with two snapshots # 20070506 Page fault in g_io_request+0x7f -mount | grep "/dev/md0 on /mnt" > /dev/null && umount /mnt +mount | grep -q /tmp || exit 1 # /tmp must be a mount point for this test rm -f /tmp/.snap/pho.1 rm -f /tmp/.snap/pho.2 trap "rm -f /tmp/.snap/pho.?" 0 -mount | grep "/mnt" | grep md5 > /dev/null && umount /mnt -mdconfig -l | grep -q md5 && mdconfig -d -u 5 -mdconfig -l | grep -q md6 && mdconfig -d -u 6 +mount | grep $mntpoint | grep -q md && umount $mntpoint +m1=$mdstart +m2=$((m1 + 1)) +mdconfig -l | grep -q md$m1 && mdconfig -d -u $m1 +mdconfig -l | grep -q md$m2 && mdconfig -d -u $m2 -for i in `jot 64`; do +start=`date '+%s'` +while [ `date '+%s'` -lt $((start + 1800)) ]; do mksnap_ffs /tmp /tmp/.snap/pho.1 mksnap_ffs /tmp /tmp/.snap/pho.2 - mdconfig -a -t vnode -f /tmp/.snap/pho.1 -u 5 -o readonly - mdconfig -a -t vnode -f /tmp/.snap/pho.2 -u 6 -o readonly - mount -o ro /dev/md5 /mnt - - sleep 3 - - umount /mnt - mdconfig -d -u 5 - mdconfig -d -u 6 - rm -f /tmp/.snap/pho.1 - rm -f /tmp/.snap/pho.2 + if [ -r /tmp/.snap/pho.1 -a -r /tmp/.snap/pho.2 ]; then + mdconfig -a -t vnode -f /tmp/.snap/pho.1 -u $m1 -o readonly + mdconfig -a -t vnode -f /tmp/.snap/pho.2 -u $m2 -o readonly + mount -o ro /dev/md$m1 $mntpoint + + sleep 3 + + umount $mntpoint + mdconfig -d -u $m1 + mdconfig -d -u $m2 + fi + rm -f /tmp/.snap/pho.1 /tmp/.snap/pho.2 done