Fw: [Samba] Missing files on Windows client side
Jeremy Allison
jra at samba.org
Tue Jun 28 16:52:33 GMT 2005
On Tue, Jun 28, 2005 at 05:38:26PM +0200, joop.martens at lekkerland.nl wrote:
> So the next time that get_lanman2_dir_entry is called there is not enough
> memory to put in the next entry.
> Every time this out of space error occurs we can see that the file is
> called with get_lanman2_dir_entry, but is not send to windows.
That is expected. Not the following code used to detect out of space:
if (PTR_DIFF(p,pdata) > space_remaining) {
/* Move the dirptr back to prev_dirpos */
dptr_SeekDir(conn->dirptr, prev_dirpos);
*out_of_space = True;
DEBUG(9,("get_lanman2_dir_entry: out of space\n"));
return False; /* Not finished - just out of space */
}
So, at the out of space error we seek the dirptr back to the
position just before we read the file entry from the directory.
See this code above at the start of the loop :
/* Needed if we run out of space */
long curr_dirpos = prev_dirpos = dptr_TellDir(conn->dirptr);
dname = dptr_ReadDirName(conn->dirptr,&curr_dirpos,&sbuf);
The logic goes as follows :
Save prev_dirpos (using TellDir)
ReadDirName to get next file.
If space available, add to output buffer.
If space not available, seek back to prev_dirpos (so
the net ReadDirName will return the same name again)
and then return.
The next call from the client, FindNext, goes into get_lanman2_dir_entry()
and reads the next name - which should be the same as the one rejected
previously for out of space as we seeked back to the point before
we read it.
I have tested this logic on Linux, and on a large directory I get
the "out of space" errors in the log too, but never lose any files
as the next client findnext() call returns the previous name rejected.
I still suspect either the telldir or seekdir calls on your version
of AIX of having a problem here.
Jeremy.
More information about the samba
mailing list