cifs: fix wsize negotiation to respect max buffer size and active signing (try #4)
authorJeff Layton <jlayton@redhat.com>
Wed, 22 Jun 2011 21:33:57 +0000 (17:33 -0400)
committerSteve French <sfrench@us.ibm.com>
Thu, 23 Jun 2011 17:54:39 +0000 (17:54 +0000)
commit1190f6a067bf27b2ee7e06ec0776a17fe0f6c4d8
tree7a754b292e2cac6f5fe808d3e66c90c9689593e9
parent446b23a75804d7ffa4cca2d4d8f0afb822108c7e
cifs: fix wsize negotiation to respect max buffer size and active signing (try #4)

Hopefully last version. Base signing check on CAP_UNIX instead of
tcon->unix_ext, also clean up the comments a bit more.

According to Hongwei Sun's blog posting here:

    http://blogs.msdn.com/b/openspecification/archive/2009/04/10/smb-maximum-transmit-buffer-size-and-performance-tuning.aspx

CAP_LARGE_WRITEX is ignored when signing is active. Also, the maximum
size for a write without CAP_LARGE_WRITEX should be the maxBuf that
the server sent in the NEGOTIATE request.

Fix the wsize negotiation to take this into account. While we're at it,
alter the other wsize definitions to use sizeof(WRITE_REQ) to allow for
slightly larger amounts of data to potentially be written per request.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/connect.c