[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: readdir() broken?
From:       Bjoern Fischer <bfischer () Techfak ! Uni-Bielefeld ! DE>
Date:       1999-08-31 18:19:05
[Download RAW message or body]

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().
> 
> 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örn

-- 
-----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+ 
------END GEEK CODE BLOCK------


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic