Bug 184368 - autofs mount lock failure due to nfs option bg
autofs mount lock failure due to nfs option bg
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: autofs (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeffrey Moyer
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-08 04:52 EST by Richard Neuboeck
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-08 08:31:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Richard Neuboeck 2006-03-08 04:52:34 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.

/var/log/messages
Mar  7 11:01:05 ws1 automount[6035]: >> mount to NFS server 'ws2' failed: server
is down.
Mar  7 11:01:05 ws1 automount[6035]: >> mount: backgrounding "ws2:/scratch"
Mar  7 11:01:46 ws1 automount[6046]: aquire_lock: can't lock lock file timed
out: /var/lock/autofs
Mar  7 11:01:46 ws1 automount[6046]: mount(nfs): nfs: mount failure ws3:/scratch
on /scr/ws3
Mar  7 11:01:46 ws1 automount[6046]: failed to mount /scr/ws3
Mar  7 11:03:18 ws1 automount[6097]: aquire_lock: can't lock lock file timed
out: /var/lock/autofs

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):

autofs-4.1.4-15.1

How reproducible:

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:
/etc/auto.master
/scr            auto.scr

/etc/auto.scr
ws2  -soft,intr,bg,nfsvers=3,rsize=8192,wsize=8192  ws2:/scratch

2. NFS export ws2 is a simple export:
/etc/exports
/scratch  @unix(rw,async)

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).
  
Actual results:

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.

Expected results:

Just a message to /var/log/messages that the mount failed and the resume of
normal operation.

Additional info:
Comment 1 Jeffrey Moyer 2006-03-08 08:31:02 EST
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.
Comment 2 Ian Kent 2006-03-09 00:52:10 EST
(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.

Note You need to log in before you can comment on or make changes to this bug.