In vfs_export(), if we specify MNT_DELEXPORT in the struct export_args,
after we perform the operations to delete the export, call vfs_deleteopt() to delete the "export" mount option from the linked list of mount options associated with that mount point. This fixes one scenario: - put a filesystem in /etc/exports to export it - remove the filesystem from /etc/exports to delete the export and restart mountd - try to do a "mount -u -o ro" or "mount -u -o rw" on that filesystem now that it is no longer exported.
This commit is contained in:
parent
2892f3bbfa
commit
03eff5830a
@ -234,8 +234,10 @@ vfs_export(struct mount *mp, struct export_args *argp)
|
||||
|
||||
nep = mp->mnt_export;
|
||||
if (argp->ex_flags & MNT_DELEXPORT) {
|
||||
if (nep == NULL)
|
||||
if (nep == NULL) {
|
||||
vfs_deleteopt(mp->mnt_optnew, "export");
|
||||
return (ENOENT);
|
||||
}
|
||||
if (mp->mnt_flag & MNT_EXPUBLIC) {
|
||||
vfs_setpublicfs(NULL, NULL, NULL);
|
||||
MNT_ILOCK(mp);
|
||||
@ -249,6 +251,7 @@ vfs_export(struct mount *mp, struct export_args *argp)
|
||||
MNT_ILOCK(mp);
|
||||
mp->mnt_flag &= ~(MNT_EXPORTED | MNT_DEFEXPORTED);
|
||||
MNT_IUNLOCK(mp);
|
||||
vfs_deleteopt(mp->mnt_optnew, "export");
|
||||
}
|
||||
if (argp->ex_flags & MNT_EXPORTED) {
|
||||
if (nep == NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user