Re: [Cause found, no patch yet] knfsd: nfs_revalidate_inode fails.

H.J. Lu (hjl@lucon.org)
Tue, 17 Nov 1998 21:37:44 -0800 (PST)


Hi,

Could you please try this patch?

Thanks.

H.J.

---
Index: utils/mountd/auth.c
===================================================================
RCS file: /home/work/cvs/linux/knfsd/utils/mountd/auth.c,v
retrieving revision 1.8
diff -u -p -r1.8 auth.c
--- utils/mountd/auth.c	1998/10/14 15:13:47	1.8
+++ utils/mountd/auth.c	1998/11/18 05:32:06
@@ -117,19 +117,8 @@ auth_authenticate(char *what, struct soc
 			hp = NULL;
 		}
 		exp = auth_authenticate_internal(what, caller, epath, &hp);
-		if (exp) {
-			if (p) {
-				if (exp->m_client->m_type == MCL_FQDN)
-					exp = export_dup(exp, hp);
-				/* When we change path for authentication,
-				   we need to put the original path back.
-				   Otherwise, rmtab will be wrong. */
-				strncpy(exp->m_export.m_path, path,
-					sizeof (exp->m_export.m_path) - 1);
-				exp->m_export.m_path[sizeof (exp->m_export.m_path) - 1] = '\0';
-			}
+		if (exp)
 			break;
-		}
 		/* We have to treat the root, "/", specially. */
 		if (p == &epath[1]) break;
 		p = strrchr(epath, '/');
Index: utils/mountd/mountd.c
===================================================================
RCS file: /home/work/cvs/linux/knfsd/utils/mountd/mountd.c,v
retrieving revision 1.9
diff -u -p -r1.9 mountd.c
--- utils/mountd/mountd.c	1998/10/14 15:13:47	1.9
+++ utils/mountd/mountd.c	1998/11/18 05:22:04
@@ -93,7 +93,7 @@ mount_umnt_1_svc(struct svc_req *rqstp, 
 	if (!(exp = auth_authenticate("unmount", sin, p))) {
 		return 1;
 	}
-	mountlist_del(exp);
+	mountlist_del(exp, p);
 	export_reset (exp);
 	return 1;
 }
@@ -257,7 +257,7 @@ get_rootfh(struct svc_req *rqstp, dirpat
 			fh = getfh_old ((struct sockaddr *) sin,
 				    stb.st_dev, stb.st_ino);
 		if (fh != NULL) {
-			mountlist_add(exp);
+			mountlist_add(exp, p);
 			*error = NFS_OK;
 			export_reset (exp);
 			return fh;
Index: utils/mountd/mountd.h
===================================================================
RCS file: /home/work/cvs/linux/knfsd/utils/mountd/mountd.h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 mountd.h
--- utils/mountd/mountd.h	1998/08/19 02:37:45	1.1.1.1
+++ utils/mountd/mountd.h	1998/11/18 05:20:47
@@ -45,8 +45,8 @@ nfs_export *	auth_authenticate(char *wha
 					char *path);
 void		auth_export(nfs_export *exp);
 
-void		mountlist_add(nfs_export *exp);
-void		mountlist_del(nfs_export *exp);
+void		mountlist_add(nfs_export *exp, const char *path);
+void		mountlist_del(nfs_export *exp, const char *path);
 void		mountlist_del_all(struct sockaddr_in *sin);
 mountlist	mountlist_list(void);
 
Index: utils/mountd/rmtab.c
===================================================================
RCS file: /home/work/cvs/linux/knfsd/utils/mountd/rmtab.c,v
retrieving revision 1.6
diff -u -p -r1.6 rmtab.c
--- utils/mountd/rmtab.c	1998/10/10 23:57:25	1.6
+++ utils/mountd/rmtab.c	1998/11/18 05:24:30
@@ -19,7 +19,7 @@
 #define _PATH_RMTABTMP	_PATH_RMTAB ".tmp"
 
 void
-mountlist_add(nfs_export *exp)
+mountlist_add(nfs_export *exp, const char *path)
 {
 	struct rmtabent	xe;
 	struct rmtabent	*rep;
@@ -31,7 +31,7 @@ mountlist_add(nfs_export *exp)
 	while ((rep = getrmtabent()) != NULL) {
 		if (matchhostname(rep->r_client,
 				  exp->m_client->m_hostname)
-		    && strcmp(rep->r_path, exp->m_export.m_path) == 0) {
+		    && strcmp(rep->r_path, path) == 0) {
 			endrmtabent();
 			xfunlock(lockid);
 			return;
@@ -41,8 +41,7 @@ mountlist_add(nfs_export *exp)
 	strncpy(xe.r_client, exp->m_client->m_hostname,
 		sizeof (xe.r_client) - 1);
 	xe.r_client [sizeof (xe.r_client) - 1] = '\0';
-	strncpy(xe.r_path, exp->m_export.m_path,
-		sizeof (xe.r_path) - 1);
+	strncpy(xe.r_path, path, sizeof (xe.r_path) - 1);
 	xe.r_path [sizeof (xe.r_path) - 1] = '\0';
 	if (setrmtabent("a")) {
 		putrmtabent(&xe);
@@ -52,12 +51,11 @@ mountlist_add(nfs_export *exp)
 }
 
 void
-mountlist_del(nfs_export *exp)
+mountlist_del(nfs_export *exp, const char *path)
 {
 	struct rmtabent	*rep;
 	FILE		*fp;
-	char		*hname = exp->m_client->m_hostname,
-			*path = exp->m_export.m_path;
+	char		*hname = exp->m_client->m_hostname;
 	int		lockid;
 
 	if ((lockid = xflock(_PATH_RMTAB, "w")) < 0)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/