Directory cache and SMB2

J. Bruce Fields bfields at
Tue Apr 3 16:20:51 UTC 2018

On Fri, Mar 30, 2018 at 09:16:33AM -0700, Jeremy Allison via samba-technical wrote:
> Yes, but as Windows servers don't support it, that means
> Windows clients don't use it, which means "optional" is
> the wrong word. "Unusable" is the right word :-).
> On a meta-note, a 32-bit directory cookie is useless
> these days on modern filesystems. You end up having
> to keep a mapping between the real (64bit+) directory
> cookie and the returned 32-bit value (I had to do
> this for the old DOS SMB1 protocol level, which heavily
> used this). When you have 1,000,000 file directories
> that gets pretty wasteful.
> The whole concept of a seekable directory cookie is
> A BAD IDEA anyway (yes I know POSIX demands it) because
> of race conditions - no applications can depend on
> it being valid to enumerate everything in a dirctory
> or even to not see entries twice or not at all.

POSIX allows that only for directory entries that are added, deleted, or
renamed, right?

Anyway, I think this is only useful for NFS reexport, which is a bad
idea for lots of other reasons.  The in-kernel CIFS code does (to its
shame) attempt to support re-export, I wonder if it tries to use this
bit of the protocol?


> Most filesystems internally are btrees or something more complex.

More information about the samba-technical mailing list