Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jul 2018 17:32:45 +0100
From:      Dave Hines <freebsd@dph.fluff.org>
To:        freebsd-questions@freebsd.org
Subject:   make startup delay in automounted NFS filesystem
Message-ID:  <20180703163245.GA26440@dph.fluff.org>

next in thread | raw e-mail | index | archive | help
I was using make in FreeBSD 11.2-RELEASE #0 r335510 to build a small
project, and noticed make pausing for almost 3 seconds every time it
started. Using truss I found that make was trying to find
".../share/mk" by searching up the filesystem from the current
directory, an extract of the truss output being:

stat("/net/192.168.31.252/mnt/z/home/dh/dph/src/login/share/mk",0x7fffffffd348) ERR#2 'No such file or directory'
stat("/net/192.168.31.252/mnt/z/home/dh/dph/src/share/mk",0x7fffffffd348) ERR#2 'No such file or directory'
stat("/net/192.168.31.252/mnt/z/home/dh/dph/share/mk",0x7fffffffd348) ERR#2 'No such file or directory'
stat("/net/192.168.31.252/mnt/z/home/dh/share/mk",0x7fffffffd348) ERR#2 'No such file or directory'
stat("/net/192.168.31.252/mnt/z/home/share/mk",0x7fffffffd348) ERR#2 'No such file or directory'
stat("/net/192.168.31.252/mnt/z/share/mk",0x7fffffffd348) ERR#2 'No such file or directory'
stat("/net/192.168.31.252/mnt/share/mk",0x7fffffffd348) ERR#2 'No such file or directory'
stat("/net/192.168.31.252/share/mk",0x7fffffffd348) ERR#2 'No such file or directory'

 [ pause for almost 3 seconds here ]

stat("/net/share/mk",0x7fffffffd348)             ERR#5 'Input/output error'
stat("/share/mk",0x7fffffffd348)                 ERR#2 'No such file or directory'
open("/usr/share/mk",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,057) = 3 (0x3)

I am using the automounter to NFS mount /mnt/z/home from a host on a
local ethernet with the address 192.168.31.252.

The delay appears to be caused by the attempt to lookup /net/share/mk,
which the automounter will see as looking for /mk on host share. As
there is no such host the mount attempt fails after a few seconds.

As a work-around, I created a symbolic link on the fileserver:

    ln -s /usr/share /net/192.168.31.252/mnt/z/home/dh/share

and confirmed that this eliminated the delay. I don't like this, as it
is an absolute link on the fileserver, pointing to a local directory
on this host. From other hosts the link will be invalid. Is there a
better way of avoiding this delay ?

Should make use a different search strategy, or perhaps be aware of
the automounter when searching for share/mk ?

Regards -- Dave Hines.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180703163245.GA26440>