Instead of always hard-coding the socket type for the nfs root mount as

SOCK_DGRAM (i.e. UDP), respect the value configured earlier.  This allows
TCP NFS root mounts using e.g. the boot.nfsroot.options="tcp" tunable.

In this case some of the connection parameters like the retry timer were
previously set appropriately for TCP but inappropriately for the UDP
socket that was actually used, leading to e.g. extremely long recovery
times (O(hours)) after a nfs server reboot.

Reviewed by:    mohans
MFC After:      2 weeks
This commit is contained in:
Kris Kennaway 2007-01-30 00:26:04 +00:00
parent 51ca5b2182
commit 410355bf69
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166338

View File

@ -430,7 +430,7 @@ nfs_mountroot(struct mount *mp, struct thread *td)
* Do enough of ifconfig(8) so that the critical net interface can
* talk to the server.
*/
error = socreate(nd->myif.ifra_addr.sa_family, &so, SOCK_DGRAM, 0,
error = socreate(nd->myif.ifra_addr.sa_family, &so, nd->root_args.sotype, 0,
td->td_ucred, td);
if (error)
panic("nfs_mountroot: socreate(%04x): %d",