Skip to content

Commit

Permalink
epoch: fix assertion
Browse files Browse the repository at this point in the history
If we call epoch_exit_preempt() on an epoch that's not net_epoch_preempt
we can't assert td->td_net_epoch.
Move the assertion under the 'epoch == net_epoch_preempt' conditional.

No functional change for pfSense, as we don't build with INVARIANTS
(unless debugging, in which case this panicked during boot).
  • Loading branch information
kprovost committed Jun 22, 2022
1 parent e3d2156 commit 028065f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sys/kern/subr_epoch.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,10 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et)
td = curthread;
critical_enter();
sched_unpin();
MPASS(td->td_net_epoch);
if (epoch == net_epoch_preempt)
if (epoch == net_epoch_preempt) {
MPASS(td->td_net_epoch);
td->td_net_epoch--;
}
MPASS(td->td_epochnest);
td->td_epochnest--;
er = epoch_currecord(epoch);
Expand Down

0 comments on commit 028065f

Please sign in to comment.