summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vfsops.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2005-05-17 12:00:43 +0000
committerdes <des@FreeBSD.org>2005-05-17 12:00:43 +0000
commitd3a97500015b7259f6aa9364ef3e6931a51202d8 (patch)
tree469a27658d0ddbe76fc11799702e8a88c40eba63 /sys/nfsclient/nfs_vfsops.c
parentd97501076796993be1cd32e0b75c11809342eb40 (diff)
downloadFreeBSD-src-d3a97500015b7259f6aa9364ef3e6931a51202d8.zip
FreeBSD-src-d3a97500015b7259f6aa9364ef3e6931a51202d8.tar.gz
Revision 1.173 broke updating a mount from ro to rw. Fix that by clearing
the MNT_RDONLY flag if MNT_UPDATE is set and "ro" was not specified. Suggested by: cognet
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r--sys/nfsclient/nfs_vfsops.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index cb0f06a..d2a9cf0 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -512,8 +512,18 @@ 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) == 0)
+
+ /*
+ * Set read-only flag if requested; otherwise, clear it if this is
+ * an update. If this is not an update, then either the read-only
+ * flag is already clear, or this is a root mount and it was set
+ * intentionally at some previous point.
+ */
+ if (vfs_getopt(mp->mnt_optnew, "ro", NULL, NULL) != 0)
mp->mnt_flag |= MNT_RDONLY;
+ else if (!(mp->mnt_flag & MNT_UPDATE))
+ mp->mnt_flag &= ~MNT_RDONLY;
+
/*
* Silently clear NFSMNT_NOCONN if it's a TCP mount, it makes
* no sense in that context.
OpenPOWER on IntegriCloud