Red Hat Bugzilla – Bug 184368
autofs mount lock failure due to nfs option bg
Last modified: 2007-11-30 17:11:26 EST
Description of problem:
After trying to mount an nfs share with the following options: -soft,intr,bg,
=8192,wsize=8192,nfsvers=3 from a host that is temporarily down automount
refuses any further automounting because it can not lock its lockfile.
Mar 7 11:01:05 ws1 automount: >> mount to NFS server 'ws2' failed: server
Mar 7 11:01:05 ws1 automount: >> mount: backgrounding "ws2:/scratch"
Mar 7 11:01:46 ws1 automount: aquire_lock: can't lock lock file timed
Mar 7 11:01:46 ws1 automount: mount(nfs): nfs: mount failure ws3:/scratch
Mar 7 11:01:46 ws1 automount: failed to mount /scr/ws3
Mar 7 11:03:18 ws1 automount: aquire_lock: can't lock lock file timed
The last message is repeated serverl times.
The first mount attempt induces the failure. The second mount failes even though
the nfs export host is running.
Version-Release number of selected component (if applicable):
With the bg option to nfs mounts all the time. See the steps below.
Steps to Reproduce:
1. Setup automounter map for NFS mount like so:
ws2 -soft,intr,bg,nfsvers=3,rsize=8192,wsize=8192 ws2:/scratch
2. NFS export ws2 is a simple export:
3. Automount works without problems if NFS export host is up.
4. Shutdown NFS export host and retry the automount.
5. Mount failes with messages printed to /var/log/messages (see above).
Autmount failes due to the bg mount option and the fact that the lockfile does
not get removed when the mount process is backgrounded. In some cases, when the
mount failure was recognized soon enough, one could restart the automounter
manually removing the lock file (/var/lock/autofs). It the system stays a long
time with the automounter failing it will lock up eventually.
Just a message to /var/log/messages that the mount failed and the resume of
Specifying "bg" in the mount options for autofs is not supported. It will
result in returning to the calling process (the one that triggered the mount)
without having actually mounted the directory that was requested. This is broken.
I'm closing this as NOTABUG. I'm also going to file another bug against autofs,
requesting that the "bg" mount option be automatically ignored.
In the mean time, please fix your maps.
(In reply to comment #0)
> Description of problem:
> After trying to mount an nfs share with the following options: -soft,intr,bg,
> =8192,wsize=8192,nfsvers=3 from a host that is temporarily down automount
> refuses any further automounting because it can not lock its lockfile.
As Jeff points out the bg option is not supported for autofs and in
my opinion is not recommeneded for NFS mounts.
You will no doubt respond pointing out that if a mount blocks waiting
for a down server then no other mounts can be made.
This is a different question and there is an autofs configure option
to disable the locking for mount calls. The locking was originally
introduced because of corruption in /etc/mtab caused by a bug in
mount(8). Looking at mount(8) in FC4 I believe that it has a patch
to resolve this. The configure option is however not the default
as we have not yet been able to verify correct operation of autofs
without it's locking. Backgrounding of mounts is a specific concern.