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

Stefan Seyfried seife at suse.de
Wed May 17 12:50:35 PDT 2006


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. ;-)
-- 
Stefan Seyfried                     | "Please, just tell people
QA / R&D Team Mobile Devices        |               to use KDE."
SUSE LINUX Products GmbH, Nürnberg  |          -- Linus Torvalds


More information about the hal mailing list