]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Avoid showing stale errors when nmount(2) fails.
authorBryan Drewery <bdrewery@FreeBSD.org>
Tue, 19 Aug 2014 21:04:31 +0000 (21:04 +0000)
committerBryan Drewery <bdrewery@FreeBSD.org>
Tue, 19 Aug 2014 21:04:31 +0000 (21:04 +0000)
commit4a185fa6c9b6e0fde95dfa66609501dbfaa6d5cd
treeb98e03e73a8c04403b746277a528f4170221a209
parent11cb1b138e73ba00c6790f859da72ca41a23838c
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 <size> 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
usr.sbin/mountd/mountd.c