aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-09-15 23:06:38 -0700
committerSteve French <sfrench@us.ibm.com>2005-09-15 23:06:38 -0700
commitf9f5c81769f88bccd177423a30a7d30461754c39 (patch)
tree52ade60ddaacefc7cd350a67a7b40d6e2d27f84c /fs
parenteafe87012159a40a1e7151cc576e99a22aea2f0b (diff)
downloadlinux-f9f5c81769f88bccd177423a30a7d30461754c39.tar.gz
[CIFS] Add support for legacy servers part six. Fix read syntax so
we do not request more than negotiated buffer size even if buffer size is small (smaller than one page) Signed-off-by: Steve French (sfrench@us.ibm.com)
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 4173f23a71d96b..3766db2bb7f28b 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1278,6 +1278,13 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
total_read += bytes_read, current_offset += bytes_read) {
current_read_size = min_t(const int, read_size - total_read,
cifs_sb->rsize);
+ /* For windows me and 9x we do not want to request more
+ than it negotiated since it will refuse the read then */
+ if((pTcon->ses) &&
+ !(pTcon->ses->capabilities & CAP_LARGE_FILES)) {
+ current_read_size = min_t(const int, current_read_size,
+ pTcon->ses->server->maxBuf - 128);
+ }
rc = -EAGAIN;
while (rc == -EAGAIN) {
if ((open_file->invalidHandle) &&