From owner-freebsd-hackers Tue Aug 31 11:20:33 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.uni-bielefeld.de (mail.uni-bielefeld.de [129.70.4.90]) by hub.freebsd.org (Postfix) with ESMTP id D6CAE15964 for ; Tue, 31 Aug 1999 11:20:13 -0700 (PDT) (envelope-from bfischer@Techfak.uni-bielefeld.de) Received: from frolic.no-support.loc (ppp36-135.hrz.uni-bielefeld.de) by mail.uni-bielefeld.de (Sun Internet Mail Server sims.3.5.1999.03.02.17.58.p5) with ESMTP id <0FHC00048DJP74@mail.uni-bielefeld.de> for freebsd-hackers@freebsd.org; Tue, 31 Aug 1999 20:19:04 +0200 (MET DST) Received: (from bjoern@localhost) by frolic.no-support.loc (8.9.3/8.9.3) id UAA13563; Tue, 31 Aug 1999 20:19:05 +0200 (CEST envelope-from bjoern) Date: Tue, 31 Aug 1999 20:19:05 +0200 From: Bjoern Fischer Subject: Re: readdir() broken? In-reply-to: To: Doug Rabson Cc: Bjoern Fischer , freebsd-hackers@freebsd.org Message-id: <19990831201905.C298@frolic.no-support.loc> MIME-version: 1.0 X-Mailer: Mutt 0.95.7i Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable References: <19990829054029.B308@frolic.no-support.loc> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Aug 31, 1999 at 11:15:49AM +0100, Doug Rabson wrote: [...] > > Attached is a patch for GNU fileutils-4.0 that will make rm > > yield when the workaround code catches a bad readdir(). >=20 > 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. I'm not aware of a FreeBSD port, but I will send a patch to the GNU fileutils maintainer. I just would like to fix our readdir() rather than struggling with the symptoms. Unfortunately I have no idea how to deal with this target. The first thing I did was finding out where to look for the bug---in GNU rm or in FreeBSD readdir(). The Single Unix Specification Version 2 says: [...] files may be removed from a directory or added to a directory asynchronously to the operation of readdir(). [...] and [...] If a file is removed from or added to the directory after the most recent call to opendir() or rewinddir(), whether a subsequent call to readdir() returns an entry for that file is unspecified. [...] But what happens here is the stream position pointer get mixed up and it seems that it skips one or two directory entries on susequent calls to readdir(). So I think it should be concidered as broken. I started looking at nfs_vnops.c but at the time I have no idea how it works. Bj=F6rn --=20 -----BEGIN GEEK CODE BLOCK----- GCS d--(+) s++: a- C+++(-) UB++++OSI++++$ P+++(-) L+++(--) !E W- N+ o>+ K- !w !O !M !V PS++ PE- PGP++ t+++ !5 X++ tv- b+++ D++ G e+ h-- y+=20 ------END GEEK CODE BLOCK------ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message