]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Ensure that we test the event condition when a disabled kevent is enabled.
authorMark Johnston <markj@FreeBSD.org>
Fri, 19 Feb 2016 01:49:33 +0000 (01:49 +0000)
committerMark Johnston <markj@FreeBSD.org>
Fri, 19 Feb 2016 01:49:33 +0000 (01:49 +0000)
commit88c2beac9cedc0bd3ef6696833ea4d8d6f59faa1
treeef3f31cabf603feda666420b4028149bee55f1ae
parentfe169828c3d6b0dfabd753da476928fe23ab54a5
Ensure that we test the event condition when a disabled kevent is enabled.

r274560 modified kqueue_register() to only test the event condition if the
corresponding knote is not disabled. However, this check takes place before
the EV_ENABLE flag is used to clear the KN_DISABLED flag on the knote, so
enabling a previously-disabled kevent would not result in a notification for
a triggered event. This change fixes the problem by testing for EV_ENABLED
before possibly checking the event condition.

This change also updates a kqueue regression test to exercise this case.

PR: 206368
Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5307
sys/kern/kern_event.c
tests/sys/kqueue/read.c