Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 May 2001 10:34:18 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        John <jwd@bsdwins.com>
Cc:        John Polstra <jdp@polstra.com>, current@FreeBSD.ORG, Matthew Jacob <mjacob@feral.com>
Subject:   Re: wierdness with mountd 
Message-ID:   <200105291034.aa92435@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Tue, 29 May 2001 04:00:58 EDT." <20010529040058.A67491@bsdwins.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20010529040058.A67491@bsdwins.com>, John writes:

>Looking in /usr/src/sbin/mountd/mountd.c, under line 930
>shows the following:
>
>        num = getmntinfo(&fsp, MNT_NOWAIT);
>
>and then runs through a loop 'num' times trying to
>delete any export for each entry.

Thanks, you're right - this has nothing to do with mountdtab or
mounttab. The commit that caused these messages to appear is
phk's centralisation of the kernel netexport structure:

REV:1.149               ffs_vfsops.c        2001/04/25 07:07:50       phk

   Move the netexport structure from the fs-specific mountstructure
   to struct mount.
   ...

Doing a MNT_DELEXPORT mount used to be a no-op if there were no
exports, but now it returns EINVAL. Maybe that should be changed
to ENOENT or something, so that mountd can detect it as a 'normal'
error? (untested patch below). 

Ian


Index: sys/kern/vfs_export.c
===================================================================
RCS file: /dump/FreeBSD-CVS/src/sys/kern/vfs_export.c,v
retrieving revision 1.310
diff -u -r1.310 vfs_export.c
--- sys/kern/vfs_export.c	2001/04/26 20:47:14	1.310
+++ sys/kern/vfs_export.c	2001/05/29 09:28:43
@@ -207,7 +207,7 @@
 	nep = mp->mnt_export;
 	if (argp->ex_flags & MNT_DELEXPORT) {
 		if (nep == NULL)
-			return (EINVAL);
+			return (ENOENT);
 		if (mp->mnt_flag & MNT_EXPUBLIC) {
 			vfs_setpublicfs(NULL, NULL, NULL);
 			mp->mnt_flag &= ~MNT_EXPUBLIC;
Index: sbin/mountd/mountd.c
===================================================================
RCS file: /dump/FreeBSD-CVS/src/sbin/mountd/mountd.c,v
retrieving revision 1.51
diff -u -r1.51 mountd.c
--- sbin/mountd/mountd.c	2001/05/25 08:14:02	1.51
+++ sbin/mountd/mountd.c	2001/05/29 09:31:43
@@ -903,6 +903,7 @@
 	struct xucred anon;
 	char *cp, *endcp, *dirp, *hst, *usr, *dom, savedc;
 	int len, has_host, exflags, got_nondir, dirplen, num, i, netgrp;
+	int error;
 
 	dirp = NULL;
 	dirplen = 0;
@@ -949,10 +950,11 @@
 		    !strcmp(fsp->f_fstypename, "cd9660")) {
 			targs.ua.fspec = NULL;
 			targs.ua.export.ex_flags = MNT_DELEXPORT;
-			if (mount(fsp->f_fstypename, fsp->f_mntonname,
-				  fsp->f_flags | MNT_UPDATE,
-				  (caddr_t)&targs) < 0)
-				syslog(LOG_ERR, "can't delete exports for %s",
+			error = mount(fsp->f_fstypename, fsp->f_mntonname,
+			    fsp->f_flags | MNT_UPDATE, (caddr_t)&targs);
+			if (error && error != ENOENT)
+				syslog(LOG_ERR,
+				    "can't delete exports for %s: %m",
 				    fsp->f_mntonname);
 		}
 		fsp++;

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <200105291034.aa92435>