mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Since the netexport struct was centralised to 'struct mount',
attempting to remove nonexistant exports with MNT_DELEXPORT returns an error; before this change it always succeeded. This caused mountd(8) to log "can't delete exports for /whatever" warnings. Change the error code from EINVAL to a more specific ENOENT, and make mountd ignore this error when deleting the export list. I could have just restored the previous behaviour of returning success, but I think an error return is a useful diagnostic. Reviewed by: phk
This commit is contained in:
parent
c215688fd2
commit
5f558fa42f
3 changed files with 9 additions and 7 deletions
|
|
@ -950,9 +950,10 @@ get_exportlist()
|
|||
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",
|
||||
fsp->f_flags | MNT_UPDATE, (caddr_t)&targs) < 0 &&
|
||||
errno != ENOENT)
|
||||
syslog(LOG_ERR,
|
||||
"can't delete exports for %s: %m",
|
||||
fsp->f_mntonname);
|
||||
}
|
||||
fsp++;
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ vfs_export(mp, argp)
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -950,9 +950,10 @@ get_exportlist()
|
|||
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",
|
||||
fsp->f_flags | MNT_UPDATE, (caddr_t)&targs) < 0 &&
|
||||
errno != ENOENT)
|
||||
syslog(LOG_ERR,
|
||||
"can't delete exports for %s: %m",
|
||||
fsp->f_mntonname);
|
||||
}
|
||||
fsp++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue