Skip to contentSkip to conversation

handle_packet_missing called with wrong path

DISCUSSION Jeff Moyer 2 participants 6 messages May 23, 2005 – May 29, 2005 Kernel automounter

lore
Share & tools
lore

Jeff Moyer

author
#0 lore raw

Hi, Ian, list,

I have a user reporting a problem with autofs whereby his automounts fail for a period of time, and then start to work again. The map looks like this:

soldyn2 -rsize=8192,wsize=8192  alexandria:/export/soldyn2
clouds2 -rsize=8192,wsize=8192  alexandria:/export/clouds2
waves2 -rsize=8192,wsize=8192   alexandria:/export/waves2
sw1 -rsize=8192,wsize=8192      alexandria:/export/data1
radar3 -rsize=8192,wsize=8192   alexandria:/export/radar3

bigmeadow -rsize=8192,wsize=8192 alexandria:/export/bigmeadow

And here is a debug log trace that shows, when the problem occurs, that the kernel passes on a missing packet with relative path of radar3/saber:

automount[3488]: handle_packet: type = 0
automount[3488]: handle_packet_missing: token 250, name radar3/saber automount[3488]: attempting to mount entry /data/radar3/saber automount[14482]: lookup(yp): looking up radar3/saber automount[14482]: ret = 8
automount[14482]: failed to mount /data/radar3/saber automount[14482]: umount_multi: path=/data/radar3/saber incl=1

Then, when things work, the logs look like so:

automount[3488]: handle_packet: type = 0
automount[3488]: handle_packet_missing: token 251, name radar3
automount[3488]: attempting to mount entry /data/radar3
automount[14504]: lookup(yp): looking up radar3
automount[14504]: ret = 1
automount[14504]: lookup(yp): radar3 -> -rsize=8192,wsize=8192 alexandria:/export/radar3
automount[14504]: parse(sun): expanded entry: -rsize=8192,wsize=8192 alexandria:/export/radar3
automount[14504]: parse(sun): dequote("rsize=8192,wsize=8192") -> rsize=8192,wsize=8192
automount[14504]: parse(sun): gathered options: intr,,rsize=8192,wsize=8192
automount[14504]: parse(sun): dequote("alexandria:/export/radar3") -> alexandria:/export/radar3
automount[14504]: parse(sun): core of entry: options=intr,,rsize=8192,wsize=8192, loc=alexandria:/export/radar3 automount[14504]: parse(sun): mounting root /data, mountpoint radar3, what alexandria:/export/radar3, fstype nfs, options intr,rsize=8192,wsize=8192 automount[14504]: mount(nfs): root=/data name=radar3 what=alexandria:/export/radar3, fstype=nfs, options=intr,rsize=8192,wsize=8192 automount[14504]: mount(nfs): nfs options="intr,rsize=8192,wsize=8192", nosymlink=0
automount[14504]: mount(nfs): is_local_mount: alexandria:/export/radar3
automount[14504]: mount(nfs): from alexandria:/export/radar3 elected alexandria:/export/radar3
automount[14504]: mount(nfs): calling mkdir_path /data/radar3
automount[14504]: mount(nfs): calling mount -t nfs -s -o intr,rsize=8192,wsize=8192 alexandria:/export/radar3 /data/radar3
kernel: SELinux: initialized (dev 0:19, type nfs), uses genfs_contexts
automount[14504]: mount(nfs): mounted alexandria:/export/radar3 on /data/radar3

Ian, any ideas on this? The user was even kind enough to attach a reproducer (though I believe it takes a good deal of run-time to trigger the problem):

#!/usr/bin/perl
while (1) {
open(IN,"< /data/radar3/saber/SABER_SPECTRA_2002_090_130M.DAT") or print date . ": Failed to open\n"; close(IN);
sleep(70);
}

The version of the automounter is autofs-4.1.4-8, and the kernel is FC3's latest, which is based off of 2.6.11.10, with the addition of the expiry race patch.

Here is some additional information from the user that may be useful:

We automount NFS directories in /data from various NFS servers using NFSv4. It appears that since adding NFSv4 capability (to /etc/exports) to the servers, this is much less reliable. All machines are up to date FC3.

There are no mount requests in the server logs during the problem period.

Any help on this would be greatly appreciated.

Thanks!

Jeff

#1 lore raw
Quoted 15 lines · Jeff Moyer

