aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-10-10 13:57:19 -0400
committerSteve French <sfrench@us.ibm.com>2005-10-10 13:57:19 -0400
commit0ae0efada36219024e4e3008f16c993d5d091280 (patch)
tree65e5f46068b31f3d5163e34eec578753f8f99117 /fs/cifs/connect.c
parent68058e757573d4e81550e74c5a03a29a29069ce7 (diff)
[CIFS] Fix rsize calculation so that large readx flag is checked.
Signed-off-by: Steve French (sfrench@us.ibm.com)
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 31eb9a3bf627..d1c6acee620e 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -30,6 +30,7 @@
30#include <linux/mempool.h> 30#include <linux/mempool.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/completion.h> 32#include <linux/completion.h>
33#include <linux/pagevec.h>
33#include <asm/uaccess.h> 34#include <asm/uaccess.h>
34#include <asm/processor.h> 35#include <asm/processor.h>
35#include "cifspdu.h" 36#include "cifspdu.h"
@@ -188,6 +189,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
188 server->server_RFC1001_name); 189 server->server_RFC1001_name);
189 } 190 }
190 if(rc) { 191 if(rc) {
192 cERROR(1,("reconnect error %d",rc));
191 msleep(3000); 193 msleep(3000);
192 } else { 194 } else {
193 atomic_inc(&tcpSesReconnectCount); 195 atomic_inc(&tcpSesReconnectCount);
@@ -469,6 +471,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
469 } else { 471 } else {
470 /* give server a second to 472 /* give server a second to
471 clean up before reconnect attempt */ 473 clean up before reconnect attempt */
474 cERROR(1,("sleep before reconnect"));
472 msleep(1000); 475 msleep(1000);
473 /* always try 445 first on reconnect 476 /* always try 445 first on reconnect
474 since we get NACK on some if we ever 477 since we get NACK on some if we ever
@@ -556,6 +559,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
556 dump_smb(smb_buffer, length); 559 dump_smb(smb_buffer, length);
557 if (checkSMB (smb_buffer, smb_buffer->Mid, total_read+4)) { 560 if (checkSMB (smb_buffer, smb_buffer->Mid, total_read+4)) {
558 cERROR(1, ("Bad SMB Received ")); 561 cERROR(1, ("Bad SMB Received "));
562 cifs_dump_mem("smb: ", smb_buffer, 48);
559 continue; 563 continue;
560 } 564 }
561 565
@@ -1383,7 +1387,9 @@ ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket,
1383 the default. sock_setsockopt not used because it expects 1387 the default. sock_setsockopt not used because it expects
1384 user space buffer */ 1388 user space buffer */
1385 (*csocket)->sk->sk_rcvtimeo = 7 * HZ; 1389 (*csocket)->sk->sk_rcvtimeo = 7 * HZ;
1386 1390 cERROR(1,("sndbuf %d rcvbuf %d reset to 200K each",(*csocket)->sk->sk_sndbuf, (*csocket)->sk->sk_rcvbuf));
1391 (*csocket)->sk->sk_sndbuf = 300 * 1024;
1392 (*csocket)->sk->sk_rcvbuf = 200 * 1024;
1387 /* send RFC1001 sessinit */ 1393 /* send RFC1001 sessinit */
1388 1394
1389 if(psin_server->sin_port == htons(RFC1001_PORT)) { 1395 if(psin_server->sin_port == htons(RFC1001_PORT)) {
@@ -1736,11 +1742,20 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1736 1742
1737 /* search for existing tcon to this server share */ 1743 /* search for existing tcon to this server share */
1738 if (!rc) { 1744 if (!rc) {
1739 if((volume_info.rsize) && (volume_info.rsize <= CIFSMaxBufSize)) 1745 if(volume_info.rsize > CIFSMaxBufSize) {
1746 cERROR(1,("rsize %d too large, using MaxBufSize",
1747 volume_info.rsize));
1748 cifs_sb->rsize = CIFSMaxBufSize;
1749 } else if((volume_info.rsize) && (volume_info.rsize <= CIFSMaxBufSize))
1740 cifs_sb->rsize = volume_info.rsize; 1750 cifs_sb->rsize = volume_info.rsize;
1741 else 1751 else /* default */
1742 cifs_sb->rsize = srvTcp->maxBuf - MAX_CIFS_HDR_SIZE; /* default */ 1752 cifs_sb->rsize = CIFSMaxBufSize;
1743 if(volume_info.wsize) 1753
1754 if(volume_info.wsize > PAGEVEC_SIZE * PAGE_CACHE_SIZE) {
1755 cERROR(1,("wsize %d too large using 4096 instead",
1756 volume_info.wsize));
1757 cifs_sb->wsize = 4096;
1758 } else if(volume_info.wsize)
1744 cifs_sb->wsize = volume_info.wsize; 1759 cifs_sb->wsize = volume_info.wsize;
1745 else 1760 else
1746 cifs_sb->wsize = CIFSMaxBufSize; /* default */ 1761 cifs_sb->wsize = CIFSMaxBufSize; /* default */
@@ -1895,6 +1910,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1895 cifs_sb->wsize = min(cifs_sb->wsize, 1910 cifs_sb->wsize = min(cifs_sb->wsize,
1896 (tcon->ses->server->maxBuf - 1911 (tcon->ses->server->maxBuf -
1897 MAX_CIFS_HDR_SIZE)); 1912 MAX_CIFS_HDR_SIZE));
1913 if (!(tcon->ses->capabilities & CAP_LARGE_READ_X))
1914 cifs_sb->rsize = min(cifs_sb->rsize,
1915 (tcon->ses->server->maxBuf -
1916 MAX_CIFS_HDR_SIZE));
1898 } 1917 }
1899 1918
1900 /* volume_info.password is freed above when existing session found 1919 /* volume_info.password is freed above when existing session found