summaryrefslogtreecommitdiffstats
path: root/sys/rpc/svc_generic.c
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2009-08-24 10:09:30 +0000
committerzec <zec@FreeBSD.org>2009-08-24 10:09:30 +0000
commit19bb42c4683c0b8129df0c1807d6980d4535679d (patch)
tree5ba9dcd2e54bc9abd1d333c3fb6c2e11842ff46f /sys/rpc/svc_generic.c
parentfb1931d971247184022a15dd9f7150669e17efe6 (diff)
downloadFreeBSD-src-19bb42c4683c0b8129df0c1807d6980d4535679d.zip
FreeBSD-src-19bb42c4683c0b8129df0c1807d6980d4535679d.tar.gz
Fix NFS panics with options VIMAGE kernels by apropriately setting curvnet
context inside the RPC code. Temporarily set td's cred to mount's cred before calling socreate() via __rpc_nconf2socket(). Submitted by: rmacklem (in part) Reviewed by: rmacklem, rwatson Discussed with: dfr, bz Approved by: re (rwatson), julian (mentor) MFC after: 3 days
Diffstat (limited to 'sys/rpc/svc_generic.c')
-rw-r--r--sys/rpc/svc_generic.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/rpc/svc_generic.c b/sys/rpc/svc_generic.c
index 38380f2..e6e8acd 100644
--- a/sys/rpc/svc_generic.c
+++ b/sys/rpc/svc_generic.c
@@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$");
#include <sys/sx.h>
#include <sys/ucred.h>
+#include <net/vnet.h>
+
#include <rpc/rpc.h>
#include <rpc/rpcb_clnt.h>
#include <rpc/nettype.h>
@@ -228,11 +230,14 @@ svc_tli_create(
/*
* It is an open socket. Get the transport info.
*/
+ CURVNET_SET(so->so_vnet);
if (!__rpc_socket2sockinfo(so, &si)) {
printf(
"svc_tli_create: could not get transport information\n");
+ CURVNET_RESTORE();
return (NULL);
}
+ CURVNET_RESTORE();
}
/*
@@ -259,7 +264,9 @@ svc_tli_create(
"svc_tli_create: could not bind to requested address\n");
goto freedata;
}
+ CURVNET_SET(so->so_vnet);
solisten(so, (int)bindaddr->qlen, curthread);
+ CURVNET_RESTORE();
}
}
OpenPOWER on IntegriCloud