inotify(7) explicitly states that MOVED_FROM and MOVED_TO are not
atomically added to the inotify queue. Save MOVED_FROM in the watch
descriptor and try to match a later MOVED_TO with that. If no
corresponding MOVED_TO comes, send out a NOTIFY_ACTION_REMOVED after
100 milliseconds.
This is all racy, as we only catch directly corresponding FROM and TO
events. According to inotify(7) anything can come in between FROM and
TO, in particular other FROM/TO pairs. The best we can do I think is
turn dislocated FROM/TO pairs as REMOVED/ADDED instead of the original
Windows rename OLD_NAME/NEW_NAME.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15864 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>