diff options
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/CHANGES | 3 | ||||
-rw-r--r-- | fs/cifs/README | 4 | ||||
-rw-r--r-- | fs/cifs/cifsfs.h | 2 | ||||
-rw-r--r-- | fs/cifs/cifsproto.h | 2 | ||||
-rw-r--r-- | fs/cifs/cifssmb.c | 56 | ||||
-rw-r--r-- | fs/cifs/dir.c | 3 | ||||
-rw-r--r-- | fs/cifs/file.c | 2 | ||||
-rw-r--r-- | fs/cifs/inode.c | 48 | ||||
-rw-r--r-- | fs/cifs/misc.c | 1 |
9 files changed, 66 insertions, 55 deletions
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index 95483baab706..dab4774ee7bb 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
@@ -6,7 +6,8 @@ kills the cifsd thread (NB: killing the cifs kernel threads is not | |||
6 | recommended, unmount and rmmod cifs will kill them when they are | 6 | recommended, unmount and rmmod cifs will kill them when they are |
7 | no longer needed). Fix readdir to ASCII servers (ie older servers | 7 | no longer needed). Fix readdir to ASCII servers (ie older servers |
8 | which do not support Unicode) and also require asterik. | 8 | which do not support Unicode) and also require asterik. |
9 | 9 | Fix out of memory case in which data could be written one page | |
10 | off in the page cache. | ||
10 | 11 | ||
11 | Version 1.33 | 12 | Version 1.33 |
12 | ------------ | 13 | ------------ |
diff --git a/fs/cifs/README b/fs/cifs/README index e74df0c73256..34b0cf7111f3 100644 --- a/fs/cifs/README +++ b/fs/cifs/README | |||
@@ -371,7 +371,7 @@ A partial list of the supported mount options follows: | |||
371 | on newly created files, directories, and devices (create, | 371 | on newly created files, directories, and devices (create, |
372 | mkdir, mknod) which will result in the server setting the | 372 | mkdir, mknod) which will result in the server setting the |
373 | uid and gid to the default (usually the server uid of the | 373 | uid and gid to the default (usually the server uid of the |
374 | usern who mounted the share). Letting the server (rather than | 374 | user who mounted the share). Letting the server (rather than |
375 | the client) set the uid and gid is the default. This | 375 | the client) set the uid and gid is the default. This |
376 | parameter has no effect if the CIFS Unix Extensions are not | 376 | parameter has no effect if the CIFS Unix Extensions are not |
377 | negotiated. | 377 | negotiated. |
@@ -384,7 +384,7 @@ A partial list of the supported mount options follows: | |||
384 | client (e.g. when the application is doing large sequential | 384 | client (e.g. when the application is doing large sequential |
385 | reads bigger than page size without rereading the same data) | 385 | reads bigger than page size without rereading the same data) |
386 | this can provide better performance than the default | 386 | this can provide better performance than the default |
387 | behavior which caches reads (reaadahead) and writes | 387 | behavior which caches reads (readahead) and writes |
388 | (writebehind) through the local Linux client pagecache | 388 | (writebehind) through the local Linux client pagecache |
389 | if oplock (caching token) is granted and held. Note that | 389 | if oplock (caching token) is granted and held. Note that |
390 | direct allows write operations larger than page size | 390 | direct allows write operations larger than page size |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index d00b3bfe1a52..78af5850c558 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -96,5 +96,5 @@ extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t); | |||
96 | extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); | 96 | extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); |
97 | extern int cifs_ioctl (struct inode * inode, struct file * filep, | 97 | extern int cifs_ioctl (struct inode * inode, struct file * filep, |
98 | unsigned int command, unsigned long arg); | 98 | unsigned int command, unsigned long arg); |
99 | #define CIFS_VERSION "1.34" | 99 | #define CIFS_VERSION "1.35" |
100 | #endif /* _CIFSFS_H */ | 100 | #endif /* _CIFSFS_H */ |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 0010511083fc..ea239dea571e 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -228,7 +228,7 @@ extern int CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon, | |||
228 | const struct nls_table *nls_codepage, | 228 | const struct nls_table *nls_codepage, |
229 | int remap_special_chars); | 229 | int remap_special_chars); |
230 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | 230 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ |
231 | extern int cifs_convertUCSpath(char *target, const __u16 *source, int maxlen, | 231 | extern int cifs_convertUCSpath(char *target, const __le16 *source, int maxlen, |
232 | const struct nls_table * codepage); | 232 | const struct nls_table * codepage); |
233 | extern int cifsConvertToUCS(__le16 * target, const char *source, int maxlen, | 233 | extern int cifsConvertToUCS(__le16 * target, const char *source, int maxlen, |
234 | const struct nls_table * cp, int mapChars); | 234 | const struct nls_table * cp, int mapChars); |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 741ff0c69f37..3c628bf667a5 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -567,7 +567,7 @@ DelFileRetry: | |||
567 | 567 | ||
568 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 568 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
569 | name_len = | 569 | name_len = |
570 | cifsConvertToUCS((__u16 *) pSMB->fileName, fileName, | 570 | cifsConvertToUCS((__le16 *) pSMB->fileName, fileName, |
571 | PATH_MAX, nls_codepage, remap); | 571 | PATH_MAX, nls_codepage, remap); |
572 | name_len++; /* trailing null */ | 572 | name_len++; /* trailing null */ |
573 | name_len *= 2; | 573 | name_len *= 2; |
@@ -665,7 +665,7 @@ MkDirRetry: | |||
665 | return rc; | 665 | return rc; |
666 | 666 | ||
667 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 667 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
668 | name_len = cifsConvertToUCS((__u16 *) pSMB->DirName, name, | 668 | name_len = cifsConvertToUCS((__le16 *) pSMB->DirName, name, |
669 | PATH_MAX, nls_codepage, remap); | 669 | PATH_MAX, nls_codepage, remap); |
670 | name_len++; /* trailing null */ | 670 | name_len++; /* trailing null */ |
671 | name_len *= 2; | 671 | name_len *= 2; |
@@ -719,7 +719,7 @@ openRetry: | |||
719 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 719 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
720 | count = 1; /* account for one byte pad to word boundary */ | 720 | count = 1; /* account for one byte pad to word boundary */ |
721 | name_len = | 721 | name_len = |
722 | cifsConvertToUCS((__u16 *) (pSMB->fileName + 1), | 722 | cifsConvertToUCS((__le16 *) (pSMB->fileName + 1), |
723 | fileName, PATH_MAX, nls_codepage, remap); | 723 | fileName, PATH_MAX, nls_codepage, remap); |
724 | name_len++; /* trailing null */ | 724 | name_len++; /* trailing null */ |
725 | name_len *= 2; | 725 | name_len *= 2; |
@@ -1141,7 +1141,7 @@ renameRetry: | |||
1141 | 1141 | ||
1142 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 1142 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
1143 | name_len = | 1143 | name_len = |
1144 | cifsConvertToUCS((__u16 *) pSMB->OldFileName, fromName, | 1144 | cifsConvertToUCS((__le16 *) pSMB->OldFileName, fromName, |
1145 | PATH_MAX, nls_codepage, remap); | 1145 | PATH_MAX, nls_codepage, remap); |
1146 | name_len++; /* trailing null */ | 1146 | name_len++; /* trailing null */ |
1147 | name_len *= 2; | 1147 | name_len *= 2; |
@@ -1149,7 +1149,7 @@ renameRetry: | |||
1149 | /* protocol requires ASCII signature byte on Unicode string */ | 1149 | /* protocol requires ASCII signature byte on Unicode string */ |
1150 | pSMB->OldFileName[name_len + 1] = 0x00; | 1150 | pSMB->OldFileName[name_len + 1] = 0x00; |
1151 | name_len2 = | 1151 | name_len2 = |
1152 | cifsConvertToUCS((__u16 *) &pSMB->OldFileName[name_len + 2], | 1152 | cifsConvertToUCS((__le16 *) &pSMB->OldFileName[name_len + 2], |
1153 | toName, PATH_MAX, nls_codepage, remap); | 1153 | toName, PATH_MAX, nls_codepage, remap); |
1154 | name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; | 1154 | name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; |
1155 | name_len2 *= 2; /* convert to bytes */ | 1155 | name_len2 *= 2; /* convert to bytes */ |
@@ -1236,10 +1236,10 @@ int CIFSSMBRenameOpenFile(const int xid,struct cifsTconInfo *pTcon, | |||
1236 | /* unicode only call */ | 1236 | /* unicode only call */ |
1237 | if(target_name == NULL) { | 1237 | if(target_name == NULL) { |
1238 | sprintf(dummy_string,"cifs%x",pSMB->hdr.Mid); | 1238 | sprintf(dummy_string,"cifs%x",pSMB->hdr.Mid); |
1239 | len_of_str = cifsConvertToUCS((__u16 *)rename_info->target_name, | 1239 | len_of_str = cifsConvertToUCS((__le16 *)rename_info->target_name, |
1240 | dummy_string, 24, nls_codepage, remap); | 1240 | dummy_string, 24, nls_codepage, remap); |
1241 | } else { | 1241 | } else { |
1242 | len_of_str = cifsConvertToUCS((__u16 *)rename_info->target_name, | 1242 | len_of_str = cifsConvertToUCS((__le16 *)rename_info->target_name, |
1243 | target_name, PATH_MAX, nls_codepage, remap); | 1243 | target_name, PATH_MAX, nls_codepage, remap); |
1244 | } | 1244 | } |
1245 | rename_info->target_name_len = cpu_to_le32(2 * len_of_str); | 1245 | rename_info->target_name_len = cpu_to_le32(2 * len_of_str); |
@@ -1296,7 +1296,7 @@ copyRetry: | |||
1296 | pSMB->Flags = cpu_to_le16(flags & COPY_TREE); | 1296 | pSMB->Flags = cpu_to_le16(flags & COPY_TREE); |
1297 | 1297 | ||
1298 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 1298 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
1299 | name_len = cifsConvertToUCS((__u16 *) pSMB->OldFileName, | 1299 | name_len = cifsConvertToUCS((__le16 *) pSMB->OldFileName, |
1300 | fromName, PATH_MAX, nls_codepage, | 1300 | fromName, PATH_MAX, nls_codepage, |
1301 | remap); | 1301 | remap); |
1302 | name_len++; /* trailing null */ | 1302 | name_len++; /* trailing null */ |
@@ -1304,7 +1304,7 @@ copyRetry: | |||
1304 | pSMB->OldFileName[name_len] = 0x04; /* pad */ | 1304 | pSMB->OldFileName[name_len] = 0x04; /* pad */ |
1305 | /* protocol requires ASCII signature byte on Unicode string */ | 1305 | /* protocol requires ASCII signature byte on Unicode string */ |
1306 | pSMB->OldFileName[name_len + 1] = 0x00; | 1306 | pSMB->OldFileName[name_len + 1] = 0x00; |
1307 | name_len2 = cifsConvertToUCS((__u16 *)&pSMB->OldFileName[name_len + 2], | 1307 | name_len2 = cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2], |
1308 | toName, PATH_MAX, nls_codepage, remap); | 1308 | toName, PATH_MAX, nls_codepage, remap); |
1309 | name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; | 1309 | name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; |
1310 | name_len2 *= 2; /* convert to bytes */ | 1310 | name_len2 *= 2; /* convert to bytes */ |
@@ -1453,7 +1453,7 @@ createHardLinkRetry: | |||
1453 | return rc; | 1453 | return rc; |
1454 | 1454 | ||
1455 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 1455 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
1456 | name_len = cifsConvertToUCS((__u16 *) pSMB->FileName, toName, | 1456 | name_len = cifsConvertToUCS((__le16 *) pSMB->FileName, toName, |
1457 | PATH_MAX, nls_codepage, remap); | 1457 | PATH_MAX, nls_codepage, remap); |
1458 | name_len++; /* trailing null */ | 1458 | name_len++; /* trailing null */ |
1459 | name_len *= 2; | 1459 | name_len *= 2; |
@@ -1476,7 +1476,7 @@ createHardLinkRetry: | |||
1476 | data_offset = (char *) (&pSMB->hdr.Protocol) + offset; | 1476 | data_offset = (char *) (&pSMB->hdr.Protocol) + offset; |
1477 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 1477 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
1478 | name_len_target = | 1478 | name_len_target = |
1479 | cifsConvertToUCS((__u16 *) data_offset, fromName, PATH_MAX, | 1479 | cifsConvertToUCS((__le16 *) data_offset, fromName, PATH_MAX, |
1480 | nls_codepage, remap); | 1480 | nls_codepage, remap); |
1481 | name_len_target++; /* trailing null */ | 1481 | name_len_target++; /* trailing null */ |
1482 | name_len_target *= 2; | 1482 | name_len_target *= 2; |
@@ -1546,14 +1546,14 @@ winCreateHardLinkRetry: | |||
1546 | 1546 | ||
1547 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 1547 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
1548 | name_len = | 1548 | name_len = |
1549 | cifsConvertToUCS((__u16 *) pSMB->OldFileName, fromName, | 1549 | cifsConvertToUCS((__le16 *) pSMB->OldFileName, fromName, |
1550 | PATH_MAX, nls_codepage, remap); | 1550 | PATH_MAX, nls_codepage, remap); |
1551 | name_len++; /* trailing null */ | 1551 | name_len++; /* trailing null */ |
1552 | name_len *= 2; | 1552 | name_len *= 2; |
1553 | pSMB->OldFileName[name_len] = 0; /* pad */ | 1553 | pSMB->OldFileName[name_len] = 0; /* pad */ |
1554 | pSMB->OldFileName[name_len + 1] = 0x04; | 1554 | pSMB->OldFileName[name_len + 1] = 0x04; |
1555 | name_len2 = | 1555 | name_len2 = |
1556 | cifsConvertToUCS((__u16 *)&pSMB->OldFileName[name_len + 2], | 1556 | cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2], |
1557 | toName, PATH_MAX, nls_codepage, remap); | 1557 | toName, PATH_MAX, nls_codepage, remap); |
1558 | name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; | 1558 | name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; |
1559 | name_len2 *= 2; /* convert to bytes */ | 1559 | name_len2 *= 2; /* convert to bytes */ |
@@ -1939,7 +1939,7 @@ queryAclRetry: | |||
1939 | 1939 | ||
1940 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 1940 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
1941 | name_len = | 1941 | name_len = |
1942 | cifsConvertToUCS((__u16 *) pSMB->FileName, searchName, | 1942 | cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, |
1943 | PATH_MAX, nls_codepage, remap); | 1943 | PATH_MAX, nls_codepage, remap); |
1944 | name_len++; /* trailing null */ | 1944 | name_len++; /* trailing null */ |
1945 | name_len *= 2; | 1945 | name_len *= 2; |
@@ -2024,7 +2024,7 @@ setAclRetry: | |||
2024 | return rc; | 2024 | return rc; |
2025 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 2025 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
2026 | name_len = | 2026 | name_len = |
2027 | cifsConvertToUCS((__u16 *) pSMB->FileName, fileName, | 2027 | cifsConvertToUCS((__le16 *) pSMB->FileName, fileName, |
2028 | PATH_MAX, nls_codepage, remap); | 2028 | PATH_MAX, nls_codepage, remap); |
2029 | name_len++; /* trailing null */ | 2029 | name_len++; /* trailing null */ |
2030 | name_len *= 2; | 2030 | name_len *= 2; |
@@ -2188,7 +2188,7 @@ QPathInfoRetry: | |||
2188 | 2188 | ||
2189 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 2189 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
2190 | name_len = | 2190 | name_len = |
2191 | cifsConvertToUCS((__u16 *) pSMB->FileName, searchName, | 2191 | cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, |
2192 | PATH_MAX, nls_codepage, remap); | 2192 | PATH_MAX, nls_codepage, remap); |
2193 | name_len++; /* trailing null */ | 2193 | name_len++; /* trailing null */ |
2194 | name_len *= 2; | 2194 | name_len *= 2; |
@@ -2269,7 +2269,7 @@ UnixQPathInfoRetry: | |||
2269 | 2269 | ||
2270 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 2270 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
2271 | name_len = | 2271 | name_len = |
2272 | cifsConvertToUCS((__u16 *) pSMB->FileName, searchName, | 2272 | cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, |
2273 | PATH_MAX, nls_codepage, remap); | 2273 | PATH_MAX, nls_codepage, remap); |
2274 | name_len++; /* trailing null */ | 2274 | name_len++; /* trailing null */ |
2275 | name_len *= 2; | 2275 | name_len *= 2; |
@@ -2350,7 +2350,7 @@ findUniqueRetry: | |||
2350 | 2350 | ||
2351 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 2351 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
2352 | name_len = | 2352 | name_len = |
2353 | cifsConvertToUCS((wchar_t *) pSMB->FileName, searchName, PATH_MAX | 2353 | cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, PATH_MAX |
2354 | /* find define for this maxpathcomponent */ | 2354 | /* find define for this maxpathcomponent */ |
2355 | , nls_codepage); | 2355 | , nls_codepage); |
2356 | name_len++; /* trailing null */ | 2356 | name_len++; /* trailing null */ |
@@ -2435,7 +2435,7 @@ findFirstRetry: | |||
2435 | 2435 | ||
2436 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 2436 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
2437 | name_len = | 2437 | name_len = |
2438 | cifsConvertToUCS((__u16 *) pSMB->FileName,searchName, | 2438 | cifsConvertToUCS((__le16 *) pSMB->FileName,searchName, |
2439 | PATH_MAX, nls_codepage, remap); | 2439 | PATH_MAX, nls_codepage, remap); |
2440 | /* We can not add the asterik earlier in case | 2440 | /* We can not add the asterik earlier in case |
2441 | it got remapped to 0xF03A as if it were part of the | 2441 | it got remapped to 0xF03A as if it were part of the |
@@ -2726,7 +2726,7 @@ GetInodeNumberRetry: | |||
2726 | 2726 | ||
2727 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 2727 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
2728 | name_len = | 2728 | name_len = |
2729 | cifsConvertToUCS((__u16 *) pSMB->FileName, searchName, | 2729 | cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, |
2730 | PATH_MAX,nls_codepage, remap); | 2730 | PATH_MAX,nls_codepage, remap); |
2731 | name_len++; /* trailing null */ | 2731 | name_len++; /* trailing null */ |
2732 | name_len *= 2; | 2732 | name_len *= 2; |
@@ -2837,7 +2837,7 @@ getDFSRetry: | |||
2837 | if (ses->capabilities & CAP_UNICODE) { | 2837 | if (ses->capabilities & CAP_UNICODE) { |
2838 | pSMB->hdr.Flags2 |= SMBFLG2_UNICODE; | 2838 | pSMB->hdr.Flags2 |= SMBFLG2_UNICODE; |
2839 | name_len = | 2839 | name_len = |
2840 | cifsConvertToUCS((__u16 *) pSMB->RequestFileName, | 2840 | cifsConvertToUCS((__le16 *) pSMB->RequestFileName, |
2841 | searchName, PATH_MAX, nls_codepage, remap); | 2841 | searchName, PATH_MAX, nls_codepage, remap); |
2842 | name_len++; /* trailing null */ | 2842 | name_len++; /* trailing null */ |
2843 | name_len *= 2; | 2843 | name_len *= 2; |
@@ -3369,7 +3369,7 @@ SetEOFRetry: | |||
3369 | 3369 | ||
3370 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 3370 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
3371 | name_len = | 3371 | name_len = |
3372 | cifsConvertToUCS((__u16 *) pSMB->FileName, fileName, | 3372 | cifsConvertToUCS((__le16 *) pSMB->FileName, fileName, |
3373 | PATH_MAX, nls_codepage, remap); | 3373 | PATH_MAX, nls_codepage, remap); |
3374 | name_len++; /* trailing null */ | 3374 | name_len++; /* trailing null */ |
3375 | name_len *= 2; | 3375 | name_len *= 2; |
@@ -3627,7 +3627,7 @@ SetTimesRetry: | |||
3627 | 3627 | ||
3628 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 3628 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
3629 | name_len = | 3629 | name_len = |
3630 | cifsConvertToUCS((__u16 *) pSMB->FileName, fileName, | 3630 | cifsConvertToUCS((__le16 *) pSMB->FileName, fileName, |
3631 | PATH_MAX, nls_codepage, remap); | 3631 | PATH_MAX, nls_codepage, remap); |
3632 | name_len++; /* trailing null */ | 3632 | name_len++; /* trailing null */ |
3633 | name_len *= 2; | 3633 | name_len *= 2; |
@@ -3708,7 +3708,7 @@ SetAttrLgcyRetry: | |||
3708 | 3708 | ||
3709 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 3709 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
3710 | name_len = | 3710 | name_len = |
3711 | ConvertToUCS((wchar_t *) pSMB->fileName, fileName, | 3711 | ConvertToUCS((__le16 *) pSMB->fileName, fileName, |
3712 | PATH_MAX, nls_codepage); | 3712 | PATH_MAX, nls_codepage); |
3713 | name_len++; /* trailing null */ | 3713 | name_len++; /* trailing null */ |
3714 | name_len *= 2; | 3714 | name_len *= 2; |
@@ -3759,7 +3759,7 @@ setPermsRetry: | |||
3759 | 3759 | ||
3760 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 3760 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
3761 | name_len = | 3761 | name_len = |
3762 | cifsConvertToUCS((__u16 *) pSMB->FileName, fileName, | 3762 | cifsConvertToUCS((__le16 *) pSMB->FileName, fileName, |
3763 | PATH_MAX, nls_codepage, remap); | 3763 | PATH_MAX, nls_codepage, remap); |
3764 | name_len++; /* trailing null */ | 3764 | name_len++; /* trailing null */ |
3765 | name_len *= 2; | 3765 | name_len *= 2; |
@@ -3904,7 +3904,7 @@ QAllEAsRetry: | |||
3904 | 3904 | ||
3905 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 3905 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
3906 | name_len = | 3906 | name_len = |
3907 | cifsConvertToUCS((wchar_t *) pSMB->FileName, searchName, | 3907 | cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, |
3908 | PATH_MAX, nls_codepage, remap); | 3908 | PATH_MAX, nls_codepage, remap); |
3909 | name_len++; /* trailing null */ | 3909 | name_len++; /* trailing null */ |
3910 | name_len *= 2; | 3910 | name_len *= 2; |
@@ -4047,7 +4047,7 @@ QEARetry: | |||
4047 | 4047 | ||
4048 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 4048 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
4049 | name_len = | 4049 | name_len = |
4050 | cifsConvertToUCS((__u16 *) pSMB->FileName, searchName, | 4050 | cifsConvertToUCS((__le16 *) pSMB->FileName, searchName, |
4051 | PATH_MAX, nls_codepage, remap); | 4051 | PATH_MAX, nls_codepage, remap); |
4052 | name_len++; /* trailing null */ | 4052 | name_len++; /* trailing null */ |
4053 | name_len *= 2; | 4053 | name_len *= 2; |
@@ -4194,7 +4194,7 @@ SetEARetry: | |||
4194 | 4194 | ||
4195 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 4195 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
4196 | name_len = | 4196 | name_len = |
4197 | cifsConvertToUCS((__u16 *) pSMB->FileName, fileName, | 4197 | cifsConvertToUCS((__le16 *) pSMB->FileName, fileName, |
4198 | PATH_MAX, nls_codepage, remap); | 4198 | PATH_MAX, nls_codepage, remap); |
4199 | name_len++; /* trailing null */ | 4199 | name_len++; /* trailing null */ |
4200 | name_len *= 2; | 4200 | name_len *= 2; |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index e3137aa48cdd..3f3538d4a1fa 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -392,7 +392,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name | |||
392 | rc = 0; | 392 | rc = 0; |
393 | d_add(direntry, NULL); | 393 | d_add(direntry, NULL); |
394 | } else { | 394 | } else { |
395 | cERROR(1,("Error 0x%x or on cifs_get_inode_info in lookup",rc)); | 395 | cERROR(1,("Error 0x%x on cifs_get_inode_info in lookup of %s", |
396 | rc,full_path)); | ||
396 | /* BB special case check for Access Denied - watch security | 397 | /* BB special case check for Access Denied - watch security |
397 | exposure of returning dir info implicitly via different rc | 398 | exposure of returning dir info implicitly via different rc |
398 | if file exists or not but no access BB */ | 399 | if file exists or not but no access BB */ |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index dde2d251fc3d..30ab70ce5547 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1352,6 +1352,8 @@ static void cifs_copy_cache_pages(struct address_space *mapping, | |||
1352 | GFP_KERNEL)) { | 1352 | GFP_KERNEL)) { |
1353 | page_cache_release(page); | 1353 | page_cache_release(page); |
1354 | cFYI(1, ("Add page cache failed")); | 1354 | cFYI(1, ("Add page cache failed")); |
1355 | data += PAGE_CACHE_SIZE; | ||
1356 | bytes_read -= PAGE_CACHE_SIZE; | ||
1355 | continue; | 1357 | continue; |
1356 | } | 1358 | } |
1357 | 1359 | ||
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 670947288262..8d336a900255 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -82,12 +82,12 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
82 | /* get new inode */ | 82 | /* get new inode */ |
83 | if (*pinode == NULL) { | 83 | if (*pinode == NULL) { |
84 | *pinode = new_inode(sb); | 84 | *pinode = new_inode(sb); |
85 | if(*pinode == NULL) | 85 | if (*pinode == NULL) |
86 | return -ENOMEM; | 86 | return -ENOMEM; |
87 | /* Is an i_ino of zero legal? */ | 87 | /* Is an i_ino of zero legal? */ |
88 | /* Are there sanity checks we can use to ensure that | 88 | /* Are there sanity checks we can use to ensure that |
89 | the server is really filling in that field? */ | 89 | the server is really filling in that field? */ |
90 | if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { | 90 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { |
91 | (*pinode)->i_ino = | 91 | (*pinode)->i_ino = |
92 | (unsigned long)findData.UniqueId; | 92 | (unsigned long)findData.UniqueId; |
93 | } /* note ino incremented to unique num in new_inode */ | 93 | } /* note ino incremented to unique num in new_inode */ |
@@ -134,7 +134,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
134 | inode->i_gid = le64_to_cpu(findData.Gid); | 134 | inode->i_gid = le64_to_cpu(findData.Gid); |
135 | inode->i_nlink = le64_to_cpu(findData.Nlinks); | 135 | inode->i_nlink = le64_to_cpu(findData.Nlinks); |
136 | 136 | ||
137 | if(is_size_safe_to_change(cifsInfo)) { | 137 | if (is_size_safe_to_change(cifsInfo)) { |
138 | /* can not safely change the file size here if the | 138 | /* can not safely change the file size here if the |
139 | client is writing to it due to potential races */ | 139 | client is writing to it due to potential races */ |
140 | 140 | ||
@@ -162,7 +162,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
162 | if (S_ISREG(inode->i_mode)) { | 162 | if (S_ISREG(inode->i_mode)) { |
163 | cFYI(1, (" File inode ")); | 163 | cFYI(1, (" File inode ")); |
164 | inode->i_op = &cifs_file_inode_ops; | 164 | inode->i_op = &cifs_file_inode_ops; |
165 | if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) | 165 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) |
166 | inode->i_fop = &cifs_file_direct_ops; | 166 | inode->i_fop = &cifs_file_direct_ops; |
167 | else | 167 | else |
168 | inode->i_fop = &cifs_file_ops; | 168 | inode->i_fop = &cifs_file_ops; |
@@ -198,17 +198,17 @@ int cifs_get_inode_info(struct inode **pinode, | |||
198 | pTcon = cifs_sb->tcon; | 198 | pTcon = cifs_sb->tcon; |
199 | cFYI(1,("Getting info on %s ", search_path)); | 199 | cFYI(1,("Getting info on %s ", search_path)); |
200 | 200 | ||
201 | if((pfindData == NULL) && (*pinode != NULL)) { | 201 | if ((pfindData == NULL) && (*pinode != NULL)) { |
202 | if(CIFS_I(*pinode)->clientCanCacheRead) { | 202 | if (CIFS_I(*pinode)->clientCanCacheRead) { |
203 | cFYI(1,("No need to revalidate cached inode sizes")); | 203 | cFYI(1,("No need to revalidate cached inode sizes")); |
204 | return rc; | 204 | return rc; |
205 | } | 205 | } |
206 | } | 206 | } |
207 | 207 | ||
208 | /* if file info not passed in then get it from server */ | 208 | /* if file info not passed in then get it from server */ |
209 | if(pfindData == NULL) { | 209 | if (pfindData == NULL) { |
210 | buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); | 210 | buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); |
211 | if(buf == NULL) | 211 | if (buf == NULL) |
212 | return -ENOMEM; | 212 | return -ENOMEM; |
213 | pfindData = (FILE_ALL_INFO *)buf; | 213 | pfindData = (FILE_ALL_INFO *)buf; |
214 | /* could do find first instead but this returns more info */ | 214 | /* could do find first instead but this returns more info */ |
@@ -268,7 +268,7 @@ int cifs_get_inode_info(struct inode **pinode, | |||
268 | IndexNumber field is not guaranteed unique? */ | 268 | IndexNumber field is not guaranteed unique? */ |
269 | 269 | ||
270 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 270 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
271 | if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM){ | 271 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM){ |
272 | int rc1 = 0; | 272 | int rc1 = 0; |
273 | __u64 inode_num; | 273 | __u64 inode_num; |
274 | 274 | ||
@@ -277,7 +277,7 @@ int cifs_get_inode_info(struct inode **pinode, | |||
277 | cifs_sb->local_nls, | 277 | cifs_sb->local_nls, |
278 | cifs_sb->mnt_cifs_flags & | 278 | cifs_sb->mnt_cifs_flags & |
279 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 279 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
280 | if(rc1) { | 280 | if (rc1) { |
281 | cFYI(1,("GetSrvInodeNum rc %d", rc1)); | 281 | cFYI(1,("GetSrvInodeNum rc %d", rc1)); |
282 | /* BB EOPNOSUPP disable SERVER_INUM? */ | 282 | /* BB EOPNOSUPP disable SERVER_INUM? */ |
283 | } else /* do we need cast or hash to ino? */ | 283 | } else /* do we need cast or hash to ino? */ |
@@ -355,7 +355,7 @@ int cifs_get_inode_info(struct inode **pinode, | |||
355 | if (S_ISREG(inode->i_mode)) { | 355 | if (S_ISREG(inode->i_mode)) { |
356 | cFYI(1, (" File inode ")); | 356 | cFYI(1, (" File inode ")); |
357 | inode->i_op = &cifs_file_inode_ops; | 357 | inode->i_op = &cifs_file_inode_ops; |
358 | if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) | 358 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) |
359 | inode->i_fop = &cifs_file_direct_ops; | 359 | inode->i_fop = &cifs_file_direct_ops; |
360 | else | 360 | else |
361 | inode->i_fop = &cifs_file_ops; | 361 | inode->i_fop = &cifs_file_ops; |
@@ -422,7 +422,8 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) | |||
422 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 422 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
423 | 423 | ||
424 | if (!rc) { | 424 | if (!rc) { |
425 | direntry->d_inode->i_nlink--; | 425 | if (direntry->d_inode) |
426 | direntry->d_inode->i_nlink--; | ||
426 | } else if (rc == -ENOENT) { | 427 | } else if (rc == -ENOENT) { |
427 | d_drop(direntry); | 428 | d_drop(direntry); |
428 | } else if (rc == -ETXTBSY) { | 429 | } else if (rc == -ETXTBSY) { |
@@ -440,7 +441,8 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) | |||
440 | cifs_sb->mnt_cifs_flags & | 441 | cifs_sb->mnt_cifs_flags & |
441 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 442 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
442 | CIFSSMBClose(xid, pTcon, netfid); | 443 | CIFSSMBClose(xid, pTcon, netfid); |
443 | direntry->d_inode->i_nlink--; | 444 | if (direntry->d_inode) |
445 | direntry->d_inode->i_nlink--; | ||
444 | } | 446 | } |
445 | } else if (rc == -EACCES) { | 447 | } else if (rc == -EACCES) { |
446 | /* try only if r/o attribute set in local lookup data? */ | 448 | /* try only if r/o attribute set in local lookup data? */ |
@@ -494,7 +496,8 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) | |||
494 | cifs_sb->mnt_cifs_flags & | 496 | cifs_sb->mnt_cifs_flags & |
495 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 497 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
496 | if (!rc) { | 498 | if (!rc) { |
497 | direntry->d_inode->i_nlink--; | 499 | if (direntry->d_inode) |
500 | direntry->d_inode->i_nlink--; | ||
498 | } else if (rc == -ETXTBSY) { | 501 | } else if (rc == -ETXTBSY) { |
499 | int oplock = FALSE; | 502 | int oplock = FALSE; |
500 | __u16 netfid; | 503 | __u16 netfid; |
@@ -514,17 +517,20 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) | |||
514 | cifs_sb->mnt_cifs_flags & | 517 | cifs_sb->mnt_cifs_flags & |
515 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 518 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
516 | CIFSSMBClose(xid, pTcon, netfid); | 519 | CIFSSMBClose(xid, pTcon, netfid); |
517 | direntry->d_inode->i_nlink--; | 520 | if (direntry->d_inode) |
521 | direntry->d_inode->i_nlink--; | ||
518 | } | 522 | } |
519 | /* BB if rc = -ETXTBUSY goto the rename logic BB */ | 523 | /* BB if rc = -ETXTBUSY goto the rename logic BB */ |
520 | } | 524 | } |
521 | } | 525 | } |
522 | } | 526 | } |
523 | cifsInode = CIFS_I(direntry->d_inode); | 527 | if (direntry->d_inode) { |
524 | cifsInode->time = 0; /* will force revalidate to get info when | 528 | cifsInode = CIFS_I(direntry->d_inode); |
525 | needed */ | 529 | cifsInode->time = 0; /* will force revalidate to get info |
526 | direntry->d_inode->i_ctime = inode->i_ctime = inode->i_mtime = | 530 | when needed */ |
527 | current_fs_time(inode->i_sb); | 531 | direntry->d_inode->i_ctime = current_fs_time(inode->i_sb); |
532 | } | ||
533 | inode->i_ctime = inode->i_mtime = current_fs_time(inode->i_sb); | ||
528 | cifsInode = CIFS_I(inode); | 534 | cifsInode = CIFS_I(inode); |
529 | cifsInode->time = 0; /* force revalidate of dir as well */ | 535 | cifsInode->time = 0; /* force revalidate of dir as well */ |
530 | 536 | ||
@@ -576,7 +582,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
576 | if (direntry->d_inode) | 582 | if (direntry->d_inode) |
577 | direntry->d_inode->i_nlink = 2; | 583 | direntry->d_inode->i_nlink = 2; |
578 | if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) | 584 | if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) |
579 | if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { | 585 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { |
580 | CIFSSMBUnixSetPerms(xid, pTcon, full_path, | 586 | CIFSSMBUnixSetPerms(xid, pTcon, full_path, |
581 | mode, | 587 | mode, |
582 | (__u64)current->euid, | 588 | (__u64)current->euid, |
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index db14b503d89e..072b4ee8c53e 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -571,6 +571,7 @@ cifs_convertUCSpath(char *target, const __le16 * source, int maxlen, | |||
571 | break; | 571 | break; |
572 | case UNI_LESSTHAN: | 572 | case UNI_LESSTHAN: |
573 | target[j] = '<'; | 573 | target[j] = '<'; |
574 | break; | ||
574 | default: | 575 | default: |
575 | len = cp->uni2char(src_char, &target[j], | 576 | len = cp->uni2char(src_char, &target[j], |
576 | NLS_MAX_CHARSET_SIZE); | 577 | NLS_MAX_CHARSET_SIZE); |