[Samba] sendfile questions...

Jeremy Allison jra at samba.org
Sun Jan 2 19:15:54 GMT 2005

On Sun, Jan 02, 2005 at 01:06:47PM -0500, William Jojo wrote:
> Why in smbd/reply.c does send_file_readX only use sendfile if write cache
> size is 0?

Because it would be difficult to serve the read partially
out of write cache, and partially from the disk. So rather
than work out that complicated logic I decided to only use
sendfile in the non write cache case.

> <snip>
> if (chain_size ==0 && (CVAL(inbuf,smb_vwv0) == 0xFF) && lp_use_sendfile(
> SNUM(conn)) &&
>                         (lp_write_cache_size(SNUM(conn)) == 0) ) {
> </snip>
> While its true send_file_readX works regardless of the state of oplocks
> (which is cool!) the smb.conf.5 man page still indicates the file must be
> exclusively oplocked.

It's a little out of date. We used to think this was the case
but experiment with Windows servers showed this is not needed.

> I was researching why an XP client was having 32K reads broken into 28K/4K
> pairs (which is mildly bizarre) and ran into this.

Get a network capture trace and see if the client is requesting
reads of these sizes - if so, then it's the client. In fact I can't
see any way this can be the server only as we only respond to client
read requests.


More information about the samba mailing list