[PATCH] RFC: vfs cachedir
Jeremy Allison
jra at samba.org
Wed Apr 19 16:50:15 UTC 2017
On Wed, Apr 19, 2017 at 03:49:24PM +0200, Aurélien Aptel wrote:
> debug this anyway.
>
> As it turns out the reason why it fails is because smbd assumes that
> directory offsets given by telldir() can be reused and set again by
> seekdir().
Yes, that's POSIX.
> More specifically when doing FIND_FIRST/FIND_NEXT requests against a
> directory with a lot of files, several FIND_NEXT requests have to be
> sent to get the full listing, and each one provides an offset into the
> results. For SMB2+ code, samba "fakes" smb1 requests out of the smb2
> ones and the same code is used.
>
> On a NFS mount
> (and I suspect on other non-trivial fs),
No, you would be wrong there. Non-trivial file systems work
hard to get POSIX right. Just not NFS :-).
> the DIR handle
> can be updated after being opened. That means that setting the offset to
> the supposedly same value might end up skipping files.
That's broken w.r.t. POSIX. It's one of the reasons we don't
recommend NFS re-exports. If a a directory is being written
into whilst we have an open handle then yes, you might
miss files. If no one is writing into it then telldir/seekdir
should be reliable.
That's not to say that your VFS module isn't a good idea,
just that the reason for it is non-compliance with POSIX :-).
More information about the samba-technical
mailing list