Merge git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French. * git://git.samba.org/sfrench/cifs-2.6: cifs: when server doesn't set CAP_LARGE_READ_X, cap default rsize at MaxBufferSize cifs: fix parsing of password mount option
This commit is contained in:
@@ -1653,24 +1653,26 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
|
|||||||
* If yes, we have encountered a double deliminator
|
* If yes, we have encountered a double deliminator
|
||||||
* reset the NULL character to the deliminator
|
* reset the NULL character to the deliminator
|
||||||
*/
|
*/
|
||||||
if (tmp_end < end && tmp_end[1] == delim)
|
if (tmp_end < end && tmp_end[1] == delim) {
|
||||||
tmp_end[0] = delim;
|
tmp_end[0] = delim;
|
||||||
|
|
||||||
/* Keep iterating until we get to a single deliminator
|
/* Keep iterating until we get to a single
|
||||||
* OR the end
|
* deliminator OR the end
|
||||||
*/
|
*/
|
||||||
while ((tmp_end = strchr(tmp_end, delim)) != NULL &&
|
while ((tmp_end = strchr(tmp_end, delim))
|
||||||
(tmp_end[1] == delim)) {
|
!= NULL && (tmp_end[1] == delim)) {
|
||||||
tmp_end = (char *) &tmp_end[2];
|
tmp_end = (char *) &tmp_end[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset var options to point to next element */
|
/* Reset var options to point to next element */
|
||||||
if (tmp_end) {
|
if (tmp_end) {
|
||||||
tmp_end[0] = '\0';
|
tmp_end[0] = '\0';
|
||||||
options = (char *) &tmp_end[1];
|
options = (char *) &tmp_end[1];
|
||||||
} else
|
} else
|
||||||
/* Reached the end of the mount option string */
|
/* Reached the end of the mount option
|
||||||
options = end;
|
* string */
|
||||||
|
options = end;
|
||||||
|
}
|
||||||
|
|
||||||
/* Now build new password string */
|
/* Now build new password string */
|
||||||
temp_len = strlen(value);
|
temp_len = strlen(value);
|
||||||
@@ -3493,18 +3495,15 @@ cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info)
|
|||||||
* MS-CIFS indicates that servers are only limited by the client's
|
* MS-CIFS indicates that servers are only limited by the client's
|
||||||
* bufsize for reads, testing against win98se shows that it throws
|
* bufsize for reads, testing against win98se shows that it throws
|
||||||
* INVALID_PARAMETER errors if you try to request too large a read.
|
* INVALID_PARAMETER errors if you try to request too large a read.
|
||||||
|
* OS/2 just sends back short reads.
|
||||||
*
|
*
|
||||||
* If the server advertises a MaxBufferSize of less than one page,
|
* If the server doesn't advertise CAP_LARGE_READ_X, then assume that
|
||||||
* assume that it also can't satisfy reads larger than that either.
|
* it can't handle a read request larger than its MaxBufferSize either.
|
||||||
*
|
|
||||||
* FIXME: Is there a better heuristic for this?
|
|
||||||
*/
|
*/
|
||||||
if (tcon->unix_ext && (unix_cap & CIFS_UNIX_LARGE_READ_CAP))
|
if (tcon->unix_ext && (unix_cap & CIFS_UNIX_LARGE_READ_CAP))
|
||||||
defsize = CIFS_DEFAULT_IOSIZE;
|
defsize = CIFS_DEFAULT_IOSIZE;
|
||||||
else if (server->capabilities & CAP_LARGE_READ_X)
|
else if (server->capabilities & CAP_LARGE_READ_X)
|
||||||
defsize = CIFS_DEFAULT_NON_POSIX_RSIZE;
|
defsize = CIFS_DEFAULT_NON_POSIX_RSIZE;
|
||||||
else if (server->maxBuf >= PAGE_CACHE_SIZE)
|
|
||||||
defsize = CIFSMaxBufSize;
|
|
||||||
else
|
else
|
||||||
defsize = server->maxBuf - sizeof(READ_RSP);
|
defsize = server->maxBuf - sizeof(READ_RSP);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user