diff options
author | zec <zec@FreeBSD.org> | 2009-08-24 10:09:30 +0000 |
---|---|---|
committer | zec <zec@FreeBSD.org> | 2009-08-24 10:09:30 +0000 |
commit | 19bb42c4683c0b8129df0c1807d6980d4535679d (patch) | |
tree | 5ba9dcd2e54bc9abd1d333c3fb6c2e11842ff46f /sys/rpc/clnt_rc.c | |
parent | fb1931d971247184022a15dd9f7150669e17efe6 (diff) | |
download | FreeBSD-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_rc.c')
-rw-r--r-- | sys/rpc/clnt_rc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c index 217608c..24fc09a 100644 --- a/sys/rpc/clnt_rc.c +++ b/sys/rpc/clnt_rc.c @@ -175,15 +175,16 @@ clnt_reconnect_connect(CLIENT *cl) rc->rc_connecting = TRUE; mtx_unlock(&rc->rc_lock); + oldcred = td->td_ucred; + td->td_ucred = rc->rc_ucred; so = __rpc_nconf2socket(rc->rc_nconf); if (!so) { stat = rpc_createerr.cf_stat = RPC_TLIERROR; rpc_createerr.cf_error.re_errno = 0; + td->td_ucred = oldcred; goto out; } - oldcred = td->td_ucred; - td->td_ucred = rc->rc_ucred; if (rc->rc_privport) bindresvport(so, NULL); |