In nfs_timer(), pass curthread rather than &thread0 into the protocol

send routine.  In IPv6 UDP, the thread will be passed to suser(), which
asserts that if a thread is used for a super user check, it be
curthread.  Many of these protocol entry points probably need to
accept credentials instead of threads.

MT5 candidate.

Noticed/tested by:	kuriyama
This commit is contained in:
Robert Watson 2004-08-25 01:23:38 +00:00
parent bdc3b545e8
commit 640c9dcf69
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134281

View File

@ -1139,11 +1139,9 @@ nfs_timer(void *arg)
struct nfsmount *nmp;
int timeo;
int s, error;
struct thread *td;
struct timeval now;
getmicrouptime(&now);
td = &thread0; /* XXX for credentials, may break if sleep */
s = splnet();
TAILQ_FOREACH(rep, &nfs_reqq, r_chain) {
nmp = rep->r_nmp;
@ -1206,10 +1204,10 @@ nfs_timer(void *arg)
(m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))){
if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
error = (*so->so_proto->pr_usrreqs->pru_send)
(so, 0, m, NULL, NULL, td);
(so, 0, m, NULL, NULL, curthread);
else
error = (*so->so_proto->pr_usrreqs->pru_send)
(so, 0, m, nmp->nm_nam, NULL, td);
(so, 0, m, nmp->nm_nam, NULL, curthread);
if (error) {
if (NFSIGNORE_SOERROR(nmp->nm_soflags, error))
so->so_error = 0;