svn commit: r282485 - head/lib/libc/gen

John Baldwin jhb at freebsd.org
Wed May 6 16:49:41 UTC 2015


On Tuesday, May 05, 2015 02:52:33 PM Julian Elischer wrote:
> Author: julian
> Date: Tue May  5 14:52:33 2015
> New Revision: 282485
> URL: https://svnweb.freebsd.org/changeset/base/282485
> 
> Log:
>   Tweak seekdir, telldir and readdir so that when htere are deletes going on,
>   as seek to teh last location saved will still work. This is needed for Samba
>   to be able to correctly handle delete requests from windows. This does not
>   completely fix seekdir when deletes are present but fixes the worst of the
>   problems. The real solution must involve some changes to the API for eh VFS
>   and getdirentries(2).

You really shouldn't be documenting Samba in this page.  Also, your claim is
wrong as it will still do the wrong thing if some _other_ process removes a
file entry out from under you.  I think it's fine to fix the implementation to
cater to samba.  I think it's very wrong to document it and encourage other
people to rely on non-POSIX behavior.  I would rather remove this entire block
from BUGS and use much simpler language in IMPLEMENTATION NOTES to note that it
is undefined if you will see or not see directory entries that are added or
removed while scanning a directory.  The language from here:

http://pubs.opengroup.org/onlinepubs/009695399/functions/readdir.html

Would work great, namely:

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.

-- 
John Baldwin


More information about the svn-src-head mailing list