Hi, Ian, list,

I have a user reporting a problem with autofs whereby his automounts fail for a period of time, and then start to work again. The map looks like this:

soldyn2 -rsize=8192,wsize=8192  alexandria:/export/soldyn2
clouds2 -rsize=8192,wsize=8192  alexandria:/export/clouds2
waves2 -rsize=8192,wsize=8192   alexandria:/export/waves2
sw1 -rsize=8192,wsize=8192      alexandria:/export/data1
radar3 -rsize=8192,wsize=8192   alexandria:/export/radar3

bigmeadow -rsize=8192,wsize=8192 alexandria:/export/bigmeadow

And here is a debug log trace that shows, when the problem occurs, that the kernel passes on a missing packet with relative path of radar3/saber:

Quoted 7 lines

automount[3488]: handle_packet: type = 0
automount[3488]: handle_packet_missing: token 250, name radar3/saber automount[3488]: attempting to mount entry /data/radar3/saber automount[14482]: lookup(yp): looking up radar3/saber automount[14482]: ret = 8
automount[14482]: failed to mount /data/radar3/saber automount[14482]: umount_multi: path=/data/radar3/saber incl=1

I wish I new what caused this.
I thought I'd sorted this out long ago but maybe it's a different problem.

This can happen if the lookup doesn't think that, for some reason, radar3 is a mountpoint during the path walk. It is probably because the subdirs list for the radar3 dentry is not empty when it should be. Oddly enough this might not be due to directory create and removal. It might be that a dentry from a path lookup hasn't been cleaned up for some reason. Quite difficult to diagnose.

I would really like to see a log of the debug output from the kernel module. Rather a lot of output unfortuneatly.

Quoted 35 lines

Then, when things work, the logs look like so:

automount[3488]: handle_packet: type = 0
automount[3488]: handle_packet_missing: token 251, name radar3
automount[3488]: attempting to mount entry /data/radar3
automount[14504]: lookup(yp): looking up radar3
automount[14504]: ret = 1
automount[14504]: lookup(yp): radar3 -> -rsize=8192,wsize=8192 alexandria:/export/radar3
automount[14504]: parse(sun): expanded entry: -rsize=8192,wsize=8192 alexandria:/export/radar3
automount[14504]: parse(sun): dequote("rsize=8192,wsize=8192") -> rsize=8192,wsize=8192
automount[14504]: parse(sun): gathered options: intr,,rsize=8192,wsize=8192
automount[14504]: parse(sun): dequote("alexandria:/export/radar3") -> alexandria:/export/radar3
automount[14504]: parse(sun): core of entry: options=intr,,rsize=8192,wsize=8192, loc=alexandria:/export/radar3 automount[14504]: parse(sun): mounting root /data, mountpoint radar3, what alexandria:/export/radar3, fstype nfs, options intr,rsize=8192,wsize=8192 automount[14504]: mount(nfs): root=/data name=radar3 what=alexandria:/export/radar3, fstype=nfs, options=intr,rsize=8192,wsize=8192 automount[14504]: mount(nfs): nfs options="intr,rsize=8192,wsize=8192", nosymlink=0
automount[14504]: mount(nfs): is_local_mount: alexandria:/export/radar3
automount[14504]: mount(nfs): from alexandria:/export/radar3 elected alexandria:/export/radar3
automount[14504]: mount(nfs): calling mkdir_path /data/radar3
automount[14504]: mount(nfs): calling mount -t nfs -s -o intr,rsize=8192,wsize=8192 alexandria:/export/radar3 /data/radar3
kernel: SELinux: initialized (dev 0:19, type nfs), uses genfs_contexts
automount[14504]: mount(nfs): mounted alexandria:/export/radar3 on /data/radar3

Ian, any ideas on this? The user was even kind enough to attach a reproducer (though I believe it takes a good deal of run-time to trigger the problem):

#!/usr/bin/perl
while (1) {
open(IN,"< /data/radar3/saber/SABER_SPECTRA_2002_090_130M.DAT") or print date . ": Failed to open\n"; close(IN);
sleep(70);
}

Quoted 3 lines

The version of the automounter is autofs-4.1.4-8, and the kernel is FC3's latest, which is based off of 2.6.11.10, with the addition of the expiry race patch.

I can't see how the expiry race patch could cause this but I'll keep it in mind when I'm looking.

