Skip to contentSkip to conversation

autofs looks up wrong path element metoo and /net question

DISCUSSION [email protected] 2 participants 4 messages Oct 24, 2005 1 message not in the archive Kernel automounter

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Ian, list.

Fedora Core 2

/usr/sbin/automount -V
Linux automount version 4.1.4

I am running automount with /usr/sbin/automount --ghost -v --debug

uname -r
2.6.7 / 2.4.31

I have "yp" autofs maps that are 2 directories deep. For eg. /projects/map1 /projects/map2 etc and then I mount different projects under them, project1 project2 etc

/projects/map1/projectA
/projects/map1/projectB

/projects/map2/projectC
/projects/map2/projectD

/projects/map3/projectE
/projects/map3/projectF

/projects/map4/projectG
/projects/map4/projectH

Sometimes on these machines, users find that their jobs are killed because they were unable to "cd" into /projects/map1/projectA for eg.

They see something similar to

irn:/projects/map1/projectA > ll
total 0

?---------  ? ? ? ?           ? dir1
?---------  ? ? ? ?           ? dir2

irn:/projects/map1/projectsA > cd dir1
dir1: No such file or directory.

If I look at the messages file at the same time, I see entries like

Oct 24 16:44:36 irn automount[2202]: attempting to mount entry /projects/map1/map2
Oct 24 16:44:36 irn automount[19851]: lookup(yp): lookup for map2 failed: No such key in map
Oct 24 16:44:36 irn automount[19851]: failed to mount /projects/map1/map2
Oct 24 16:44:36 irn automount[2189]: attempting to mount entry /projects/map2/map2
Oct 24 16:44:36 irn automount[19852]: lookup(yp): lookup for map2 failed: No such key in map
Oct 24 16:44:36 irn automount[19852]: failed to mount /projects/map2/map2
Oct 24 16:44:36 irn automount[2098]: attempting to mount entry /projects/map3/map2
Oct 24 16:44:36 irn automount[19853]: lookup(yp): lookup for map2 failed: No such key in map
Oct 24 16:44:36 irn automount[19853]: failed to mount /projects/map3/map2
Oct 24 16:44:36 irn automount[2118]: attempting to mount entry /projects/map4/map2
Oct 24 16:44:36 irn automount[19854]: lookup(yp): lookup for map2 failed: No such key in map
Oct 24 16:44:36 irn automount[19854]: failed to mount /projects/map4/map2

Right after these messages I also see

Oct 24 16:31:55 irn automount[2145]: attempting to mount entry /projects/map2/projectA
Oct 24 16:31:55 irn automount[19134]: lookup(yp): lookup for projectA
failed: No such key in map
Oct 24 16:31:56 irn automount[19134]: failed to mount /projects/map2/projectA
Oct 24 16:31:55 irn automount[2145]: attempting to mount entry /projects/map3/projectA
Oct 24 16:31:55 irn automount[19134]: lookup(yp): lookup for projectA
failed: No such key in map
Oct 24 16:31:56 irn automount[19134]: failed to mount /projects/map3/projectA
Oct 24 16:31:55 irn automount[2145]: attempting to mount entry /projects/map3/projectA
Oct 24 16:31:55 irn automount[19134]: lookup(yp): lookup for projectA
failed: No such key in map
Oct 24 16:31:56 irn automount[19134]: failed to mount /projects/map3/projectA

It will do this for all maps, but the correct map which is "map1"

The actual automount process for "map1" is running and after a few minutes/retries things come back to normal. Sometimes they dont and I need to reboot this machine/restart automount for that map.

Is something getting incorrectly parsed and being sent to automount ?

Thanks

#2 lore raw

==> Regarding [autofs] autofs looks up wrong path element metoo and /net question; [email protected] adds:

devnull> Ian, list. Fedora Core 2

devnull> /usr/sbin/automount -V Linux automount version 4.1.4

So you built your own? OK.

devnull> I am running automount with /usr/sbin/automount --ghost -v --debug

devnull> uname -r 2.6.7 / 2.4.31

Again, your own kernel? Ian posted a kernel patch to fix the issue. You probably want to grab that, though I can't find a pointer to it at the moment. I've attached the equivalent patch that went into RHEL3, for reference.

-Jeff

