Date: Tue, 14 Dec 2004 14:46:20 -0800 From: Ted Faber <faber@isi.edu> To: hackers@freebsd.org Subject: sysctl to make all nfs mounts use local file locking (patch enclosed) Message-ID: <20041214224620.GC965@pun.isi.edu>
next in thread | raw e-mail | index | archive | help
--/3yNEOqWowh/8j+e Content-Type: multipart/mixed; boundary="f0KYrhQ4vYSV2aJu" Content-Disposition: inline --f0KYrhQ4vYSV2aJu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi. I've recently upgraded my main work machine to -CURRENT in an environment where much of the world is mounted via NFS. The NFS locking via rpc.lockd/rpc.statd doesn't seem to be too stable, and the -L behavior described in mount_nfs(8) works much better for me. Unfortunately, I can't seem to coax the automounter into providing those kinds of mounts for me. Since I only need the local locking behavior, I create a little sysctl that adds the NFSMNT_NOLOCKD flag to any NFS mount. I've made a patch against -CURRENT for anyone who'd liek to add this functionality to their kernel. If a committer is {interested in,happy with} this patch, please feel free to commit it. And if I've missed a way to make the automounter do this, please wise me up. Thanks. -- Ted Faber http://www.isi.edu/~faber PGP: http://www.isi.edu/~faber/pubkeys.asc Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG --f0KYrhQ4vYSV2aJu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=nfs_patch --- nfs_vfsops.c.orig Tue Dec 7 06:26:39 2004 +++ nfs_vfsops.c Tue Dec 14 12:39:22 2004 @@ -88,6 +88,9 @@ static int nfs_ip_paranoia = 1; SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_ip_paranoia, CTLFLAG_RW, &nfs_ip_paranoia, 0, ""); +static int nfs_force_local_locking = 0; +SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_force_local_locking, CTLFLAG_RW, + &nfs_force_local_locking, 0, ""); #ifdef NFS_DEBUG int nfs_debug; SYSCTL_INT(_vfs_nfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0, ""); @@ -726,6 +729,10 @@ */ if (nfs_ip_paranoia == 0) args.flags |= NFSMNT_NOCONN; + + if (nfs_force_local_locking) + args.flags |= NFSMNT_NOLOCKD; + if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX) return (EINVAL); error = copyin((caddr_t)args.fh, (caddr_t)nfh, args.fhsize); --f0KYrhQ4vYSV2aJu-- --/3yNEOqWowh/8j+e Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBv208aUz3f+Zf+XsRAoTmAJ4zzVAuM54XJ9A+7VDxy9/yths6RACfQwMQ ZXpHlIUjRlWukvCxFqP9rGE= =FJAW -----END PGP SIGNATURE----- --/3yNEOqWowh/8j+e--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041214224620.GC965>