[Samba] Missing Files/Missing Folders from an NFS Share

Jeremy Allison jra at samba.org
Mon Feb 27 19:15:13 UTC 2023

On Mon, Feb 27, 2023 at 08:10:01PM +0100, Conor Armstrong wrote:
>   Ok, fair enough, but the debug level 9 logs are showing negative offsets.
>   Can’t explain that other than the signed/unsigned issue.

Samba doesn't care if the offset is negative. It's simply stored as
a 'long', which is what POSIX requires from telldir().

So long as:

long x = telldir()

returns to the same position as before the readdir(), so
that the second readdir() returns the next entry in the
directory metadata, we should work.

As I said, the only numbers that will conflict with
Samba are:

      #define END_OF_DIRECTORY_OFFSET ((long)-1)
      #define START_OF_DIRECTORY_OFFSET ((long)0)
      #define DOT_DOT_DIRECTORY_OFFSET ((long)0x80000000)

which it's unlikely for the NFS server to be returning.

If when we do:

long x = telldir()

the second readdir() returns a *different* name than
the first readdir(), then the NFS server is broken.

That's what I'm trying to discover.

More information about the samba mailing list