From owner-svn-src-user@freebsd.org Mon Jan 16 11:00:15 2017 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A299CB0780 for ; Mon, 16 Jan 2017 11:00:15 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 543941A34; Mon, 16 Jan 2017 11:00:15 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GB0EiD097867; Mon, 16 Jan 2017 11:00:14 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GB0EN5097866; Mon, 16 Jan 2017 11:00:14 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201701161100.v0GB0EN5097866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 16 Jan 2017 11:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r312280 - 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.23 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: Mon, 16 Jan 2017 11:00:15 -0000 Author: pho Date: Mon Jan 16 11:00:14 2017 New Revision: 312280 URL: https://svnweb.freebsd.org/changeset/base/312280 Log: Added timeout for NFS problems seen (not on FreeBSD HEAD). Cleanup script and code while here Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/misc/readdir.sh Modified: user/pho/stress2/misc/readdir.sh ============================================================================== --- user/pho/stress2/misc/readdir.sh Mon Jan 16 09:16:11 2017 (r312279) +++ user/pho/stress2/misc/readdir.sh Mon Jan 16 11:00:14 2017 (r312280) @@ -41,7 +41,7 @@ here=`pwd` cd /tmp sed '1,/^EOF/d' < $here/$0 > readdir.c -mycc -o readdir -Wall -Wextra readdir.c +mycc -o readdir -Wall -Wextra readdir.c || exit 1 rm -f readdir.c mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint @@ -65,7 +65,8 @@ umount $mntpoint if ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1; then echo "Testing nfs" - mount -t nfs -o nfsv3,tcp,nolockd $nfs_export $mntpoint + mount -t nfs -o nfsv3,tcp,nolockd,retrycnt=3,soft,timeout=1 \ + $nfs_export $mntpoint /tmp/readdir $mntpoint umount $mntpoint fi @@ -99,6 +100,9 @@ rm -f /tmp/readdir exit 0 EOF #include +#include +#include + #include #include #include @@ -106,9 +110,10 @@ EOF #include #include #include -#include +#include #include -#include + +#define RUNTIME 120 /* copy from /usr/src/lib/libc/gen/gen-private.h */ struct _telldir; /* see telldir.h */ @@ -139,7 +144,7 @@ hand(int i __unused) { /* handler */ _exit(1); } -int +static void test(char *path) { @@ -147,7 +152,7 @@ test(char *path) int i; signal(SIGSEGV, hand); - + alarm(300); for (i = 0; i < 2000; i++) { if ((dirp = opendir(path)) == NULL) break; @@ -157,15 +162,16 @@ test(char *path) closedir(dirp); } - exit(0); + _exit(0); } int main(int argc __unused, char **argv) { - int i; + time_t start; - for (i = 0; i < 1000; i++) { + start = time(NULL); + while (time(NULL) - start < RUNTIME) { if (fork() == 0) test(argv[1]); wait(NULL);