summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2006-12-16 15:50:36 +0000
committerrodrigc <rodrigc@FreeBSD.org>2006-12-16 15:50:36 +0000
commit10e46645522be17076262545d5ddf178b3ebab64 (patch)
treece7e7d7ef37a635f9d7052c8d36fc278e92f91ce
parentccbffdda2c1283ce6fa06c1e3ec3466576061b37 (diff)
downloadFreeBSD-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.
-rw-r--r--sys/kern/vfs_export.c5
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) {
OpenPOWER on IntegriCloud