hall and autofs

Ian Kent ikent at redhat.com
Fri Apr 28 22:13:27 PDT 2006


On Fri, 2006-04-28 at 18:17 +0200, Danny Kukawka wrote:
> On Friday 28 April 2006 15:25, Ian Kent wrote:
> [...]
> > > We do something like this already on SUSE. We skip check e.g. NFS mounts
> > > because this can freeze the hole hal and applications using HAL freeze or
> > > fail, if you have NFS stale mountpoints in the system and because we
> > > never provide infos in HAL about NFS mounts (hence, we don't need to stat
> > > them).
> > >
> > > I attach the patch from SUSE against 0.5.6. If okay, I commit the patch
> > > to CVS.
> >
> > I think that's only part of the difficulty.
> >
> > It's likely needed to skip anything under a filesystem type of "autofs"
> > because within the autofs filesystem there can be cifs, NFS, bind mounts
> > or whatever. These can be nested under certain circumstances.
> >
> > I think the current reported problem is where there is an automount
> > trigger as an intermediate directory to the mount point being stat()ed.
> > In this case the kernel module will see the LOOKUP_CONTINUE flag during
> > the path walk and quite rightly mount the intervening filesystem.
> 
> What is the output of 'cat /proc/mounts' in this case? What is the listed 
> filesystem in this case? autofs or the real filesystem? IMO there is the real 
> fs listed, but not sure. Could you paste the output?

How about a debug trace from autofs as well.
I'm using autofs development version 5 here but the symptom is the same.

Sorry about the line wrap.

Initially there is one autofs mount in /proc/mounts:

automount /net autofs
rw,fd=7,pgrp=14822,timeout=60,minproto=5,maxproto=5,indirect 0 0

After "ls /net/budgie" it mounts all exports for the key (host budgie
here):

automount /net autofs
rw,fd=7,pgrp=12836,timeout=60,minproto=5,maxproto=5,indirect 0 0
automount /net/budgie/usr/local/etc autofs
rw,fd=7,pgrp=12836,timeout=60,minproto=5,maxproto=5,offset 0 0
automount /net/budgie/usr/local/lib autofs
rw,fd=7,pgrp=12836,timeout=60,minproto=5,maxproto=5,offset 0 0
automount /net/budgie/usr/local/man autofs
rw,fd=7,pgrp=12836,timeout=60,minproto=5,maxproto=5,offset 0 0
automount /net/budgie/usr/local/sbin autofs
rw,fd=7,pgrp=12836,timeout=60,minproto=5,maxproto=5,offset 0 0
automount /net/budgie/usr/local/share autofs
rw,fd=7,pgrp=12836,timeout=60,minproto=5,maxproto=5,offset 0 0
automount /net/budgie/usr/src autofs
rw,fd=7,pgrp=12836,timeout=60,minproto=5,maxproto=5,offset 0 0

When this automount expires we see this in the debug log:

Apr 29 12:58:11 raven automount[14822]: st_expire: state 1 path /net
Apr 29 12:58:11 raven automount[14822]: expire_proc: exp_proc =
1080183120 path /net
Apr 29 12:58:11 raven automount[14822]: expire_proc_indirect: mnts
0x55555567b930 ea->status 0 count 0 offsets 6
Apr 29 12:58:11 raven automount[14822]: handle_packet: type = 4
Apr 29 12:58:11 raven automount[14822]: handle_packet_expire_indirect:
token 34, name budgie
Apr 29 12:58:11 raven automount[14822]: expiring path /net/budgie
Apr 29 12:58:11 raven automount[14822]: umount_multi: path /net/budgie
incl 1
Apr 29 12:58:11 raven automount[14822]: umount_multi:
mptr->path /net/budgie/usr/local/share
Apr 29 12:58:11 raven automount[14822]: umount_multi:
mptr->path /net/budgie/usr/local/sbin
Apr 29 12:58:11 raven automount[14822]: umount_multi:
mptr->path /net/budgie/usr/local/man
Apr 29 12:58:11 raven automount[14822]: umount_multi:
mptr->path /net/budgie/usr/local/lib
Apr 29 12:58:11 raven automount[14822]: umount_multi:
mptr->path /net/budgie/usr/local/etc
Apr 29 12:58:11 raven automount[14822]: umount_multi:
mptr->path /net/budgie/usr/src
Apr 29 12:58:11 raven automount[14822]: umount_offsets: umount
offset /usr/local/etc
Apr 29 12:58:11 raven automount[14822]:
umounted /net/budgie/usr/local/etc
Apr 29 12:58:11 raven automount[14822]: umount_offsets: umount
offset /usr/local/lib
Apr 29 12:58:11 raven automount[14822]:
umounted /net/budgie/usr/local/lib
Apr 29 12:58:11 raven automount[14822]: umount_offsets: umount
offset /usr/local/man
Apr 29 12:58:11 raven automount[14822]:
umounted /net/budgie/usr/local/man
Apr 29 12:58:11 raven automount[14822]: umount_offsets: umount
offset /usr/local/sbin
Apr 29 12:58:11 raven automount[14822]:
umounted /net/budgie/usr/local/sbin
Apr 29 12:58:11 raven automount[14822]: umount_offsets: umount
offset /usr/local/share
Apr 29 12:58:11 raven automount[14822]:
umounted /net/budgie/usr/local/share
Apr 29 12:58:11 raven automount[14822]: umount_offsets: umount
offset /usr/src
Apr 29 12:58:11 raven automount[14822]: umounted /net/budgie/usr/src
Apr 29 12:58:11 raven automount[14822]: cache_delete_offset_list:
deleting offset key /net/budgie/usr/local/etc
Apr 29 12:58:11 raven automount[14822]: cache_delete_offset_list:
deleting offset key /net/budgie/usr/local/lib
Apr 29 12:58:11 raven automount[14822]: cache_delete_offset_list:
deleting offset key /net/budgie/usr/local/man
Apr 29 12:58:11 raven automount[14822]: cache_delete_offset_list:
deleting offset key /net/budgie/usr/local/sbin
Apr 29 12:58:11 raven automount[14822]: cache_delete_offset_list:
deleting offset key /net/budgie/usr/local/share
Apr 29 12:58:11 raven automount[14822]: cache_delete_offset_list:
deleting offset key /net/budgie/usr/src
Apr 29 12:58:11 raven automount[14822]: expired /net/budgie
Apr 29 12:58:11 raven automount[14822]: send_ready: token = 34
Apr 29 12:58:11 raven automount[14822]: expire_proc_indirect: mount
still busy /net
Apr 29 12:58:11 raven automount[14822]: expire_cleanup: got thid
1080183120 path /net stat 1
Apr 29 12:58:11 raven automount[14822]: expire_cleanup: sigchld: exp
1080183120 finished, switching from 2 to 1
Apr 29 12:58:11 raven automount[14822]: handle_packet: type = 3
Apr 29 12:58:11 raven automount[14822]: handle_packet_missing_indirect:
token 35, name budgie, request pid 2169
***********************************^^^^ see below.

Apr 29 12:58:11 raven automount[14822]: st_ready: st_ready(): state = 2
path /net
Apr 29 12:58:11 raven automount[14822]: attempting to mount
entry /net/budgie
Apr 29 12:58:11 raven automount[14822]: lookup_mount: lookup(program):
looking up budgie
Apr 29 12:58:11 raven automount[14822]: lookup_mount: lookup(program):
budgie -> -fstype=nfs,hard,intr,nodev,nosuid     /usr/local/etc
budgie:/usr/local/etc   /usr/local/lib
budgie:/usr/local/lib    /usr/local/man
budgie:/usr/local/man    /usr/local/sbin
budgie:/usr/local/sbin          /usr/local/share
budgie:/usr/local/share       /usr/src budgie:/usr/src
Apr 29 12:58:11 raven automount[14822]: parse_mount: parse(sun):
expanded entry: -fstype=nfs,hard,intr,nodev,nosuid     /usr/local/etc
budgie:/usr/local/etc   /usr/local/lib
budgie:/usr/local/lib    /usr/local/man
budgie:/usr/local/man    /usr/local/sbin
budgie:/usr/local/sbin          /usr/local/share
budgie:/usr/local/share       /usr/src budgie:/usr/src
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("fstype=nfs,hard,intr,nodev,nosuid") ->
fstype=nfs,hard,intr,nodev,nosuid
Apr 29 12:58:11 raven automount[14822]: parse_mount: parse(sun):
gathered options: fstype=nfs,hard,intr,nodev,nosuid
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("/usr/local/etc") -> /usr/local/etc
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("budgie:/usr/local/etc") -> budgie:/usr/local/etc
Apr 29 12:58:11 raven automount[14822]: add_offset_entry: adding
multi-mount offset /usr/local/etc -> -fstype=nfs,hard,intr,nodev,nosuid
budgie:/usr/local/etc
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("/usr/local/lib") -> /usr/local/lib
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("budgie:/usr/local/lib") -> budgie:/usr/local/lib
Apr 29 12:58:11 raven automount[14822]: add_offset_entry: adding
multi-mount offset /usr/local/lib -> -fstype=nfs,hard,intr,nodev,nosuid
budgie:/usr/local/lib
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("/usr/local/man") -> /usr/local/man
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("budgie:/usr/local/man") -> budgie:/usr/local/man
Apr 29 12:58:11 raven automount[14822]: add_offset_entry: adding
multi-mount offset /usr/local/man -> -fstype=nfs,hard,intr,nodev,nosuid
budgie:/usr/local/man
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("/usr/local/sbin") -> /usr/local/sbin
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("budgie:/usr/local/sbin") -> budgie:/usr/local/sbin
Apr 29 12:58:11 raven automount[14822]: add_offset_entry: adding
multi-mount offset /usr/local/sbin -> -fstype=nfs,hard,intr,nodev,nosuid
budgie:/usr/local/sbin
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("/usr/local/share") -> /usr/local/share
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("budgie:/usr/local/share") -> budgie:/usr/local/share
Apr 29 12:58:11 raven automount[14822]: add_offset_entry: adding
multi-mount offset /usr/local/share ->
-fstype=nfs,hard,intr,nodev,nosuid budgie:/usr/local/share
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("/usr/src") -> /usr/src
Apr 29 12:58:11 raven automount[14822]: dequote: parse(sun):
dequote("budgie:/usr/src") -> budgie:/usr/src
Apr 29 12:58:11 raven automount[14822]: add_offset_entry: adding
multi-mount offset /usr/src -> -fstype=nfs,hard,intr,nodev,nosuid
budgie:/usr/src
Apr 29 12:58:11 raven automount[14822]: mount_multi_triggers: mount
offset /net/budgie/usr/local/etc
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: calling
mount -t autofs -s  -o fd=7,pgrp=14822,minproto=5,maxproto=5,offset
automount /net/budgie/usr/local/etc
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: mounted
trigger /net/budgie/usr/local/etc
Apr 29 12:58:11 raven automount[14822]: mount_multi_triggers: mount
offset /net/budgie/usr/local/lib
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: calling
mount -t autofs -s  -o fd=7,pgrp=14822,minproto=5,maxproto=5,offset
automount /net/budgie/usr/local/lib
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: mounted
trigger /net/budgie/usr/local/lib
Apr 29 12:58:11 raven automount[14822]: mount_multi_triggers: mount
offset /net/budgie/usr/local/man
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: calling
mount -t autofs -s  -o fd=7,pgrp=14822,minproto=5,maxproto=5,offset
automount /net/budgie/usr/local/man
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: mounted
trigger /net/budgie/usr/local/man
Apr 29 12:58:11 raven automount[14822]: mount_multi_triggers: mount
offset /net/budgie/usr/local/sbin
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: calling
mount -t autofs -s  -o fd=7,pgrp=14822,minproto=5,maxproto=5,offset
automount /net/budgie/usr/local/sbin
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: mounted
trigger /net/budgie/usr/local/sbin
Apr 29 12:58:11 raven automount[14822]: mount_multi_triggers: mount
offset /net/budgie/usr/local/share
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: calling
mount -t autofs -s  -o fd=7,pgrp=14822,minproto=5,maxproto=5,offset
automount /net/budgie/usr/local/share
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: mounted
trigger /net/budgie/usr/local/share
Apr 29 12:58:11 raven automount[14822]: mount_multi_triggers: mount
offset /net/budgie/usr/src
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: calling
mount -t autofs -s  -o fd=7,pgrp=14822,minproto=5,maxproto=5,offset
automount /net/budgie/usr/src
Apr 29 12:58:11 raven automount[14822]: mount_autofs_offset: mounted
trigger /net/budgie/usr/src
Apr 29 12:58:11 raven automount[14822]: mounted /net/budgie
Apr 29 12:58:11 raven automount[14822]: send_ready: token = 35

and finally:

[raven at raven work]$ ps -ef|grep 2169
68        2169     1  0 09:47 ?        00:00:01 hald
root      2170  2169  0 09:47 ?        00:00:00 hald-runner
raven    14853  2498  0 12:58 pts/1    00:00:00 grep 2169

As you may be able to see the directory /net/budgie is an intermediate
directory wrt the mounts below, and in this case triggers the mount of
all exports from the host "budgie" in this case. In order to stat any
mounts below, NFS mounts in this case the kernel will walk the path to
the directory with the LOOKUP_CONTINUE flag set for directories above.

In order for autofs to satisfy such lookups in a sane way the
LOOKUP_CONTINUE flag must trigger mounts for intermediate directories
during the path walk.

Ian




More information about the hal mailing list