diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2006-12-16 15:50:36 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2006-12-16 15:50:36 +0000 |
commit | 10e46645522be17076262545d5ddf178b3ebab64 (patch) | |
tree | ce7e7d7ef37a635f9d7052c8d36fc278e92f91ce /sys/kern/vfs_export.c | |
parent | ccbffdda2c1283ce6fa06c1e3ec3466576061b37 (diff) | |
download | FreeBSD-src-10e46645522be17076262545d5ddf178b3ebab64.zip FreeBSD-src-10e46645522be17076262545d5ddf178b3ebab64.tar.gz |
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.
Diffstat (limited to 'sys/kern/vfs_export.c')
-rw-r--r-- | sys/kern/vfs_export.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index a454bb8..4ddd758 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -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) { |