summaryrefslogtreecommitdiffstats
path: root/sys/rpc/clnt_dg.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/clnt_dg.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/clnt_dg.c')
-rw-r--r--sys/rpc/clnt_dg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c
index 0b49375..78f4a9a 100644
--- a/sys/rpc/clnt_dg.c
+++ b/sys/rpc/clnt_dg.c
@@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <sys/uio.h>
+#include <net/vnet.h>
+
#include <rpc/rpc.h>
#include <rpc/rpc_com.h>
@@ -197,11 +199,14 @@ clnt_dg_create(
return (NULL);
}
+ CURVNET_SET(so->so_vnet);
if (!__rpc_socket2sockinfo(so, &si)) {
rpc_createerr.cf_stat = RPC_TLIERROR;
rpc_createerr.cf_error.re_errno = 0;
+ CURVNET_RESTORE();
return (NULL);
}
+ CURVNET_RESTORE();
/*
* Find the receive and the send size
OpenPOWER on IntegriCloud