Re: mount retries
On Oct 2, 2009, at 5:45 PM, Tom Haynes wrote:
> Does the Linux mount client have any algorithms to retry a NFS mount?
> Or does it depend entirely on the underlying protocol.
> I.e., would TCP retry and UDP just give up?
The behavior is pretty complex.
There's a large retry loop that can try mounts in the foreground, or
automatically daemonize if the mount request isn't successful at
first. The retry loop continues as long as there are server or
network problems that prevent a definitive answer from the server from
getting back to the client. There is a retry= mount option to cut off
retrying after a certain amount of time.
If a particular NFS version or transport is requested by the user, it
will attempt to use those settings, and fail if those aren't available
on the server. For v2/v3, any parameters not specified by the user,
like port, transport, or version, are filled in with pmap queries.
The choice of transport is a little odd; if the user didn't specify a
transport, it looks like the transport that worked for the pmap query
is chosen regardless of what is registered. ie, if a TCP pmap query
fails, but the UDP pmap query worked, we go with UDP, whether or not
the NFS service is registered on UDP.
For v4, it skips the pmap query and just dives into the kernel to try
connecting with the server.
If none of these work, and the mount command hasn't gotten a definite