summaryrefslogtreecommitdiffstats
path: root/sbin/mount_nfs
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2008-02-18 10:24:47 +0000
committeryar <yar@FreeBSD.org>2008-02-18 10:24:47 +0000
commit6c809a426ade64ce82f2f4480682bc1c520f6a2d (patch)
tree15503aa2c4877bfca81028b2736c63b9b360d098 /sbin/mount_nfs
parent2bac23abfa40043220b64d61ca13a4e2fc13cddb (diff)
downloadFreeBSD-src-6c809a426ade64ce82f2f4480682bc1c520f6a2d.zip
FreeBSD-src-6c809a426ade64ce82f2f4480682bc1c520f6a2d.tar.gz
Add a work-around to make it possible again to remount
NFS root r/w. The real solution would be to bring the whole nmount(2) framework, including FS drivers and userland tools, into a consistent state at last; but things should work in the meantime, too. Reported by: kris
Diffstat (limited to 'sbin/mount_nfs')
-rw-r--r--sbin/mount_nfs/mount_nfs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 48c0a1f..51f4e43 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -516,6 +516,15 @@ main(int argc, char *argv[])
/* resolve the mountpoint with realpath(3) */
(void)checkpath(name, mntpath);
+ /*
+ * XXX This should go away when this NFS implementation
+ * is fully converted to nmount(2) semantics.
+ */
+ if (mntflags & MNT_RDONLY)
+ build_iovec(&iov, &iovlen, "ro", NULL, 0);
+ else if (mntflags & MNT_UPDATE)
+ build_iovec(&iov, &iovlen, "noro", NULL, 0);
+
build_iovec(&iov, &iovlen, "nfs_args", nfsargsp, sizeof(*nfsargsp));
build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1);
build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1);
OpenPOWER on IntegriCloud