Directory cache and SMB2

Jeremy Allison jra at samba.org
Tue Apr 3 16:47:07 UTC 2018


On Tue, Apr 03, 2018 at 12:20:51PM -0400, J. Bruce Fields wrote:
> 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?

No it can't - for the simple reason that the Windows server
doesn't support this. As I said, "optional" is the wrong word :-).



More information about the samba-technical mailing list