From owner-freebsd-hackers Fri Oct 18 08:24:09 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA00409 for hackers-outgoing; Fri, 18 Oct 1996 08:24:09 -0700 (PDT) Received: from minnow.render.com (render.demon.co.uk [158.152.30.118]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id IAA00385 for ; Fri, 18 Oct 1996 08:24:02 -0700 (PDT) Received: from minnow.render.com (minnow.render.com [193.195.178.1]) by minnow.render.com (8.6.12/8.6.9) with SMTP id QAA22761; Fri, 18 Oct 1996 16:23:23 +0100 Date: Fri, 18 Oct 1996 16:23:21 +0100 (BST) From: Doug Rabson To: Karl Denninger cc: Michael Hancock , freebsd-hackers@FreeBSD.org Subject: Re: Recent hacking (was Re: FreeBSD 2.2.x release question) In-Reply-To: <199610171810.NAA00720@Jupiter.Mcs.Net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk On Thu, 17 Oct 1996, Karl Denninger wrote: > Current speculation is that this is a vnode cache handling problem of some > kind, where the vnode for the desired directory is being "flushed" but > never reloaded into the cache. We're still investigating and searching for > the root cause. > > Note that this appears to happen on directories with LARGE numbers of > subdirectory entries -- and not on ones with small numbers of directories. > I've never seen it occur, for example, on MY home directory -- but I'm on a > disk pack with maybe 20 directories at the same level that I'm on. > > The places where it happens frequently have perhaps 3,000 - 4,000 directories > at the same level, which is common on our big user disks. Can you try this patch and see if it fixes (or changes) your problem? Index: nfs_bio.c =================================================================== RCS file: /home/ncvs/src/sys/nfs/nfs_bio.c,v retrieving revision 1.27 diff -u -r1.27 nfs_bio.c --- nfs_bio.c 1996/10/12 17:39:39 1.27 +++ nfs_bio.c 1996/10/18 15:20:40 @@ -319,6 +319,7 @@ vfs_busy_pages(bp, 0); error = nfs_doio(bp, cred, p); if (error) { + vfs_unbusy_pages(bp); brelse(bp); while (error == NFSERR_BAD_COOKIE) { nfs_invaldir(vp); @@ -337,7 +338,10 @@ bp->b_flags |= B_READ; vfs_busy_pages(bp, 0); error = nfs_doio(bp, cred, p); - if (error) + if (error) { + vfs_unbusy_pages(bp); + brelse(bp); + } else if (i < lbn) brelse(bp); } } Index: nfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/nfs/nfs_vnops.c,v retrieving revision 1.35 diff -u -r1.35 nfs_vnops.c --- nfs_vnops.c 1996/09/19 18:21:01 1.35 +++ nfs_vnops.c 1996/10/18 15:20:42 @@ -2066,13 +2066,13 @@ #endif /* - * If there is no cookie, assume end of directory. + * If there is no cookie, assume directory was stale. */ cookiep = nfs_getcookie(dnp, uiop->uio_offset, 0); if (cookiep) cookie = *cookiep; else - return (0); + return (NFSERR_BAD_COOKIE); /* * Loop around doing readdir rpc's of size nm_readdirsize * truncated to a multiple of DIRBLKSIZ. @@ -2255,13 +2255,13 @@ newvp = NULLVP; /* - * If there is no cookie, assume end of directory. + * If there is no cookie, assume directory was stale. */ cookiep = nfs_getcookie(dnp, uiop->uio_offset, 0); if (cookiep) cookie = *cookiep; else - return (0); + return (NFSERR_BAD_COOKIE); /* * Loop around doing readdir rpc's of size nm_readdirsize * truncated to a multiple of DIRBLKSIZ. -- Doug Rabson, Microsoft RenderMorphics Ltd. Mail: dfr@render.com Phone: +44 171 734 3761 FAX: +44 171 734 6426