Index: sys/kern/vfs_mount.c =================================================================== --- sys/kern/vfs_mount.c (revision 190314) +++ sys/kern/vfs_mount.c (working copy) @@ -583,16 +583,13 @@ vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions) { struct vfsoptlist *optlist; - struct vfsopt *opt, *noro_opt, *tmp_opt; + struct vfsopt *opt, *tmp_opt; char *fstype, *fspath, *errmsg; int error, fstypelen, fspathlen, errmsg_len, errmsg_pos; - int has_rw, has_noro; errmsg = NULL; errmsg_len = 0; errmsg_pos = -1; - has_rw = 0; - has_noro = 0; error = vfs_buildopts(fsoptions, &optlist); if (error) @@ -686,11 +683,11 @@ } else if (strcmp(opt->name, "noro") == 0) { fsflags &= ~MNT_RDONLY; - has_noro = 1; } else if (strcmp(opt->name, "rw") == 0) { + free(opt->name, M_MOUNT); + opt->name = strdup("noro", M_MOUNT); fsflags &= ~MNT_RDONLY; - has_rw = 1; } else if (strcmp(opt->name, "ro") == 0) fsflags |= MNT_RDONLY; @@ -708,20 +705,6 @@ } /* - * If "rw" was specified as a mount option, and we - * are trying to update a mount-point from "ro" to "rw", - * we need a mount option "noro", since in vfs_mergeopts(), - * "noro" will cancel "ro", but "rw" will not do anything. - */ - if (has_rw && !has_noro) { - noro_opt = malloc(sizeof(struct vfsopt), M_MOUNT, M_WAITOK); - noro_opt->name = strdup("noro", M_MOUNT); - noro_opt->value = NULL; - noro_opt->len = 0; - TAILQ_INSERT_TAIL(optlist, noro_opt, link); - } - - /* * Be ultra-paranoid about making sure the type and fspath * variables will fit in our mp buffers, including the * terminating NUL.