cred: add more asserts for td_realucred == td_ucred

This commit is contained in:
Mateusz Guzik 2020-08-01 16:02:32 +00:00
parent acdc915461
commit 936c24faba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363767
2 changed files with 4 additions and 1 deletions

View File

@ -1881,7 +1881,8 @@ crunuse(struct thread *td)
{
struct ucred *cr, *crold;
cr = td->td_ucred;
MPASS(td->td_realucred == td->td_ucred);
cr = td->td_realucred;
mtx_lock(&cr->cr_mtx);
cr->cr_ref += td->td_ucredref;
td->td_ucredref = 0;
@ -1897,6 +1898,7 @@ crunuse(struct thread *td)
crold = NULL;
}
mtx_unlock(&cr->cr_mtx);
td->td_realucred = NULL;
return (crold);
}

View File

@ -543,6 +543,7 @@ thread_exit(void)
(long)p->p_pid, td->td_name);
SDT_PROBE0(proc, , , lwp__exit);
KASSERT(TAILQ_EMPTY(&td->td_sigqueue.sq_list), ("signal pending"));
MPASS(td->td_realucred == td->td_ucred);
/*
* drop FPU & debug register state storage, or any other