aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2012-02-21 08:50:23 -0500
committerSteve French <sfrench@us.ibm.com>2012-03-21 12:35:38 -0400
commit6dae51a585008535858c29b489dbf90a913d511b (patch)
tree64a5bfd5d14946ef8e36a90b37d7057364d5f542
parentbc205ed19bdb56576b291830bc3f752aef5e3923 (diff)
CIFS: Delete echo_retries module parm
It's the essential step before respecting MaxMpxCount value during negotiating because we will keep only one extra slot for sending echo requests. If there is no response during two echo intervals - reconnect the tcp session. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r--fs/cifs/README6
-rw-r--r--fs/cifs/cifsfs.c5
-rw-r--r--fs/cifs/cifsglob.h3
-rw-r--r--fs/cifs/connect.c18
4 files changed, 15 insertions, 17 deletions
diff --git a/fs/cifs/README b/fs/cifs/README
index 895da1dc1550..b7d782bab797 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -753,10 +753,6 @@ module loading or during the runtime by using the interface
753 753
754i.e. echo "value" > /sys/module/cifs/parameters/<param> 754i.e. echo "value" > /sys/module/cifs/parameters/<param>
755 755
7561. echo_retries - The number of echo attempts before giving up and 7561. enable_oplocks - Enable or disable oplocks. Oplocks are enabled by default.
757 reconnecting to the server. The default is 5. The value 0
758 means never reconnect.
759
7602. enable_oplocks - Enable or disable oplocks. Oplocks are enabled by default.
761 [Y/y/1]. To disable use any of [N/n/0]. 757 [Y/y/1]. To disable use any of [N/n/0].
762 758
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 6ee1cb45ca0d..f2661610fcf3 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -77,11 +77,6 @@ unsigned int cifs_max_pending = CIFS_MAX_REQ;
77module_param(cifs_max_pending, int, 0444); 77module_param(cifs_max_pending, int, 0444);
78MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. " 78MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. "
79 "Default: 32767 Range: 2 to 32767."); 79 "Default: 32767 Range: 2 to 32767.");
80unsigned short echo_retries = 5;
81module_param(echo_retries, ushort, 0644);
82MODULE_PARM_DESC(echo_retries, "Number of echo attempts before giving up and "
83 "reconnecting server. Default: 5. 0 means "
84 "never reconnect.");
85module_param(enable_oplocks, bool, 0644); 80module_param(enable_oplocks, bool, 0644);
86MODULE_PARM_DESC(enable_oplocks, "Enable or disable oplocks (bool). Default:" 81MODULE_PARM_DESC(enable_oplocks, "Enable or disable oplocks (bool). Default:"
87 "y/Y/1"); 82 "y/Y/1");
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 2309a67738bf..339ebe3ebc0d 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -1038,9 +1038,6 @@ GLOBAL_EXTERN unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */
1038GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */ 1038GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */
1039GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/ 1039GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/
1040 1040
1041/* reconnect after this many failed echo attempts */
1042GLOBAL_EXTERN unsigned short echo_retries;
1043
1044#ifdef CONFIG_CIFS_ACL 1041#ifdef CONFIG_CIFS_ACL
1045GLOBAL_EXTERN struct rb_root uidtree; 1042GLOBAL_EXTERN struct rb_root uidtree;
1046GLOBAL_EXTERN struct rb_root gidtree; 1043GLOBAL_EXTERN struct rb_root gidtree;
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 1d489010615b..5560e1d5e54b 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -373,12 +373,22 @@ allocate_buffers(struct TCP_Server_Info *server)
373static bool 373static bool
374server_unresponsive(struct TCP_Server_Info *server) 374server_unresponsive(struct TCP_Server_Info *server)
375{ 375{
376 if (echo_retries > 0 && server->tcpStatus == CifsGood && 376 /*
377 time_after(jiffies, server->lstrp + 377 * We need to wait 2 echo intervals to make sure we handle such
378 (echo_retries * SMB_ECHO_INTERVAL))) { 378 * situations right:
379 * 1s client sends a normal SMB request
380 * 2s client gets a response
381 * 30s echo workqueue job pops, and decides we got a response recently
382 * and don't need to send another
383 * ...
384 * 65s kernel_recvmsg times out, and we see that we haven't gotten
385 * a response in >60s.
386 */
387 if (server->tcpStatus == CifsGood &&
388 time_after(jiffies, server->lstrp + 2 * SMB_ECHO_INTERVAL)) {
379 cERROR(1, "Server %s has not responded in %d seconds. " 389 cERROR(1, "Server %s has not responded in %d seconds. "
380 "Reconnecting...", server->hostname, 390 "Reconnecting...", server->hostname,
381 (echo_retries * SMB_ECHO_INTERVAL / HZ)); 391 (2 * SMB_ECHO_INTERVAL) / HZ);
382 cifs_reconnect(server); 392 cifs_reconnect(server);
383 wake_up(&server->response_q); 393 wake_up(&server->response_q);
384 return true; 394 return true;