From owner-svn-src-head@FreeBSD.ORG Tue Aug 19 21:04:32 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 9DB9C476; Tue, 19 Aug 2014 21:04:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6EFE43FDD; Tue, 19 Aug 2014 21:04:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7JL4W4g059224; Tue, 19 Aug 2014 21:04:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7JL4WKo059223; Tue, 19 Aug 2014 21:04:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201408192104.s7JL4WKo059223@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 19 Aug 2014 21:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270183 - head/usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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:04:32 -0000 Author: bdrewery Date: Tue Aug 19 21:04:31 2014 New Revision: 270183 URL: http://svnweb.freebsd.org/changeset/base/270183 Log: Avoid showing stale errors when nmount(2) fails. Sometimes nmount(2) will fail without setting errmsg. The previous (ignored) error would then be shown as the reason for the failed call if the next nmount(2) also fails without [ENOENT,ENOTSUP]. An example is when there is a tmpfs mounted with -o size. vfs_filteropt() adds 'size' as an error in errmsg due to 'size' not being in tmpfs_updateopts. 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 does log an error, with the tmpfs errmsg. The race itself is a separate issue to fix as it is expected to have an [ENOENT] returned instead. In this example the mount being shown is actually nullfs, not tmpfs that the error is from. mountd[740]: can't delete exports for /poudriere/data/.m/exp-head-commit-test-devel/04/.npkg: Invalid argument mount option is unknown It should only show: mountd[740]: can't delete exports for /poudriere/data/.m/exp-head-commit-test-devel/04/.npkg: Invalid argument MFC after: 2 weeks Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- 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 = strlen(fsp->f_mntonname) + 1; iov[5].iov_base = fsp->f_mntfromname; iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; + errmsg[0] = '\0'; if (nmount(iov, iovlen, fsp->f_flags) < 0 && errno != ENOENT && errno != ENOTSUP) { @@ -2501,6 +2502,7 @@ do_mount(struct exportlist *ep, struct g iov[3].iov_len = strlen(fsb->f_mntonname) + 1; iov[5].iov_base = fsb->f_mntfromname; /* "from" */ iov[5].iov_len = strlen(fsb->f_mntfromname) + 1; + errmsg[0] = '\0'; while (nmount(iov, iovlen, fsb->f_flags) < 0) { if (cp)