Quoted 6 lines

Here is some additional information from the user that may be useful:

We automount NFS directories in /data from various NFS servers using NFSv4. It appears that since adding NFSv4 capability (to /etc/exports) to the servers, this is much less reliable. All machines are up to date FC3.

Interesting. I wonder if/how NFS might affect this.

Ian

author
#2 lore raw

==> Regarding Re: [autofs] handle_packet_missing called with wrong path; [email protected] adds:

Quoted 17 lines · Jeff Moyer
Quoted 17 lines

Hi, Ian, list,

I have a user reporting a problem with autofs whereby his automounts fail for a period of time, and then start to work again. The map looks like this:

soldyn2 -rsize=8192,wsize=8192 alexandria:/export/soldyn2 clouds2

(quoted diff) +0 -5
-rsize=8192,wsize=8192 alexandria:/export/clouds2 waves2
-rsize=8192,wsize=8192 alexandria:/export/waves2 sw1
-rsize=8192,wsize=8192 alexandria:/export/data1 radar3
-rsize=8192,wsize=8192 alexandria:/export/radar3 bigmeadow
-rsize=8192,wsize=8192 alexandria:/export/bigmeadow

And here is a debug log trace that shows, when the problem occurs, that the kernel passes on a missing packet with relative path of radar3/saber:

Quoted 6 lines
Quoted 6 lines

automount[3488]: handle_packet: type = 0 automount[3488]:
handle_packet_missing: token 250, name radar3/saber automount[3488]:
attempting to mount entry /data/radar3/saber automount[14482]:
lookup(yp): looking up radar3/saber automount[14482]: ret = 8 automount[14482]: failed to mount /data/radar3/saber automount[14482]:
umount_multi: path=/data/radar3/saber incl=1

raven> I wish I new what caused this. I thought I'd sorted this out long raven> ago but maybe it's a different problem.

raven> This can happen if the lookup doesn't think that, for some reason, raven> radar3 is a mountpoint during the path walk. It is probably because raven> the subdirs list for the radar3 dentry is not empty when it should raven> be. Oddly enough this might not be due to directory create and raven> removal. It might be that a dentry from a path lookup hasn't been raven> cleaned up for some reason. Quite difficult to diagnose.

raven> I would really like to see a log of the debug output from the kernel raven> module. Rather a lot of output unfortuneatly.

Quoted 34 lines
Quoted 34 lines

Then, when things work, the logs look like so:

automount[3488]: handle_packet: type = 0 automount[3488]:
handle_packet_missing: token 251, name radar3 automount[3488]:
attempting to mount entry /data/radar3 automount[14504]: lookup(yp):
looking up radar3 automount[14504]: ret = 1 automount[14504]:
lookup(yp): radar3 -> -rsize=8192,wsize=8192 alexandria:/export/radar3 automount[14504]: parse(sun): expanded entry: -rsize=8192,wsize=8192 alexandria:/export/radar3 automount[14504]: parse(sun):
dequote("rsize=8192,wsize=8192") -> rsize=8192,wsize=8192 automount[14504]: parse(sun): gathered options:
intr,,rsize=8192,wsize=8192 automount[14504]: parse(sun):
dequote("alexandria:/export/radar3") -> alexandria:/export/radar3 automount[14504]: parse(sun): core of entry:
options=intr,,rsize=8192,wsize=8192, loc=alexandria:/export/radar3 automount[14504]: parse(sun): mounting root /data, mountpoint radar3, what alexandria:/export/radar3, fstype nfs, options intr,rsize=8192,wsize=8192 automount[14504]: mount(nfs): root=/data name=radar3 what=alexandria:/export/radar3, fstype=nfs, options=intr,rsize=8192,wsize=8192 automount[14504]: mount(nfs): nfs options="intr,rsize=8192,wsize=8192", nosymlink=0 automount[14504]:
mount(nfs): is_local_mount: alexandria:/export/radar3 automount[14504]:
mount(nfs): from alexandria:/export/radar3 elected alexandria:/export/radar3 automount[14504]: mount(nfs): calling mkdir_path /data/radar3 automount[14504]: mount(nfs): calling mount -t nfs -s -o intr,rsize=8192,wsize=8192 alexandria:/export/radar3 /data/radar3 kernel: SELinux: initialized (dev 0:19, type nfs), uses genfs_contexts automount[14504]: mount(nfs): mounted alexandria:/export/radar3 on /data/radar3

