Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: cifs: fix cifsConvertToUCS() for the mapchars case cifs: add fallback in is_path_accessible for old servers
This commit is contained in:
commit
8864f5ee12
2 changed files with 11 additions and 8 deletions
|
@ -277,6 +277,7 @@ cifsConvertToUCS(__le16 *target, const char *source, int srclen,
|
||||||
|
|
||||||
for (i = 0, j = 0; i < srclen; j++) {
|
for (i = 0, j = 0; i < srclen; j++) {
|
||||||
src_char = source[i];
|
src_char = source[i];
|
||||||
|
charlen = 1;
|
||||||
switch (src_char) {
|
switch (src_char) {
|
||||||
case 0:
|
case 0:
|
||||||
put_unaligned(0, &target[j]);
|
put_unaligned(0, &target[j]);
|
||||||
|
@ -316,16 +317,13 @@ cifsConvertToUCS(__le16 *target, const char *source, int srclen,
|
||||||
dst_char = cpu_to_le16(0x003f);
|
dst_char = cpu_to_le16(0x003f);
|
||||||
charlen = 1;
|
charlen = 1;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* character may take more than one byte in the source
|
|
||||||
* string, but will take exactly two bytes in the
|
|
||||||
* target string
|
|
||||||
*/
|
|
||||||
i += charlen;
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* character may take more than one byte in the source string,
|
||||||
|
* but will take exactly two bytes in the target string
|
||||||
|
*/
|
||||||
|
i += charlen;
|
||||||
put_unaligned(dst_char, &target[j]);
|
put_unaligned(dst_char, &target[j]);
|
||||||
i++; /* move to next char in source string */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ctoUCS_out:
|
ctoUCS_out:
|
||||||
|
|
|
@ -2673,6 +2673,11 @@ is_path_accessible(int xid, struct cifsTconInfo *tcon,
|
||||||
0 /* not legacy */, cifs_sb->local_nls,
|
0 /* not legacy */, cifs_sb->local_nls,
|
||||||
cifs_sb->mnt_cifs_flags &
|
cifs_sb->mnt_cifs_flags &
|
||||||
CIFS_MOUNT_MAP_SPECIAL_CHR);
|
CIFS_MOUNT_MAP_SPECIAL_CHR);
|
||||||
|
|
||||||
|
if (rc == -EOPNOTSUPP || rc == -EINVAL)
|
||||||
|
rc = SMBQueryInformation(xid, tcon, full_path, pfile_info,
|
||||||
|
cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
|
||||||
|
CIFS_MOUNT_MAP_SPECIAL_CHR);
|
||||||
kfree(pfile_info);
|
kfree(pfile_info);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue