Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Aug 1999 20:19:05 +0200
From:      Bjoern Fischer <bfischer@Techfak.Uni-Bielefeld.DE>
To:        Doug Rabson <dfr@nlsystems.com>
Cc:        Bjoern Fischer <bfischer@TechFak.Uni-Bielefeld.DE>, freebsd-hackers@freebsd.org
Subject:   Re: readdir() broken?
Message-ID:  <19990831201905.C298@frolic.no-support.loc>
In-Reply-To: <Pine.BSF.4.10.9908311114100.340-100000@salmon.nlsystems.com>
References:  <19990829054029.B308@frolic.no-support.loc> <Pine.BSF.4.10.9908311114100.340-100000@salmon.nlsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990831201905.C298>