Re: using connected UDP socket to contact to portmapper?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2012-06-07 at 22:52 +0400, Michael Tokarev wrote:
> On 07.06.2012 07:11, Ian Kent wrote:
> > On Wed, 2012-06-06 at 11:44 +0400, Michael Tokarev wrote:
> []
> > It's not quite that simple for the case below.
> > 
> > Exactly what your asking and what your trying to solve is not clear.
> 
> Please take a look at the $SUBJECT.
> 
> > Above you quote what looks like a simple indirect map mount request but
> > below you're talking about the internal hosts map (I think) which is a
> > completely different story.
> 
> I was talking about indirect NFS map, which, even when specifying
> -fstype=nfs4, still tries to contact the portmapper to determine
> port number (unless port= option is given), and I demonstrated how
> it does that and where it sleeps.  Using connected UDP sockets will
> eliminate this delay if the portmapper UDP port is not firewalled.

I owe you an apology.

There is in fact a mistake in the code which checks availability. You
are correct, autofs was trying to contact the portmapper even, when
fstype=nfs4 is specified.

Here is a patch which shows were the mistake was.

autofs-5.0.6 - fix nfs4 contacts portmap

From: Ian Kent <ikent@xxxxxxxxxx>

When an fstype of nfs4 is specified probing the server for availability
should not need to contact the portmapper, it should use either the port
specified by the port= option or use port 2049.

However, in function modules/replicated.c:get_nfs_info() a check for the
port= option, and subsequent portmap lookup when not it's not present, is
done before the check for whether nfsv3 is to be checked at all.

Oops!
---

 CHANGELOG            |    1 +
 modules/replicated.c |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/CHANGELOG b/CHANGELOG
index c1f1465..a944750 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -54,6 +54,7 @@
 - fix libtirpc name clash.
 - fix remount deadlock.
 - fix umount recovery of busy direct mount.
+- fix nfs4 contacts portmap.
 
 28/06/2011 autofs-5.0.6
 -----------------------
diff --git a/modules/replicated.c b/modules/replicated.c
index 10e1429..09350c5 100644
--- a/modules/replicated.c
+++ b/modules/replicated.c
@@ -589,6 +589,9 @@ static unsigned int get_nfs_info(unsigned logopt, struct host *host,
 	}
 
 v3_ver:
+	if (!(version & NFS3_REQUESTED))
+		goto v2_ver;
+
 	if (!have_port_opt) {
 		status = rpc_portmap_getclient(pm_info,
 				host->name, host->addr, host->addr_len,
@@ -600,9 +603,6 @@ v3_ver:
 			goto done_ver;
 	}
 
-	if (!(version & NFS3_REQUESTED))
-		goto v2_ver;
-
 	if (have_port_opt) {
 		if (!(rpc_info->port = get_port_option(options)))
 			goto done_ver;


--
To unsubscribe from this list: send the line "unsubscribe autofs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux