[PATCH] do not stat autofs mounts(was Re: hall and autofs)

John (J5) Palmieri johnp at redhat.com
Wed May 17 14:52:55 PDT 2006


Take 2.  I had an error iterating the autofs_mount list. 
s/autofs_node = autofs_mount->next/autofs_node = autofs_node->next

On Wed, 2006-05-17 at 17:47 -0400, John (J5) Palmieri wrote:
> How is this patch?  I now keep a list of autofs mounts encountered
> in /proc/mounts.  When we go to check for .created-by-hal files I first
> check to see if the mount point we are interested in starts with any of
> the autofs mounts.  If it does do not check for the .created-by-hal.  As
> I understand it stating the directory itself is not a problem but
> stating files underneath it is.
> 
> On Wed, 2006-05-17 at 21:50 +0200, Stefan Seyfried wrote:
> > On Wed, May 17, 2006 at 02:59:34PM -0400, John (J5) Palmieri wrote:
> > > Here is a patch to ignore autofs mounts when stating.  I basically just
> > > added a || strcmp (fstype, "autofs") == 0 to the nfs patch.  It is built
> > > in Fedora Rawhide and seems to work.
> > 
> > Well, it does not hurt, but it will for sure not help.
> > Accessing an autofs mount point does - nothing.
> > Accessing the directory _below_ the autofs mount point triggers the mount or
> > renews the timeout.
> > The directory below the mount point has the fs type of its filesystem.
> > 
> > Do this to test:
> > /etc/auto.master:
> > ####################################
> > /test	/etc/auto.test
> > ############################
> > /etc/auto.test:
> > cd	-fstype=auto	:/dev/hdc
> > # use your CD device
> > 
> > now start the automounter, access /test/cd (with a cd in the drive).
> > /proc/mounts:
> > automount(pid30397) /test autofs rw 0 0
> > /dev/hdc /test/cd iso9660 ro 0 0
> > 
> > if you now stat /test/cd from HAL every few seconds, it will never expire.
> > 
> > To fix this, you need to collect a list of all autofs mountpoints and skip
> > everything below them.
> > 
> > > +		 * If this is an autofs mount (fstype == 'autofs') ignore the mount. Reason:
> > > +		 *  1. stats on mounts managed by autofs will cause the mount
> > > +		 *     point to be remounted during an unmount
> > 
> > well, but you do not catch the mount point with this check...
> > 
> > > -		if (strcmp(mnt.mnt_type, "nfs") == 0)
> > > +		if (strcmp(mnt.mnt_type, "nfs") == 0 ||
> > > +		    strcmp(mnt.mnt_type, "autofs") == 0)
> > >  			continue;
> > 
> > does not hurt, but i'd bet that it also does not help. ;-)
> _______________________________________________
> hal mailing list
> hal at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/hal
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-donot-check-created-by-hal-on-autofs-mounts-2.patch
Type: text/x-patch
Size: 2495 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20060517/14ff1618/hal-donot-check-created-by-hal-on-autofs-mounts-2.bin


More information about the hal mailing list