Ian, any ideas on this? The user was even kind enough to attach a reproducer (though I believe it takes a good deal of run-time to trigger the problem):

Quoted 7 lines
Quoted 7 lines

#!/usr/bin/perl while (1) { open(IN,"< /data/radar3/saber/SABER_SPECTRA_2002_090_130M.DAT") or print date . ": Failed to open\n"; close(IN); sleep(70); }

The version of the automounter is autofs-4.1.4-8, and the kernel is FC3's latest, which is based off of 2.6.11.10, with the addition of the expiry race patch.

raven> I can't see how the expiry race patch could cause this but I'll keep raven> it in mind when I'm looking.

The problem has been reproduced with and without that patch applied. I should have mentioned that, sorry.

-Jeff

Quoted 6 lines
Quoted 6 lines

Here is some additional information from the user that may be useful:

We automount NFS directories in /data from various NFS servers using NFSv4. It appears that since adding NFSv4 capability (to /etc/exports) to the servers, this is much less reliable. All machines are up to date FC3.

raven> Interesting. I wonder if/how NFS might affect this.

maintainer
#3 lore raw
Quoted 4 lines · Jeff Moyer
Quoted 4 lines
Quoted 4 lines

Ian, any ideas on this? The user was even kind enough to attach a reproducer (though I believe it takes a good deal of run-time to trigger the problem):

I'll try and duplicate this at home.
I probably won't get to it for a a few days though.

I've setup an old bucket of bolts as an FC3 test machine now.

Quoted 9 lines
Quoted 8 lines
Quoted 8 lines

#!/usr/bin/perl while (1) { open(IN,"< /data/radar3/saber/SABER_SPECTRA_2002_090_130M.DAT") or print date . ": Failed to open\n"; close(IN); sleep(70); }

The version of the automounter is autofs-4.1.4-8, and the kernel is FC3's latest, which is based off of 2.6.11.10, with the addition of the expiry race patch.

Quoted 6 lines

raven> I can't see how the expiry race patch could cause this but I'll keep raven> it in mind when I'm looking.

The problem has been reproduced with and without that patch applied. I should have mentioned that, sorry.

Understood.

Ian

#4 lore raw
In reply to Jeff Moyer
Quoted 30 lines · Jeff Moyer

==> Regarding Re: [autofs] handle_packet_missing called with wrong path; [email protected] adds:

Quoted 17 lines · Jeff Moyer
Quoted 17 lines

Hi, Ian, list,

I have a user reporting a problem with autofs whereby his automounts fail for a period of time, and then start to work again. The map looks like this:

soldyn2 -rsize=8192,wsize=8192 alexandria:/export/soldyn2 clouds2

(quoted diff) +0 -5
-rsize=8192,wsize=8192 alexandria:/export/clouds2 waves2
-rsize=8192,wsize=8192 alexandria:/export/waves2 sw1
-rsize=8192,wsize=8192 alexandria:/export/data1 radar3
-rsize=8192,wsize=8192 alexandria:/export/radar3 bigmeadow
-rsize=8192,wsize=8192 alexandria:/export/bigmeadow

And here is a debug log trace that shows, when the problem occurs, that the kernel passes on a missing packet with relative path of radar3/saber:

Quoted 6 lines
Quoted 6 lines

automount[3488]: handle_packet: type = 0 automount[3488]:
handle_packet_missing: token 250, name radar3/saber automount[3488]:
attempting to mount entry /data/radar3/saber automount[14482]:
lookup(yp): looking up radar3/saber automount[14482]: ret = 8 automount[14482]: failed to mount /data/radar3/saber automount[14482]:
umount_multi: path=/data/radar3/saber incl=1

raven> I wish I new what caused this. I thought I'd sorted this out long raven> ago but maybe it's a different problem.

Quoted 7 lines

raven> This can happen if the lookup doesn't think that, for some reason, raven> radar3 is a mountpoint during the path walk. It is probably because raven> the subdirs list for the radar3 dentry is not empty when it should raven> be. Oddly enough this might not be due to directory create and raven> removal. It might be that a dentry from a path lookup hasn't been raven> cleaned up for some reason. Quite difficult to diagnose.

Found it.

