readx and CAP_LARGE_READX

simo idra at samba.org
Thu Dec 7 23:15:26 GMT 2006


On Fri, 2006-12-08 at 10:08 +1100, tridge at samba.org wrote:
> James,
> 
>  > Samba3, on the other hand, implements the readX semantics describes in  
>  > the SNIA spec.
> 
> yes, I can believe that :-)
> 
> The problem is, if you just follow that spec, and write a tool that
> relies on that behaviour, then you may end up finding that the tool
> doesn't work with any windows server. That's what has happened with
> cifsdd.
> 
> If Samba had a dominant position in the market this would be fine, but
> unfortunately we don't :(
> 
> There is another complication to this as well. If the client and
> server negotiate SMB signing, and the server is w2k3, and you write
> more than the negotiated buffer size (usually around 4k), then w2k3
> screws up the signing and gives you an error on writex, even though
> CAP_LARGE_WRITEX is negotiated.
> 
> So I think you are going to have to modify cifsdd to break up reads
> and writes so that they work with windows servers. That means:
> 
>  - if CAP_LARGE_READX is set, then readx no more than 64k
>  - if CAP_LARGE_READX is not set, then readx no more than negotiated
>    buffer size
>  - if signing is negotiated or if CAP_LARGE_WRITEX is not set, then
>    write no more than negotiated buffer size
>  - if signing is not negotiated and CAP_LARGE_WRITEX is set, then
>    write a maximum of 64k


May be you can add an optimization when the unix extensions are
negotiated and use full buffers only in that case.
That way you know you are talking to a samba3/4 server and that they may
be made to be cooperative :)

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
http://samba.org



More information about the samba-technical mailing list