From owner-svn-src-projects@FreeBSD.ORG Fri Sep 11 19:23:12 2009 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 50702106566B; Fri, 11 Sep 2009 19:23:12 +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 2703D8FC0A; Fri, 11 Sep 2009 19:23:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8BJNBNK061288; Fri, 11 Sep 2009 19:23:11 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8BJNBGf061286; Fri, 11 Sep 2009 19:23:11 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <200909111923.n8BJNBGf061286@svn.freebsd.org> From: Peter Holm Date: Fri, 11 Sep 2009 19:23:11 +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: r197100 - 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: Fri, 11 Sep 2009 19:23:12 -0000 Author: pho Date: Fri Sep 11 19:23:11 2009 New Revision: 197100 URL: http://svn.freebsd.org/changeset/base/197100 Log: Cleaned up the test scenario, added comments and retested in order to verify that the apparent name cache problem still exists. Modified: projects/stress2/misc/namecache.sh Modified: projects/stress2/misc/namecache.sh ============================================================================== --- projects/stress2/misc/namecache.sh Fri Sep 11 18:48:49 2009 (r197099) +++ projects/stress2/misc/namecache.sh Fri Sep 11 19:23:11 2009 (r197100) @@ -57,6 +57,10 @@ # Consistency is restored by a umount + mount of the FS +# Observations: +# No problems seen with vfs.lookup_shared=0. +# Does not fail in a "private" subdirectory + . ../default.cfg odir=`pwd` @@ -65,7 +69,11 @@ sed '1,/^EOF/d' < $odir/$0 > namecache.c cc -o namecache -Wall namecache.c rm -f namecache.c -rm -f file.0* +#dir=/tmp/namecache.dir # No problems seen +dir=/tmp +[ -d $dir ] || mkdir -p $dir +cd $dir + for i in `jot 30`; do for j in `jot 10`; do /tmp/namecache & @@ -76,12 +84,12 @@ for i in `jot 30`; do done done -if ls -l /tmp/file.* 2>/dev/null | grep -q file.0; then - echo "ls -l /tmp/file.0*" - ls -l /tmp/file.0* +if ls -l ${dir}/file.0* 2>&1 | egrep "file.0[0-9]" | grep -q "No such file"; then + echo "ls -l ${dir}/file.0*" + ls -l ${dir}/file.0* fi -rm -f /tmp/namecache # /tmp/file.0* +rm -f /tmp/namecache # /${dir}/file.0* exit EOF /* Test scenario for possible name cache problem */ @@ -103,7 +111,7 @@ __FBSDID("$FreeBSD$"); #include static char path[MAXPATHLEN+1]; -static char buf[8096]; +static char buf[64 * 1024]; void pm(void) @@ -115,12 +123,6 @@ pm(void) struct dirent *dp; char *bp = buf; - if (stat(".", &statb) != 0) - err(1, "stat(%s)", "."); - - if (!S_ISDIR(statb.st_mode)) - return; - if ((fd = open(".", O_RDONLY)) == -1) err(1, "open(%s)", "."); @@ -130,6 +132,7 @@ pm(void) space = space - n; bp = bp + n; } while (n != 0); + close(fd); bp = buf; dp = (struct dirent *)bp;