[linux-cifs-client] Re: sendmsg blocking with sendtimeout vs. non-blocking

Jeff Layton jlayton at redhat.com
Fri Oct 24 01:48:48 GMT 2008


On Thu, 23 Oct 2008 21:30:32 -0400
Jim Rees <rees at umich.edu> wrote:

> Steve French wrote:
> 
>   If that is the case (ie that cifs and nfs never need to set these over
>   tcp - I am still having trouble reconciling that with the NFS guys'
>   comments that they must set rcvbuf (and Jim's comment below)
> 
> If you have an application that wants to read a big chunk of data from a
> socket, and won't remove any of that data from the socket until the entire
> chunk has arrived, then the application must set the receive socket buffer
> size big enough to hold the entire chunk.  Otherwise the application will
> stall.
> 
> As far as I can tell, the corresponding situation does not hold for send
> buffers, because the tcp layer will grow the send buffer to be big enough to
> hold whatever the application wants to send.  But I don't know if that's
> always true, or if there is some limit, so to be safe our NFS patch
> continues to set both the receive and send buffer sizes.

Right, that's not actually the case for CIFS, so I don't think we need
to have CIFS tune the receive buffer. cifs_demultiplex_thread just
slurps data off of the socket as it comes without concern about whether
we have a whole request or not. We may end up having to call
kernel_recvmsg a few extra times, but I don't think we need to worry
about it getting stuck.

-- 
Jeff Layton <jlayton at redhat.com>


More information about the linux-cifs-client mailing list