diff options
author | des <des@FreeBSD.org> | 2005-04-27 14:46:02 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2005-04-27 14:46:02 +0000 |
commit | 5e15cfc3fa10dccdd2f4b4b09756ec41ccdf79c9 (patch) | |
tree | e7a8630c6bdd3caf012ffb135c8022dea33f1fde /sys/nfsclient | |
parent | 00028d2c5b91757e8d65024214adfbac51e4528f (diff) | |
download | FreeBSD-src-5e15cfc3fa10dccdd2f4b4b09756ec41ccdf79c9.zip FreeBSD-src-5e15cfc3fa10dccdd2f4b4b09756ec41ccdf79c9.tar.gz |
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.
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 8f77ccf..92329ff 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 |