aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient/nfs_vfsops.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2011-02-16 21:29:13 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2011-02-16 21:29:13 +0000
commit1fb51a12f24a4d5ffd7d105589ed8e002ad67320 (patch)
treee312f60d853b2306ae67fe2988280d1dbc41c9cf /sys/nfsclient/nfs_vfsops.c
parent55a8000cd732746b04e6d31ea1250cf5df13c99c (diff)
downloadsrc-1fb51a12f24a4d5ffd7d105589ed8e002ad67320.tar.gz
src-1fb51a12f24a4d5ffd7d105589ed8e002ad67320.zip
Mfp4 CH=177274,177280,177284-177285,177297,177324-177325
VNET socket push back: try to minimize the number of places where we have to switch vnets and narrow down the time we stay switched. Add assertions to the socket code to catch possibly unset vnets as seen in r204147. While this reduces the number of vnet recursion in some places like NFS, POSIX local sockets and some netgraph, .. recursions are impossible to fix. The current expectations are documented at the beginning of uipc_socket.c along with the other information there. Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH Reviewed by: jhb Tested by: zec Tested by: Mikolaj Golub (to.my.trociny gmail.com) MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=218757
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r--sys/nfsclient/nfs_vfsops.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index fc54ff69df0f..3700708a28f5 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -428,7 +428,6 @@ nfs_mountroot(struct mount *mp)
char buf[128];
char *cp;
- CURVNET_SET(TD_TO_VNET(td));
#if defined(BOOTP_NFSROOT) && defined(BOOTP)
bootpc_init(); /* use bootp to get nfs_diskless filled in */
@@ -437,7 +436,6 @@ nfs_mountroot(struct mount *mp)
#endif
if (nfs_diskless_valid == 0) {
- CURVNET_RESTORE();
return (-1);
}
if (nfs_diskless_valid == 1)
@@ -504,10 +502,12 @@ nfs_mountroot(struct mount *mp)
sin.sin_family = AF_INET;
sin.sin_len = sizeof(sin);
/* XXX MRT use table 0 for this sort of thing */
+ CURVNET_SET(TD_TO_VNET(td));
error = rtrequest(RTM_ADD, (struct sockaddr *)&sin,
(struct sockaddr *)&nd->mygateway,
(struct sockaddr *)&mask,
RTF_UP | RTF_GATEWAY, NULL);
+ CURVNET_RESTORE();
if (error)
panic("nfs_mountroot: RTM_ADD: %d", error);
}
@@ -525,7 +525,6 @@ nfs_mountroot(struct mount *mp)
nd->root_args.hostname = buf;
if ((error = nfs_mountdiskless(buf,
&nd->root_saddr, &nd->root_args, td, &vp, mp)) != 0) {
- CURVNET_RESTORE();
return (error);
}
@@ -539,7 +538,6 @@ nfs_mountroot(struct mount *mp)
sizeof (prison0.pr_hostname));
mtx_unlock(&prison0.pr_mtx);
inittodr(ntohl(nd->root_time));
- CURVNET_RESTORE();
return (0);
}