diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 5857d12611e6..8ae962e7c93f 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -256,6 +256,13 @@ int cifs_open(struct inode *inode, struct file *file) | |||
256 | CREATE_NOT_DIR, &netfid, &oplock, buf, | 256 | CREATE_NOT_DIR, &netfid, &oplock, buf, |
257 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags | 257 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags |
258 | & CIFS_MOUNT_MAP_SPECIAL_CHR); | 258 | & CIFS_MOUNT_MAP_SPECIAL_CHR); |
259 | if (rc == -EIO) { | ||
260 | /* Old server, try legacy style OpenX */ | ||
261 | rc = SMBLegacyOpen(xid, pTcon, full_path, disposition, | ||
262 | desiredAccess, CREATE_NOT_DIR, &netfid, &oplock, buf, | ||
263 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags | ||
264 | & CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
265 | } | ||
259 | if (rc) { | 266 | if (rc) { |
260 | cFYI(1, ("cifs_open returned 0x%x ", rc)); | 267 | cFYI(1, ("cifs_open returned 0x%x ", rc)); |
261 | goto out; | 268 | goto out; |
@@ -1210,7 +1217,12 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data, | |||
1210 | open_file->netfid, | 1217 | open_file->netfid, |
1211 | current_read_size, *poffset, | 1218 | current_read_size, *poffset, |
1212 | &bytes_read, &smb_read_data); | 1219 | &bytes_read, &smb_read_data); |
1213 | 1220 | if(rc == -EINVAL) { | |
1221 | rc = SMBLegacyRead(xid, pTcon, | ||
1222 | open_file->netfid, | ||
1223 | current_read_size, *poffset, | ||
1224 | &bytes_read, &smb_read_data); | ||
1225 | } | ||
1214 | pSMBr = (struct smb_com_read_rsp *)smb_read_data; | 1226 | pSMBr = (struct smb_com_read_rsp *)smb_read_data; |
1215 | if (copy_to_user(current_offset, | 1227 | if (copy_to_user(current_offset, |
1216 | smb_read_data + 4 /* RFC1001 hdr */ | 1228 | smb_read_data + 4 /* RFC1001 hdr */ |
@@ -1287,6 +1299,12 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, | |||
1287 | open_file->netfid, | 1299 | open_file->netfid, |
1288 | current_read_size, *poffset, | 1300 | current_read_size, *poffset, |
1289 | &bytes_read, ¤t_offset); | 1301 | &bytes_read, ¤t_offset); |
1302 | if(rc == -EINVAL) { | ||
1303 | rc = SMBLegacyRead(xid, pTcon, | ||
1304 | open_file->netfid, | ||
1305 | current_read_size, *poffset, | ||
1306 | &bytes_read, ¤t_offset); | ||
1307 | } | ||
1290 | } | 1308 | } |
1291 | if (rc || (bytes_read == 0)) { | 1309 | if (rc || (bytes_read == 0)) { |
1292 | if (total_read) { | 1310 | if (total_read) { |
@@ -1443,7 +1461,14 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, | |||
1443 | open_file->netfid, | 1461 | open_file->netfid, |
1444 | read_size, offset, | 1462 | read_size, offset, |
1445 | &bytes_read, &smb_read_data); | 1463 | &bytes_read, &smb_read_data); |
1446 | /* BB need to check return code here */ | 1464 | if (rc == -EINVAL) { |
1465 | rc = SMBLegacyRead(xid, pTcon, | ||
1466 | open_file->netfid, | ||
1467 | read_size, offset, | ||
1468 | &bytes_read, &smb_read_data); | ||
1469 | } | ||
1470 | |||
1471 | /* BB more RC checks ? */ | ||
1447 | if (rc== -EAGAIN) { | 1472 | if (rc== -EAGAIN) { |
1448 | if (smb_read_data) { | 1473 | if (smb_read_data) { |
1449 | cifs_buf_release(smb_read_data); | 1474 | cifs_buf_release(smb_read_data); |