On Sun, Sep 4, 2022 at 5:10 PM Gal Rosen <gal.rosen@xxxxxxxxxxxxxx> wrote: > > Hi Amir, > > And what about other events like FAN_CLOSE_WRITE ? Permission events (e.g. FAN_OPEN_PERM) are never merged in the kernel queue. FAN_CLOSE_WRITE is an async event, so it MAY be merged with other async events (such as FAN_OPEN or another FAN_CLOSE_WRITE) on the same path/object, but: 1. You have no guarantee that the kernel will merge events 2. Kernel will only merge events if all other info except the event mask is identical. So for example, the file was opened by two different threads, event->pid would be different so the two events would not be merged. > > So, if I understand correctly, it is my responsibility to verify for multiplications > of file events for the same file path before calling to scan. right ? > Right. Since your application has a queue of its own, you are responsible to do that anyway, because once you read a FAN_CLOSE_WRITE event from the kernel and place it in the application queue, the kernel will surely generate another FAN_CLOSE_WRITE event on the next file close. Thanks, Amir.