patch-1.3.91 linux/fs/ncpfs/sock.c

Next file: linux/fs/nfs/dir.c
Previous file: linux/fs/ncpfs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.90/linux/fs/ncpfs/sock.c linux/fs/ncpfs/sock.c
@@ -330,6 +330,7 @@
 	int timeout;
 	int retrans;
 	int major_timeout_seen;
+	int acknowledge_seen;
 	char *server_name;
 	int n;
 	int addrlen;
@@ -352,9 +353,10 @@
 		return -EBADF;
 	}
 	init_timeout = server->m.time_out;
-	max_timeout = NCP_MAX_RPC_TIMEOUT*HZ/10;
+	max_timeout = NCP_MAX_RPC_TIMEOUT;
 	retrans = server->m.retry_count;
 	major_timeout_seen = 0;
+	acknowledge_seen = 0;
 	server_name = server->m.server_name;
 	old_mask = current->blocked;
 	current->blocked |= ~(_S(SIGKILL)
@@ -405,12 +407,15 @@
 		{
 			if (timeout > max_timeout)
 			{
-			  /* JEJB/JSP 2/7/94
-			   * This is useful to see if the system is
-			   * hanging */
-			  printk("NCP max timeout reached on %s\n",
-				 server_name);
-			  timeout = max_timeout;
+				/* JEJB/JSP 2/7/94
+				 * This is useful to see if the system is
+				 * hanging */
+				if (acknowledge_seen == 0)
+				{
+					printk("NCP max timeout reached on "
+					       "%s\n", server_name);
+				}
+				timeout = max_timeout;
 			}
 			current->timeout = jiffies + timeout;
 			schedule();
@@ -438,8 +443,8 @@
 				init_timeout <<= 1;
 				if (!major_timeout_seen)
 				{
-				  printk("NCP server %s not responding, "
-					 "still trying\n", server_name);
+					printk("NCP server %s not responding, "
+					       "still trying\n", server_name);
 				}
 				major_timeout_seen = 1;
 				continue;
@@ -484,6 +489,9 @@
 			DPRINTK("ncp_rpc_call: got positive acknowledge\n");
 			_recvfrom(sock, (void *)&reply, sizeof(reply), 1, 0,
 				  NULL, &addrlen);
+			n = 0;
+			timeout = max_timeout;
+			acknowledge_seen = 1;
 			goto re_select;
 		}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this