https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289120
--- Comment #10 from Qiu-ji Chen <[email protected]> --- (In reply to Ahmad Khalifa from comment #8) Hi Ahmad, Thanks for the follow-up. Two things further suggest this is an oversight. First, an earlier f_event call in the same function (around line 559) correctly holds the lock, which confirms the intended pattern. Second, the locking sequence around line 609 seems awkward and inefficient. After the unlocked f_event call, KNOTE_ACTIVATE(kn, 0) briefly locks and unlocks kq_lock, only for the code to re-acquire both the knlist lock and kq_lock immediately after on lines 610-611. This reinforces the idea that a cleaner fix would be to acquire both locks before the f_event call at line 608. This would not only fix the race but also allow changing the macro to KNOTE_ACTIVATE(kn, 1), correcting the inefficient locking sequence. Best regards, Qiu-ji Chen -- You are receiving this mail because: You are the assignee for the bug.
