From owner-freebsd-current@FreeBSD.ORG Tue Aug 12 04:30:27 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3A3A37B401 for ; Tue, 12 Aug 2003 04:30:27 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 528DE43F85 for ; Tue, 12 Aug 2003 04:30:17 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfigt.dialup.mindspring.com ([165.247.202.29] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19mXLs-0006ys-00; Tue, 12 Aug 2003 04:30:09 -0700 Message-ID: <3F38CF69.182D4B2@mindspring.com> Date: Tue, 12 Aug 2003 04:28:41 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: David Malone References: <200308100406.47211.coolvibe@hackerheaven.org> <20030810181824.GA14355@walton.maths.tcd.ie> Content-Type: text/plain; charset=big5 Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a488087b4ac7109631d340a9fa1904323093caf27dac41a8fd350badd9bab72f9c350badd9bab72f9c cc: Lars Eggert cc: current@freebsd.org Subject: Re: "got bad cookie" warnings/errors? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2003 11:30:28 -0000 David Malone wrote: > On Sat, Aug 09, 2003 at 09:15:45PM -0700, Lars Eggert wrote: > > I can only say that (1) I've been getting these forever, on both -stable > > and -current, and (2) I personally have never lost any data. > > > > However, I have no clue as to why you and I get them, or what they signify. > > I have a vague feeling they are related to a directory changing while it > is being read, and might mean that the NFS client sees an inconsistent > version of the directory. It's been a long time since I looked at it > though. This happens when the directory changes on the server out from under a directory traversal in progress. The most canonically correct thing to do is deal with this as a single block restart; the NFS code, though, deals with it by rereading from the beginning of the directory, rather than the beginning of the block. To implement the other way, you'd need to (effectively) get rid of cookies entirely. For this to work, you'd need to split the VOP_READDIR into two parts: one to get a block, and one to take a block that you got, and externalize it. Then it could be FS independent, but on a block boundary for restarting the directory read back a block, instead of from the start of the file. In general, this basically means that on really large directories, locality of reference pretty much dictates that you might get into a loop where you end up stuck doing this restart indefinitely. Pretty ugly, actually... -- Terry