fs/autofs4/root.c renamed from fs/autofs4/root.c.orig +8 -1
@@ -301,7 +301,14 @@ static int try_to_fill_dentry(struct den
 
 		DPRINTK(("try_to_fill_entry: expire done status=%d\n", status));
 		
-		return 0;
+		/*
+		 * If the directory still exists the mount request must
+		 * continue otherwise it can't be followed at the right
+		 * time during the walk.
+		 */
+		status = d_invalidate(dentry);
+		if (status != -EBUSY)
+			return 0;
 	}
 
 	DPRINTK(("try_to_fill_entry: dentry=%p %.*s ino=%p\n", 
#3 lore raw

Thanks Jeff.

http://hera.kernel.org/pipermail/autofs/2005-October/002517.html

Has 2 patches. One for expire.c and one for root.c

I am assuming I need the root.c one only..?

Thanks for your help.

Quoted 35 lines · Jeff Moyer

Date: Mon, 24 Oct 2005 17:55:11 -0400
From: Jeff Moyer <[email protected]>
To: [email protected]
Cc: AutoFS on Linux Kernel <[email protected]>
Subject: Re: [autofs] autofs looks up wrong path element metoo and /net
question

==> Regarding [autofs] autofs looks up wrong path element metoo and /net question; [email protected] adds:

devnull> Ian, list. Fedora Core 2

devnull> /usr/sbin/automount -V Linux automount version 4.1.4

So you built your own? OK.

devnull> I am running automount with /usr/sbin/automount --ghost -v --debug

devnull> uname -r 2.6.7 / 2.4.31

Again, your own kernel? Ian posted a kernel patch to fix the issue. You probably want to grab that, though I can't find a pointer to it at the moment. I've attached the equivalent patch that went into RHEL3, for reference.

(quoted diff) +0 -1
-Jeff
fs/autofs4/root.c renamed from fs/autofs4/root.c.orig +1 -1
@@ -301,7 +301,14 @@ static int try_to_fill_dentry(struct den
 
 		DPRINTK(("try_to_fill_entry: expire done status=%d\n", status));
 
-		return 0;
+		/*

fs/autofs4/root.c static int try_to_fill_dentry(struct den · line 314

Quoted 10 lines
fs/autofs4/root.c renamed from fs/autofs4/root.c.orig +7 -0
+		 * If the directory still exists the mount request must
+		 * continue otherwise it can't be followed at the right
+		 * time during the walk.
+		 */
+		status = d_invalidate(dentry);
+		if (status != -EBUSY)
+			return 0;
 	}
 
 	DPRINTK(("try_to_fill_entry: dentry=%p %.*s ino=%p\n",

/dev/null

[email protected]

#4 lore raw

==> Regarding Re: [autofs] autofs looks up wrong path element metoo and /net question; [email protected] adds:

devnull> Thanks Jeff.
devnull> http://hera.kernel.org/pipermail/autofs/2005-October/002517.html

devnull> Has 2 patches. One for expire.c and one for root.c

devnull> I am assuming I need the root.c one only..?

That's actually a slightly different problem. That patch is undergoing testing right now. If you'd like to add yourself to the list of testers, then by all means apply that patch. You will want to apply the entire patch.

devnull> Thanks for your help.

np.

-Jeff

Quoted 8 lines · Jeff Moyer
Quoted 8 lines

Date: Mon, 24 Oct 2005 17:55:11 -0400 From: Jeff Moyer <[email protected]> To: [email protected] Cc: AutoFS on Linux Kernel <[email protected]> Subject: Re: [autofs] autofs looks up wrong path element metoo and /net question

==> Regarding [autofs] autofs looks up wrong path element metoo and /net question; [email protected] adds:

devnull> Ian, list. Fedora Core 2

Quoted 1 line
Quoted 1 line

devnull> /usr/sbin/automount -V Linux automount version 4.1.4

Quoted 2 lines
Quoted 2 lines

So you built your own? OK.

devnull> I am running automount with /usr/sbin/automount --ghost -v --debug

Quoted 1 line
Quoted 1 line

devnull> uname -r 2.6.7 / 2.4.31

Quoted 13 lines
Quoted 13 lines

Again, your own kernel? Ian posted a kernel patch to fix the issue. You probably want to grab that, though I can't find a pointer to it at the moment. I've attached the equivalent patch that went into RHEL3, for reference.

-Jeff

--- linux-2.4.21/fs/autofs4/root.c.orig 2005-05-31 09:31:16.097321176 -0400 +++ linux-2.4.21/fs/autofs4/root.c 2005-05-31 09:31:19.816755736 -0400 @@ -301,7 +301,14 @@ static int try_to_fill_dentry(struct den

DPRINTK(("try_to_fill_entry: expire done status=%d\n", status));

Quoted 7 lines
Quoted 7 lines

- return 0; + /* + * If the directory still exists the mount request must + * continue otherwise it can't be followed at the right + * time during the walk. + */ + status = d_invalidate(dentry); + if (status != -EBUSY) + return 0; }

DPRINTK(("try_to_fill_entry: dentry=%p %.*s ino=%p\n",

devnull> /dev/null

devnull> [email protected]