diff options
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifssmb.c | 7 | ||||
-rw-r--r-- | fs/cifs/connect.c | 8 | ||||
-rw-r--r-- | fs/cifs/file.c | 14 |
3 files changed, 16 insertions, 13 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 217323b0c896..b41e8b379652 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -1048,13 +1048,14 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon, | |||
1048 | cifs_small_buf_release(iov[0].iov_base); | 1048 | cifs_small_buf_release(iov[0].iov_base); |
1049 | else if(resp_buf_type == CIFS_LARGE_BUFFER) | 1049 | else if(resp_buf_type == CIFS_LARGE_BUFFER) |
1050 | cifs_buf_release(iov[0].iov_base); | 1050 | cifs_buf_release(iov[0].iov_base); |
1051 | } else /* return buffer to caller to free */ /* BB FIXME how do we tell caller if it is not a large buffer */ { | 1051 | } else if(resp_buf_type != CIFS_NO_BUFFER) { |
1052 | *buf = iov[0].iov_base; | 1052 | /* return buffer to caller to free */ |
1053 | *buf = iov[0].iov_base; | ||
1053 | if(resp_buf_type == CIFS_SMALL_BUFFER) | 1054 | if(resp_buf_type == CIFS_SMALL_BUFFER) |
1054 | *pbuf_type = CIFS_SMALL_BUFFER; | 1055 | *pbuf_type = CIFS_SMALL_BUFFER; |
1055 | else if(resp_buf_type == CIFS_LARGE_BUFFER) | 1056 | else if(resp_buf_type == CIFS_LARGE_BUFFER) |
1056 | *pbuf_type = CIFS_LARGE_BUFFER; | 1057 | *pbuf_type = CIFS_LARGE_BUFFER; |
1057 | } | 1058 | } /* else no valid buffer on return - leave as null */ |
1058 | 1059 | ||
1059 | /* Note: On -EAGAIN error only caller can retry on handle based calls | 1060 | /* Note: On -EAGAIN error only caller can retry on handle based calls |
1060 | since file handle passed in no longer valid */ | 1061 | since file handle passed in no longer valid */ |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index e488603fb1e7..ef5ae6f93c75 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1795,10 +1795,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1795 | conjunction with 52K kvec constraint on arch with 4K | 1795 | conjunction with 52K kvec constraint on arch with 4K |
1796 | page size */ | 1796 | page size */ |
1797 | 1797 | ||
1798 | if(cifs_sb->rsize < PAGE_CACHE_SIZE) { | 1798 | if(cifs_sb->rsize < 2048) { |
1799 | cifs_sb->rsize = PAGE_CACHE_SIZE; | 1799 | cifs_sb->rsize = 2048; |
1800 | /* Windows ME does this */ | 1800 | /* Windows ME may prefer this */ |
1801 | cFYI(1,("Attempt to set readsize for mount to less than one page (4096)")); | 1801 | cFYI(1,("readsize set to minimum 2048")); |
1802 | } | 1802 | } |
1803 | cifs_sb->mnt_uid = volume_info.linux_uid; | 1803 | cifs_sb->mnt_uid = volume_info.linux_uid; |
1804 | cifs_sb->mnt_gid = volume_info.linux_gid; | 1804 | cifs_sb->mnt_gid = volume_info.linux_gid; |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index d17c97d07c80..675bd2568297 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1442,13 +1442,15 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data, | |||
1442 | &bytes_read, &smb_read_data, | 1442 | &bytes_read, &smb_read_data, |
1443 | &buf_type); | 1443 | &buf_type); |
1444 | pSMBr = (struct smb_com_read_rsp *)smb_read_data; | 1444 | pSMBr = (struct smb_com_read_rsp *)smb_read_data; |
1445 | if (copy_to_user(current_offset, | ||
1446 | smb_read_data + 4 /* RFC1001 hdr */ | ||
1447 | + le16_to_cpu(pSMBr->DataOffset), | ||
1448 | bytes_read)) { | ||
1449 | rc = -EFAULT; | ||
1450 | } | ||
1451 | if (smb_read_data) { | 1445 | if (smb_read_data) { |
1446 | if (copy_to_user(current_offset, | ||
1447 | smb_read_data + | ||
1448 | 4 /* RFC1001 length field */ + | ||
1449 | le16_to_cpu(pSMBr->DataOffset), | ||
1450 | bytes_read)) { | ||
1451 | rc = -EFAULT; | ||
1452 | } | ||
1453 | |||
1452 | if(buf_type == CIFS_SMALL_BUFFER) | 1454 | if(buf_type == CIFS_SMALL_BUFFER) |
1453 | cifs_small_buf_release(smb_read_data); | 1455 | cifs_small_buf_release(smb_read_data); |
1454 | else if(buf_type == CIFS_LARGE_BUFFER) | 1456 | else if(buf_type == CIFS_LARGE_BUFFER) |