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
This commit is contained in:
Craig Rodrigues 2008-07-12 20:12:40 +00:00
parent 85a0a1be91
commit 1aad294b4e

View File

@ -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)