Skip to content

Commit

Permalink
[CIFS] Add support for legacy servers part six. Fix read syntax so
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Steve French committed Sep 16, 2005
1 parent eafe870 commit f9f5c81
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down

0 comments on commit f9f5c81

Please sign in to comment.