automount/mount race condition during startup

Singh (singhki@jany.gs.com)
Tue, 21 Sep 1999 18:07:37 -0400


I get the following messages starting up the automounter:

Sep 21 11:41:39 gromit automount[655]: starting automounter version 3.1.3, path = /arondb, maptype = file, mapname = /etc/autofs/db.auto
Sep 21 11:41:39 gromit automount[659]: starting automounter version 3.1.3, path = /bld, maptype = file, mapname = /etc/autofs/bld.auto
Sep 21 11:41:39 gromit automount[665]: starting automounter version 3.1.3, path = /direct, maptype = file, mapname = /etc/autofs/direct.auto
Sep 21 11:41:39 gromit automount[675]: starting automounter version 3.1.3, path = /home, maptype = file, mapname = /etc/autofs/home.auto
Sep 21 11:41:39 gromit automount[685]: starting automounter version 3.1.3, path = /net, maptype = file, mapname = /etc/autofs/net.auto
Sep 21 11:41:39 gromit automount[695]: starting automounter version 3.1.3, path = /src, maptype = file, mapname = /etc/autofs/src.auto
Sep 21 11:41:39 gromit automount[705]: starting automounter version 3.1.3, path = /sw, maptype = file, mapname = /etc/autofs/sw.auto
Sep 21 11:41:39 gromit automount[655]: using kernel protocol version 3
Sep 21 11:41:39 gromit automount[659]: >> can't create lock file /etc/mtab~~: No such file or directory (use -n flag to override)
Sep 21 11:41:39 gromit automount[659]: /bld: mount failed!
Sep 21 11:41:39 gromit automount[665]: using kernel protocol version 3
Sep 21 11:41:39 gromit automount[675]: >> can't create lock file /etc/mtab~~: No such file or directory (use -n flag to override)
Sep 21 11:41:39 gromit automount[675]: /home: mount failed!
Sep 21 11:41:39 gromit automount[685]: >> can't create lock file /etc/mtab~~: No such file or directory (use -n flag to override)
Sep 21 11:41:39 gromit automount[685]: /net: mount failed!
Sep 21 11:41:39 gromit automount[695]: >> can't create lock file /etc/mtab~~: No such file or directory (use -n flag to override)
Sep 21 11:41:39 gromit automount[695]: /src: mount failed!
Sep 21 11:41:39 gromit automount[705]: >> can't create lock file /etc/mtab~~: No such file or directory (use -n flag to override)
Sep 21 11:41:39 gromit automount[705]: /sw: mount failed!

I believe this is happening cause the following call to mount in the
automount code is not locking updates to /etc/mtab correctly:

daemon/automount.c:243: if ( spawnl(LOG_CRIT, PATH_MOUNT, PATH_MOUNT, "-t", "autofs", "-o",
options, our_name, path, NULL) ) {

This is running on a Redhat 6.0/Kernel 2.2.12-SMP/autofs-3.1.3-2/mount-2.9o-1.
The machine is a Dual CPU PIII.

My temporary fix was to stick a sleep 2 between calls to automount in
the startup script /etc/rc.d/init.d/autofs.

But it really seems like there is a nasty race condition in
mount. Has anyone else seen a similiar problem?

Thanks very much for any help!

-Kirat

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/