H. Peter Anvin wrote:

MARX,ALEXANDER (HP-Germany,ex1) wrote:


In some scenarios (e.g. HA), the nfs server could switch from local to remote, therefore having local binds is not a desirable scenario, there should always be nfs mounts.


How would you expect this to work? The local bind only happens when local and destination address are the same, therefore keeping anything from going across the network no matter how you slice it.

This is policy made by the daemon that IMHO may be trying to be too smart about what the user wants. I've attached a quick patch, compiled not tested that shows how you can add a no_local_binds option to entries (written against 4.0.0pre10 because that's what I have on my laptop atm).

Doing local binds may not be the right thing to do in the first place. It makes assumptions that the local nfs server is serving the same namespace/filesystems as the current application and it will break NFS v4 replication and migration when it's ready.

--
Mike Waychison
Sun Microsystems, Inc.
1 (650) 352-5299 voice
1 (416) 202-8336 voice
mailto: [EMAIL PROTECTED]
http://www.sun.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: The opinions expressed in this email are held by me, and may not represent the views of Sun Microsystems, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

diff -ru orig/modules/mount_nfs.c autofs-4.0.0pre10/modules/mount_nfs.c
--- orig/modules/mount_nfs.c    2004-01-13 09:29:27.000000000 -0800
+++ autofs-4.0.0pre10/modules/mount_nfs.c       2004-01-13 09:30:06.000000000 -0800
@@ -73,6 +73,7 @@
   struct sockaddr_in saddr, laddr;
   int sock, local, err;
   int nosymlink = 0;
+  int nolocalbinds = 0;
   size_t len;
 
   syslog(LOG_DEBUG, MODPREFIX " root=%s name=%s what=%s, fstype=%s, options=%s",
@@ -113,6 +114,8 @@
 #endif
       if (strncmp("nosymlink", cp, comma-cp-1) == 0)
        nosymlink = 1;
+      if (strncmp("no_local_binds", cp, comma-cp-1) == 0)
+       nolocalbinds = 1;
       else {
        memcpy(nfsp, cp, comma-cp+1);
        nfsp += comma-cp+1;
@@ -205,7 +208,7 @@
   }
   sprintf(fullpath, "%s/%s", root, name);
   
-  if ( local ) {
+  if ( local && !nolocalbinds ) {
     /* Local host -- do a "bind" */
   
     syslog(LOG_DEBUG, MODPREFIX "%s is local, doing bind", name);

Attachment: pgp00000.pgp
Description: PGP signature

_______________________________________________
autofs mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to