From owner-freebsd-current Tue May 29 2:34:24 2001 Delivered-To: freebsd-current@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id 2C81C37B422 for ; Tue, 29 May 2001 02:34:20 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 29 May 2001 10:34:19 +0100 (BST) To: John Cc: John Polstra , current@FreeBSD.ORG, Matthew Jacob Subject: Re: wierdness with mountd In-Reply-To: Your message of "Tue, 29 May 2001 04:00:58 EDT." <20010529040058.A67491@bsdwins.com> Date: Tue, 29 May 2001 10:34:18 +0100 From: Ian Dowse Message-ID: <200105291034.aa92435@salmon.maths.tcd.ie> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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