diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2008-07-12 20:12:40 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2008-07-12 20:12:40 +0000 |
commit | f280e5ed8fedcc2d5929eec2250ed602d207c807 (patch) | |
tree | 0a98ece49ef37ee6452d2543d98ea2af11efcb34 /sys | |
parent | 6dd633c3c8e6e0dd2dda12490b9fb0c327f8ce32 (diff) | |
download | FreeBSD-src-f280e5ed8fedcc2d5929eec2250ed602d207c807.zip FreeBSD-src-f280e5ed8fedcc2d5929eec2250ed602d207c807.tar.gz |
In nmount(), if we see "update" in the mount options,
set MNT_UPDATE in fsflags, and delete the
"update" option from the global mount options.
MNT_UPDATE is a command, and not a property of a mount
that should persist after the command is executed.
We need to do similar things for MNT_FORCE and MNT_RELOAD.
All mount flags are prefixed by MNT_..... it would
be nice if flags which were commands were named differently
from flags which are persistent properties of a mount.
This was not such a big deal in the pre-nmount() days,
but with nmount() it is more important.
Requested by: yar
MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_mount.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index ade918a..744f4e9 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -133,7 +133,6 @@ static const char *global_opts[] = { "rw", "nosuid", "noexec", - "update", NULL }; @@ -586,7 +585,7 @@ static int vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions) { struct vfsoptlist *optlist; - struct vfsopt *opt, *noro_opt; + struct vfsopt *opt, *noro_opt, *tmp_opt; char *fstype, *fspath, *errmsg; int error, fstypelen, fspathlen, errmsg_len, errmsg_pos; int has_rw, has_noro; @@ -632,9 +631,11 @@ vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions) * logic based on MNT_UPDATE. This is very important * when we want to update the root filesystem. */ - TAILQ_FOREACH(opt, optlist, link) { - if (strcmp(opt->name, "update") == 0) + TAILQ_FOREACH_SAFE(opt, optlist, link, tmp_opt) { + if (strcmp(opt->name, "update") == 0) { fsflags |= MNT_UPDATE; + vfs_freeopt(optlist, opt); + } else if (strcmp(opt->name, "async") == 0) fsflags |= MNT_ASYNC; else if (strcmp(opt->name, "force") == 0) |