]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cifs: when server doesn't set CAP_LARGE_READ_X, cap default rsize at MaxBufferSize
authorJeff Layton <jlayton@redhat.com>
Mon, 2 Jul 2012 11:24:25 +0000 (07:24 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2012 16:03:54 +0000 (09:03 -0700)
commitf4367f246e048e7fac50769d1d1447306a984f4e
tree9f75608b0be4ad61a6f54f510f8949c389ba7bab
parent9471356d7e58fbc3e1d307d911432261398abb56
cifs: when server doesn't set CAP_LARGE_READ_X, cap default rsize at MaxBufferSize

commit ec01d738a1691dfc85b96b9f796020267a7be577 upstream.

When the server doesn't advertise CAP_LARGE_READ_X, then MS-CIFS states
that you must cap the size of the read at the client's MaxBufferSize.
Unfortunately, testing with many older servers shows that they often
can't service a read larger than their own MaxBufferSize.

Since we can't assume what the server will do in this situation, we must
be conservative here for the default. When the server can't do large
reads, then assume that it can't satisfy any read larger than its
MaxBufferSize either.

Luckily almost all modern servers can do large reads, so this won't
affect them. This is really just for older win9x and OS/2 era servers.
Also, note that this patch just governs the default rsize. The admin can
always override this if he so chooses.

Reported-by: David H. Durgee <dhdurgee@acm.org>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steven French <sfrench@w500smf.none>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/connect.c