Seeking to large offsets beyond the end of file and timeouts ...

Richard Sharpe rsharpe at richardsharpe.com
Tue Aug 9 23:40:13 GMT 2005


Hi,

I reported a week or so ago about issues with setting large file sizes and
the errors that can occur because Samba does not handle ECHO commands
while it is in the process of writing lots of zeros to a file.

The same problem exists for writing to large offsets.

That is, if you write a Windows App that opens a file, uses SetFilePointer
to set the file offset to something large that is beyond the end of the
file, like say 4GB or greater, and then write to the file, the redirector
converts that into a single byte write at that offset.

Now, we modified Samba to ensure that it uses a strict-allocate-style
truncate when this happens as well.

Of course, what can then happens is that because the smbd is busy writing
zeros up to that large offset it does not process the ECHO requests, and
the connection gets dropped and the application gets an error.

While it is less likely that applications will write to such large offsets
beyond the end of file than that users will copy large files to a server,
there is still the possibility.

Regards
-----
Richard Sharpe, rsharpe[at]richardsharpe.com, rsharpe[at]samba.org,
sharpe[at]ethereal.com, http://www.richardsharpe.com


More information about the samba-technical mailing list