changeset 1:475eb30342f9

4634519 dead clients significantly delay lockd startup on Solaris9
author gt29601
date Tue, 14 Jun 2005 05:54:32 -0700
parents 68f95e015346
children b9db0344fa5f
files usr/src/cmd/fs.d/nfs/statd/sm_proc.c usr/src/cmd/fs.d/nfs/statd/sm_statd.c usr/src/cmd/fs.d/nfs/statd/sm_statd.h
diffstat 3 files changed, 18 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/fs.d/nfs/statd/sm_proc.c	Tue Jun 14 00:00:00 2005 -0700
+++ b/usr/src/cmd/fs.d/nfs/statd/sm_proc.c	Tue Jun 14 05:54:32 2005 -0700
@@ -20,7 +20,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2000 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -779,13 +779,14 @@
 		(void) printf("statd_call_lockd: %s state = %d\n",
 			stat.mon_name, stat.state);
 
+	tottimeout.tv_sec = SM_RPC_TIMEOUT;
+	tottimeout.tv_usec = 0;
+
 	if ((clnt = create_client(my_idp->my_name, my_idp->my_prog,
-		my_idp->my_vers)) == (CLIENT *) NULL) {
+		my_idp->my_vers, &tottimeout)) == (CLIENT *) NULL) {
 			return (-1);
 	}
 
-	tottimeout.tv_sec = SM_RPC_TIMEOUT;
-	tottimeout.tv_usec = 0;
 	clnt_stat = clnt_call(clnt, my_idp->my_proc, xdr_status, (char *)&stat,
 				xdr_void, NULL, tottimeout);
 	if (debug) {
@@ -808,18 +809,19 @@
  * Client handle created.
  */
 CLIENT *
-create_client(host, prognum, versnum)
+create_client(host, prognum, versnum, utimeout)
 	char	*host;
 	int	prognum;
 	int	versnum;
+	struct timeval	*utimeout;
 {
 	int		fd;
 	struct timeval	timeout;
 	CLIENT		*client;
 	struct t_info	tinfo;
 
-	if ((client = clnt_create(host, prognum, versnum,
-			"netpath")) == NULL) {
+	if ((client = clnt_create_timed(host, prognum, versnum,
+			"netpath", utimeout)) == NULL) {
 		return (NULL);
 	}
 	(void) CLNT_CONTROL(client, CLGET_FD, (caddr_t)&fd);
--- a/usr/src/cmd/fs.d/nfs/statd/sm_statd.c	Tue Jun 14 00:00:00 2005 -0700
+++ b/usr/src/cmd/fs.d/nfs/statd/sm_statd.c	Tue Jun 14 05:54:32 2005 -0700
@@ -20,7 +20,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -594,14 +594,14 @@
 				name_or_addr);
 	}
 
-	if ((clnt = create_client(name_or_addr, SM_PROG, SM_VERS)) ==
-		(CLIENT *) NULL) {
-			return (-1);
-	}
-
 	tottimeout.tv_sec = SM_RPC_TIMEOUT;
 	tottimeout.tv_usec = 0;
 
+	if ((clnt = create_client(name_or_addr, SM_PROG, SM_VERS,
+	    &tottimeout)) == (CLIENT *) NULL) {
+		return (-1);
+	}
+
 	/* Perform notification to client */
 	rc = 0;
 	clnt_stat = clnt_call(clnt, SM_NOTIFY, xdr_stat_chge, (char *)&ntf,
--- a/usr/src/cmd/fs.d/nfs/statd/sm_statd.h	Tue Jun 14 00:00:00 2005 -0700
+++ b/usr/src/cmd/fs.d/nfs/statd/sm_statd.h	Tue Jun 14 05:54:32 2005 -0700
@@ -20,7 +20,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -66,7 +66,7 @@
 #define	SM_ADDR_IPV6	"ipv6"
 
 /* Supported for readdir_r() */
-#define MAXDIRENT	(sizeof (struct dirent) +  _POSIX_PATH_MAX + 1)
+#define	MAXDIRENT	(sizeof (struct dirent) +  _POSIX_PATH_MAX + 1)
 
 /* Structure entry for monitor table (mon_table) */
 struct mon_entry {
@@ -185,7 +185,7 @@
 extern void	sm_notify(stat_chge *ntfp);
 extern void	statd_init();
 extern void	merge_hosts(void);
-extern CLIENT	*create_client(char *host, int prognum, int versnum);
+extern CLIENT	*create_client(char *, int, int, struct timeval *);
 extern char	*xmalloc(unsigned);
 extern void	sm_status(sm_name *namep, sm_stat_res *resp);
 extern void	sm_mon(mon *monp, sm_stat_res *resp);