bin/99873: [patch] mountd(8) reload fails

Craig Rodrigues rodrigc at FreeBSD.org
Fri Jul 7 19:30:10 UTC 2006


Synopsis: [patch] mountd(8) reload fails

Responsible-Changed-From-To: freebsd-bugs->rodrigc
Responsible-Changed-By: rodrigc
Responsible-Changed-When: Fri Jul 7 19:27:38 UTC 2006
Responsible-Changed-Why: 
Does this patch, which is a slight variation of your patch work for you?

Index: mountd.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/mountd/mountd.c,v
retrieving revision 1.87
diff -u -u -r1.87 mountd.c
--- mountd.c	6 Jun 2006 21:56:49 -0000	1.87
+++ mountd.c	7 Jul 2006 19:26:43 -0000
@@ -963,7 +963,7 @@
 	struct export_args export;
 	struct dirlist *dirhead;
 	struct iovec *iov;
-	struct statfs fsb, *fsp;
+	struct statfs fsb, *fsp, *mntbufp;
 	struct xucred anon;
 	struct xvfsconf vfc;
 	char *cp, *endcp, *dirp, *hst, *usr, *dom, savedc;
@@ -1001,10 +1001,9 @@
 	/*
 	 * And delete exports that are in the kernel for all local
 	 * filesystems.
-	 * XXX: Should know how to handle all local exportable filesystems
-	 *      instead of just "ufs".
+	 * XXX: Should know how to handle all local exportable filesystems.
 	 */
-	num = getmntinfo(&fsp, MNT_NOWAIT);
+	num = getmntinfo(&mntbufp, MNT_NOWAIT);
 
 	if (num > 0) {
 		build_iovec(&iov, &iovlen, "fstype", NULL, 0);
@@ -1016,6 +1015,7 @@
 	}
 
 	for (i = 0; i < num; i++) {
+		fsp = &mntbufp[i];
 		if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) {
 			syslog(LOG_ERR, "getvfsbyname() failed for %s",
 			    fsp->f_fstypename);
@@ -1052,7 +1052,6 @@
 			    "can't delete exports for %s: %m %s",
 			    fsp->f_mntonname, errmsg);
 		}
-		fsp++;
 	}
 
 	if (iov != NULL) {

http://www.freebsd.org/cgi/query-pr.cgi?pr=99873


More information about the freebsd-bugs mailing list