This happens for browsable maps that request a mount at the same time as an expire is happening. My understanding of the lookup was slightly incorrect in that, when the directory exists the revalidate succeeds when it should fail, in order to ensure that lookup is called. Instead lookup is called on the next path component which should be whithin the mount. Unfortuneately, the parent isn't mounted.

This patch seems to fix the problem.

fs/autofs4/root.c +8 -1
diff -Nurp linux-2.6.12-rc5-mm1.orig/fs/autofs4/root.c linux-2.6.12-rc5-mm1/fs/autofs4/root.c
@@ -306,7 +306,14 @@ static int try_to_fill_dentry(struct den
 
 		DPRINTK("expire done status=%d", 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("dentry=%p %.*s ino=%p",
#5 lore raw
Quoted 68 lines · On Sun, 29 May 2005 [email protected] wrote:
Quoted 33 lines · Jeff Moyer

==> Regarding Re: [autofs] handle_packet_missing called with wrong path; ==> [email protected] adds:

Quoted 19 lines · Jeff Moyer
Quoted 19 lines

Hi, Ian, list,

I have a user reporting a problem with autofs whereby his automounts fail for a period of time, and then start to work again. The map looks
like this:

soldyn2 -rsize=8192,wsize=8192 alexandria:/export/soldyn2 clouds2 -rsize=8192,wsize=8192 alexandria:/export/clouds2 waves2 -rsize=8192,wsize=8192 alexandria:/export/waves2 sw1 -rsize=8192,wsize=8192 alexandria:/export/data1 radar3 -rsize=8192,wsize=8192 alexandria:/export/radar3 bigmeadow -rsize=8192,wsize=8192 alexandria:/export/bigmeadow

And here is a debug log trace that shows, when the problem occurs, that
the kernel passes on a missing packet with relative path of radar3/saber:

Quoted 6 lines
Quoted 6 lines

automount[3488]: handle_packet: type = 0 automount[3488]:
handle_packet_missing: token 250, name radar3/saber automount[3488]:
attempting to mount entry /data/radar3/saber automount[14482]:
lookup(yp): looking up radar3/saber automount[14482]: ret = 8 automount[14482]: failed to mount /data/radar3/saber automount[14482]:
umount_multi: path=/data/radar3/saber incl=1

raven> I wish I new what caused this. I thought I'd sorted this out long raven> ago but maybe it's a different problem.

Quoted 7 lines
raven>  This can happen if the lookup doesn't think that, for some reason,
raven>  radar3 is a mountpoint during the path walk. It is probably because
raven>  the subdirs list for the radar3 dentry is not empty when it should
raven>  be. Oddly enough this might not be due to directory create and
raven>  removal. It might be that a dentry from a path lookup hasn't been
raven>  cleaned up for some reason. Quite difficult to diagnose.

Found it.

This happens for browsable maps that request a mount at the same time as an expire is happening. My understanding of the lookup was slightly incorrect in that, when the directory exists the revalidate succeeds when it should fail, in order to ensure that lookup is called. Instead lookup is called on the next path component which should be whithin the mount. Unfortuneately, the parent isn't mounted.

This patch seems to fix the problem.

diff -Nurp linux-2.6.12-rc5-mm1.orig/fs/autofs4/root.c linux-2.6.12-rc5-mm1/fs/autofs4/root.c
--- linux-2.6.12-rc5-mm1.orig/fs/autofs4/root.c 2005-05-29 14:46:30.000000000
+0800
+++ linux-2.6.12-rc5-mm1/fs/autofs4/root.c 2005-05-29 14:47:04.000000000
+0800

(quoted diff) +1 -1
@@ -306,7 +306,14 @@ static int try_to_fill_dentry(struct den
 
 		DPRINTK("expire done status=%d", status);
 
-		return 0;
+		/*

Review static int try_to_fill_dentry(struct den · line 319

Quoted 10 lines
(quoted diff) +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("dentry=%p %.*s ino=%p",

Ooops again. That setting on my new version of pine is driving me crazy!

fs/autofs4/root.c +8 -1
diff -Nurp linux-2.6.12-rc5-mm1.orig/fs/autofs4/root.c linux-2.6.12-rc5-mm1/fs/autofs4/root.c
@@ -306,7 +306,14 @@ static int try_to_fill_dentry(struct den
 
  		DPRINTK("expire done status=%d", 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("dentry=%p %.*s ino=%p",