From owner-freebsd-hackers Tue Aug 31 3:16:54 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id 2BC1C14E66 for ; Tue, 31 Aug 1999 03:16:49 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id LAA35132; Tue, 31 Aug 1999 11:15:49 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Tue, 31 Aug 1999 11:15:49 +0100 (BST) From: Doug Rabson To: Bjoern Fischer Cc: freebsd-hackers@freebsd.org, Matthew Dillon Subject: Re: readdir() broken? In-Reply-To: <19990829054029.B308@frolic.no-support.loc> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 29 Aug 1999, Bjoern Fischer wrote: > Hello Doug, hello Matthew, hello list members, > > there are some hints that readdir() in -STABLE has problems when > used on NFSv3 (UDP; and TCP probably, too) mounted file systems. > The reason may be the recovery code for stale READDIR cookies. > > The problem occurs when using GNU rm (fileutils-4.0) on our > systems (NFS servers and clients -STABLE) for deleting large > directory trees (e.g. egcs source tree). rm failed to delete > some directories: > > rm: cannot remove directory `egcs-1.1.2/gcc': Directory not empty > > I've roughly looked through the sources and found a workaround > for a readdir() bug on SunOS 4.1.4. The SunOS readdir() sometimes > returned NULL although there were still entries to be read when > a directory with more than 254 entries was previously modified. > The workaround rewound the directory stream and read it again. > > Interestingly this workaround also works for FreeBSD although > our readdir() passes the autoconfig tests that trigger the > workaround without a hinch. > > Attached is a patch for GNU fileutils-4.0 that will make rm > yield when the workaround code catches a bad readdir(). Are you using a FreeBSD port for GNU fileutils? If so, your patch should be directed to the port maintainer. I suggest that you also forward the patch to the GNU fileutils maintainers. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message