From owner-svn-src-head@FreeBSD.ORG Tue Aug 19 21:24:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59167B9B for ; Tue, 19 Aug 2014 21:24:46 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39C6E3201 for ; Tue, 19 Aug 2014 21:24:46 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s7JLOk8W084743 for ; Tue, 19 Aug 2014 21:24:46 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s7JLOjJQ084742 for svn-src-head@freebsd.org; Tue, 19 Aug 2014 21:24:45 GMT (envelope-from bdrewery) Received: (qmail 35258 invoked from network); 19 Aug 2014 16:24:41 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 19 Aug 2014 16:24:41 -0500 Message-ID: <53F3C096.5080907@FreeBSD.org> Date: Tue, 19 Aug 2014 16:24:38 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r270183 - head/usr.sbin/mountd References: <201408192104.s7JL4WKo059223@svn.freebsd.org> In-Reply-To: <201408192104.s7JL4WKo059223@svn.freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G4JGJbjaLGdOhtnrPwq8mVx7CAi3Jfbro" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2014 21:24:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --G4JGJbjaLGdOhtnrPwq8mVx7CAi3Jfbro Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/19/2014 4:04 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Aug 19 21:04:31 2014 > New Revision: 270183 > URL: http://svnweb.freebsd.org/changeset/base/270183 >=20 > Log: > Avoid showing stale errors when nmount(2) fails. > =20 > Sometimes nmount(2) will fail without setting errmsg. The previous (i= gnored) > error would then be shown as the reason for the failed call if the ne= xt > nmount(2) also fails without [ENOENT,ENOTSUP]. > =20 > An example is when there is a tmpfs mounted with -o size. vfs_filtero= pt() adds > 'size' as an error in errmsg due to 'size' not being in tmpfs_updateo= pts. Then > tmpfs_mount returns [ENOTSUP] from nmount(2), which is then ignored. = The next > call may race with an unmount causing an invalid [EINVAL] that then d= oes log an > error, with the tmpfs errmsg. > =20 > The race itself is a separate issue to fix as it is expected to have = an > [ENOENT] returned instead. The actual race causing the EINVAL is here with a proposed patch: http://lists.freebsd.org/pipermail/freebsd-fs/2013-August/018008.html I have not spent time analyzing/testing it yet. > =20 > In this example the mount being shown is actually nullfs, not tmpfs t= hat the > error is from. > =20 > mountd[740]: can't delete exports for /poudriere/data/.m/exp-head-c= ommit-test-devel/04/.npkg: Invalid argument mount option is unknow= n > =20 > It should only show: > =20 > mountd[740]: can't delete exports for /poudriere/data/.m/exp-head-c= ommit-test-devel/04/.npkg: Invalid argument > =20 > MFC after: 2 weeks >=20 > Modified: > head/usr.sbin/mountd/mountd.c >=20 > Modified: head/usr.sbin/mountd/mountd.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/mountd/mountd.c Tue Aug 19 20:53:28 2014 (r270182) > +++ head/usr.sbin/mountd/mountd.c Tue Aug 19 21:04:31 2014 (r270183) > @@ -1744,6 +1744,7 @@ get_exportlist(void) > iov[3].iov_len =3D strlen(fsp->f_mntonname) + 1; > iov[5].iov_base =3D fsp->f_mntfromname; > iov[5].iov_len =3D strlen(fsp->f_mntfromname) + 1; > + errmsg[0] =3D '\0'; > =20 > if (nmount(iov, iovlen, fsp->f_flags) < 0 && > errno !=3D ENOENT && errno !=3D ENOTSUP) { > @@ -2501,6 +2502,7 @@ do_mount(struct exportlist *ep, struct g > iov[3].iov_len =3D strlen(fsb->f_mntonname) + 1; > iov[5].iov_base =3D fsb->f_mntfromname; /* "from" */ > iov[5].iov_len =3D strlen(fsb->f_mntfromname) + 1; > + errmsg[0] =3D '\0'; > =09 > while (nmount(iov, iovlen, fsb->f_flags) < 0) { > if (cp) >=20 --=20 Regards, Bryan Drewery --G4JGJbjaLGdOhtnrPwq8mVx7CAi3Jfbro Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJT88CXAAoJEDXXcbtuRpfPm+sIALUpaWY9gwkcahVPSTvK/DIM ejtcfuZ3xuy7n3LTw5oCa4RwEaOpRf1eo3NknPbkMiREUKAXgjRo/HAVLmFlEIZB d+cVvHrqnnapG0IZ9HjjI5G+IT/CLNviDtw7cb/p4skJz2rGXjvMbg1IdXidItE5 6MkCmtO2Tk+l/8/erS9RnYu2k0LhSC5BJOt2fiaAehsqd0de7l7LVSth4e/n5pP1 tq+rpd/nhi+05dyTaNeL8Ibv2i7arkkDo1oJlGAKblNRDZJzfBEb/yGIvwUjt51G fzw/AqK0hMvb9xIAJrj8TDPtWrCVaz2Pwdr+UTkFtGKGRAusi2gUs3qzGW8NnZE= =VpX4 -----END PGP SIGNATURE----- --G4JGJbjaLGdOhtnrPwq8mVx7CAi3Jfbro--