summaryrefslogtreecommitdiffstats
path: root/sys/rpc/clnt_vc.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_vc.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_vc.c')
-rw-r--r--sys/rpc/clnt_vc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c
index 3f15c43..85e89ab 100644
--- a/sys/rpc/clnt_vc.c
+++ b/sys/rpc/clnt_vc.c
@@ -70,6 +70,9 @@ __FBSDID("$FreeBSD$");
#include <sys/syslog.h>
#include <sys/time.h>
#include <sys/uio.h>
+
+#include <net/vnet.h>
+
#include <netinet/tcp.h>
#include <rpc/rpc.h>
@@ -217,8 +220,11 @@ clnt_vc_create(
}
}
- if (!__rpc_socket2sockinfo(so, &si))
+ CURVNET_SET(so->so_vnet);
+ if (!__rpc_socket2sockinfo(so, &si)) {
+ CURVNET_RESTORE();
goto err;
+ }
if (so->so_proto->pr_flags & PR_CONNREQUIRED) {
bzero(&sopt, sizeof(sopt));
@@ -239,6 +245,7 @@ clnt_vc_create(
sopt.sopt_valsize = sizeof(one);
sosetopt(so, &sopt);
}
+ CURVNET_RESTORE();
ct->ct_closeit = FALSE;
OpenPOWER on IntegriCloud