aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 77c990f0cb98..675bd2568297 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1190,7 +1190,6 @@ retry:
1190 /* BB what if continued retry is 1190 /* BB what if continued retry is
1191 requested via mount flags? */ 1191 requested via mount flags? */
1192 set_bit(AS_EIO, &mapping->flags); 1192 set_bit(AS_EIO, &mapping->flags);
1193 SetPageError(page);
1194 } else { 1193 } else {
1195 cifs_stats_bytes_written(cifs_sb->tcon, 1194 cifs_stats_bytes_written(cifs_sb->tcon,
1196 bytes_written); 1195 bytes_written);
@@ -1198,6 +1197,13 @@ retry:
1198 } 1197 }
1199 for (i = 0; i < n_iov; i++) { 1198 for (i = 0; i < n_iov; i++) {
1200 page = pvec.pages[first + i]; 1199 page = pvec.pages[first + i];
1200 /* Should we also set page error on
1201 success rc but too little data written? */
1202 /* BB investigate retry logic on temporary
1203 server crash cases and how recovery works
1204 when page marked as error */
1205 if(rc)
1206 SetPageError(page);
1201 kunmap(page); 1207 kunmap(page);
1202 unlock_page(page); 1208 unlock_page(page);
1203 page_cache_release(page); 1209 page_cache_release(page);
@@ -1436,13 +1442,15 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
1436 &bytes_read, &smb_read_data, 1442 &bytes_read, &smb_read_data,
1437 &buf_type); 1443 &buf_type);
1438 pSMBr = (struct smb_com_read_rsp *)smb_read_data; 1444 pSMBr = (struct smb_com_read_rsp *)smb_read_data;
1439 if (copy_to_user(current_offset,
1440 smb_read_data + 4 /* RFC1001 hdr */
1441 + le16_to_cpu(pSMBr->DataOffset),
1442 bytes_read)) {
1443 rc = -EFAULT;
1444 }
1445 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
1446 if(buf_type == CIFS_SMALL_BUFFER) 1454 if(buf_type == CIFS_SMALL_BUFFER)
1447 cifs_small_buf_release(smb_read_data); 1455 cifs_small_buf_release(smb_read_data);
1448 else if(buf_type == CIFS_LARGE_BUFFER) 1456 else if(buf_type == CIFS_LARGE_BUFFER)