You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep inotify directory baseline when a snapshot fails
A directory watch snapshots the child-name set on each change and diffs it
against the previous baseline to recover the name kqueue omits. dir_snapshot
returned an empty list on any failure (opendir error, a mid-read readdir
error, or an allocation failure), which the diff could not tell apart from a
genuinely empty directory.
On a transient failure the IN_DELETE pass then saw every known child as
missing and queued a spurious IN_DELETE for each, and the baseline was
overwritten with the empty list, so every later change re-reported the whole
directory as IN_CREATE. The corruption was permanent.
Make dir_snapshot return bool: on failure it frees any partial result and
reports false, and readdir read errors are now detected by clearing errno
before each call. process_vnode_event only diffs against and advances to a
snapshot that succeeded; on failure it keeps the previous baseline so the next
successful snapshot reconciles whatever changed in between. The watch-add path
documents that a failed initial snapshot is a best-effort empty baseline.
Validated with make check on Apple Silicon; test-inotify still passes 6/6.
0 commit comments