diff options
author | kib <kib@FreeBSD.org> | 2015-02-10 18:00:32 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-02-10 18:00:32 +0000 |
commit | 7a1bb0de5fa8e1d2cff94cca963df5c7a1e98b9f (patch) | |
tree | 30f2c50d2f8c91268f7017807b24a732146b8520 /usr.sbin/mountd | |
parent | e13ac6cd7e065284276799a1241dbcd5527aeffb (diff) | |
download | FreeBSD-src-7a1bb0de5fa8e1d2cff94cca963df5c7a1e98b9f.zip FreeBSD-src-7a1bb0de5fa8e1d2cff94cca963df5c7a1e98b9f.tar.gz |
Mountd iterating over the mount points may race with the parallel
unmount, which causes error from nmount(2) call when performing
MNT_DELEXPORT over the directory which ceased to be a mount point.
The race is legitimate and innocent, but results in the chatty mountd.
Silence it by providing an distinguished error code for the situation,
and ignoring the error in mountd loop.
Based on the patch by: Andreas Longwitz <longwitz@incore.de>
Prodded and tested by: bdrewery
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Diffstat (limited to 'usr.sbin/mountd')
-rw-r--r-- | usr.sbin/mountd/mountd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 87794c3..ad1964e 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -1747,8 +1747,12 @@ get_exportlist(void) iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; errmsg[0] = '\0'; + /* + * EXDEV is returned when path exists but is not a + * mount point. May happens if raced with unmount. + */ if (nmount(iov, iovlen, fsp->f_flags) < 0 && - errno != ENOENT && errno != ENOTSUP) { + errno != ENOENT && errno != ENOTSUP && errno != EXDEV) { syslog(LOG_ERR, "can't delete exports for %s: %m %s", fsp->f_mntonname, errmsg); |