All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Waychison <Michael.Waychison@Sun.COM>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: "MARX,ALEXANDER (HP-Germany,ex1)" <alexander.marx@hp.com>,
	autofs@linux.kernel.org
Subject: Re: autofs no_local_binds option (nfs <-> bind mounts)
Date: Tue, 13 Jan 2004 12:48:37 -0500	[thread overview]
Message-ID: <40042F75.9040304@sun.com> (raw)
In-Reply-To: <40042774.7070003@zytor.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1404 bytes --]

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: Michael.Waychison@Sun.COM
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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


[-- Attachment #1.1.2: nolocalbinds.patch --]
[-- Type: text/plain, Size: 919 bytes --]

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 #1.2: Type: application/pgp-signature, Size: 251 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

  reply	other threads:[~2004-01-13 17:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-13 14:26 autofs no_local_binds option (nfs <-> bind mounts) MARX,ALEXANDER (HP-Germany,ex1)
2004-01-13 17:14 ` H. Peter Anvin
2004-01-13 17:48   ` Mike Waychison [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-01-13 19:58 Eric Werme USG
2004-01-13 20:03 ` H. Peter Anvin
2004-01-13 20:23   ` Dylan
2004-01-13 20:25     ` H. Peter Anvin
2004-01-13 20:58       ` Mike Waychison
2004-01-13 21:06         ` H. Peter Anvin
2004-01-13 20:42   ` Eric Werme USG
2004-01-13 20:54     ` H. Peter Anvin
2004-01-13 21:04     ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40042F75.9040304@sun.com \
    --to=michael.waychison@sun.com \
    --cc=alexander.marx@hp.com \
    --cc=autofs@linux.kernel.org \
    --cc=hpa@zytor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.