readx and CAP_LARGE_READX

tridge at samba.org tridge at samba.org
Thu Dec 7 23:08:42 GMT 2006


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

Cheers, Tridge


More information about the samba-technical mailing list