Retire sctp_validate_no_locks().

This routine checks that there are no locks held for an inp,
without having any lock on the inp. This breaks if the inp
goes away when it is called. This happens on stress tests
on a RPi B+.

MFC after:	3 days
This commit is contained in:
Michael Tuexen 2015-12-10 11:49:32 +00:00
parent 4eb17fd786
commit 9ee7a93696
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292060
3 changed files with 0 additions and 42 deletions

View File

@ -5641,30 +5641,6 @@ __attribute__((noinline))
}
#ifdef INVARIANTS
#ifdef __GNUC__
__attribute__((noinline))
#endif
void
sctp_validate_no_locks(struct sctp_inpcb *inp)
{
struct sctp_tcb *lstcb;
LIST_FOREACH(lstcb, &inp->sctp_asoc_list, sctp_tcblist) {
if (mtx_owned(&lstcb->tcb_mtx)) {
panic("Own lock on stcb at return from input");
}
}
if (mtx_owned(&inp->inp_create_mtx)) {
panic("Own create lock on inp");
}
if (mtx_owned(&inp->inp_mtx)) {
panic("Own inp lock on inp");
}
}
#endif
/*
* common input chunk processing (v4 and v6)
*/
@ -6048,11 +6024,6 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
SCTP_INP_DECR_REF(inp_decr);
SCTP_INP_WUNLOCK(inp_decr);
}
#ifdef INVARIANTS
if (inp != NULL) {
sctp_validate_no_locks(inp);
}
#endif
return;
}

View File

@ -13537,13 +13537,6 @@ sctp_lower_sosend(struct socket *so,
panic("Leaving with tcb send mtx owned?");
}
}
#endif
#ifdef INVARIANTS
if (inp) {
sctp_validate_no_locks(inp);
} else {
SCTP_PRINTF("Warning - inp is NULL so cant validate locks\n");
}
#endif
if (top) {
sctp_m_freem(top);

View File

@ -654,11 +654,5 @@ void
#endif
#ifdef INVARIANTS
void
sctp_validate_no_locks(struct sctp_inpcb *inp);
#endif
#endif /* _KERNEL */
#endif /* !__sctp_pcb_h__ */