From 5e15cfc3fa10dccdd2f4b4b09756ec41ccdf79c9 Mon Sep 17 00:00:00 2001 From: des Date: Wed, 27 Apr 2005 14:46:02 +0000 Subject: [PATCH] When NFS was converted to the new mount syscall, code was written that sets the MNT_RDONLY flag if the "ro" option was passed in from userland, and clears it otherwise. In the diskless case, the MNT_RDONLY flag is already set when this code is reached, but there are no mount options, so it was incorrectly cleared. Change the logic so the MNT_RDONLY flag is set if the "ro" option was specified, and left alone otherwise. Note that the NFS code will still happily let you mount a filesystem RW even if the server exports it RO. I'm not sure how to fix that. --- sys/nfsclient/nfs_vfsops.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 8f77ccfb3661..92329ffbb828 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -513,9 +513,7 @@ nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp) int maxio; s = splnet(); - if (vfs_getopt(mp->mnt_optnew, "ro", NULL, NULL)) - mp->mnt_flag &= ~MNT_RDONLY; - else + if (vfs_getopt(mp->mnt_optnew, "ro", NULL, NULL) == 0) mp->mnt_flag |= MNT_RDONLY; /* * Silently clear NFSMNT_NOCONN if it's a TCP mount, it makes