ev_stat inotify implementation might miss events

Yoann Vandoorselaere yoann.v at prelude-ids.com
Mon Jan 25 16:13:50 CET 2010


The ev_stat inotify backend can miss files events while the ev_stat
notification callback execute. If additional changes occurs before the
main libev loop resume, the events will be lost.

This is due to the following stat_timer_cb() code:

      #if EV_USE_INOTIFY
        if (fs_fd >= 0)
            infy_del (EV_A_ w);
            infy_add (EV_A_ w);
            ev_stat_stat (EV_A_ w); /* avoid race... */

Removing the call to ev_stat_stat() fixes the problem. 

Additionally, could you detail why it is necessary to call infy_del() /
infy_add() on the notified descriptor ?


Yoann Vandoorselaere | Directeur Technique/CTO | PreludeIDS Technologies
Tel: +33 (0)1 40 24 65 10                      Fax: +33 (0)1 40 24 65 28

More information about the libev mailing list