inotify · shipping · also Linux filesystem event notification

inotify

inotify is a Linux interface that queues selected filesystem notifications for explicitly watched files or directories.

Related Observatory article: Read on hesela.com

Observation limits: mapped changes can occur without modification events, and directory watches do not recursively cover subdirectories. An unread sequence of identical events can coalesce, so event counts are not operation counts. Queue overflow requires recovery of potentially stale application state. [1]

Writable closure: IN_CLOSE_WRITE identifies a close associated with write access, not a byte comparison. The Linux v6.8 fsnotify_close hook selects the event from FMODE_WRITE. [2]

Measured controls: Hesela observed one event for 32 unread pwrite notifications, but 32 when reading the queue after each call. Shared mapped stores changed the file without IN_MODIFY; closing an unchanged writable file still produced IN_CLOSE_WRITE. These one-host checks are not a backup-product evaluation. [3]

Reconciliation scope: a live rescan is not inherently a point-in-time inventory; see directory enumeration and Hesela's separate ordered-rename experiment. [3]

Shared ownership: hard-link aliases in one instance reuse a watch; another registration can replace its mask. IN_MASK_ADD unions interests, but removal or IN_ONESHOT can end the shared watch. IN_MASK_CREATE rejects reuse with EEXIST. [1] [4] [5]

Shared readers: dup shares queue consumption; separate initializations create separate queues. A shared watcher needs subscriber accounting and event fan-out. [6] [7]

Library scope: in native fsnotify v1.10.1 Linux controls, a WRITE event's retained name resolved to a replacement inode, not the changed hard-linked file. Earlier CHMOD was delivered. [10]

Relations

related
Memory-mapped file, Incremental backup, Backup verification, Storage snapshot, Directory enumeration, Watchman clock, fanotify, Hard link, Inode, Open file description, File descriptor, ViewBox, Spyglass

Advantages

  • Can trigger inspection of selected files without repeatedly scanning every path.

Limitations

  • A notification stream alone does not establish complete or application-consistent backup capture.
  • IN_EXCL_UNLINK filters notifications through an unlinked entry, even with another hard link; it does not retract an earlier queued MODIFY. A later name lookup can reach a replacement inode. [11] [12] [14]

Citations

  1. Linux man-pages 6.19: inotify(7) (accessed 2026-10-19)
  2. Linux v6.8: fsnotify_close in include/linux/fsnotify.h (accessed 2026-10-19)
  3. Hesela: What inotify misses: mapped writes and collapsed change events (accessed 2026-10-19)
  4. Linux man-pages 6.19: inotify_add_watch(2) (accessed 2026-11-20)
  5. Linux man-pages 6.19: inotify_rm_watch(2) (accessed 2026-11-20)
  6. Linux man-pages 6.19: dup(2) (accessed 2026-11-20)
  7. Linux man-pages 6.19: inotify_init(2) (accessed 2026-11-20)
  8. Hesela: native inotify ownership controls, source and reproduction package (accessed 2026-11-20)
  9. Hesela: native fsnotify alias and event-name identity controls (accessed 2026-11-20)
  10. Linux v6.8: EXCL_UNLINK event-path filtering (accessed 2026-11-20)
  11. Linux v6.8: d_unlinked tests directory-entry state (accessed 2026-11-20)
  12. Hesela: raw directory notifications after unlink, original and separate C controls (accessed 2026-11-20)

Further reading

  1. fsnotify v1.10.1: pinned Linux watch registration and event-name construction (accessed 2026-11-20)
  2. Linux v6.8: fsnotify_file uses the open file path, lines 92-101 (accessed 2026-11-20)
Sources & caveats
  • API documentation and controlled observations; not a durable change journal or an event-loss rate estimate.
  • Ownership controls: 66 sequential case executions on one Linux 6.8.0-149-generic host, across ext4/tmpfs. These verify API behavior, not a backup failure-rate estimate. [8]
  • Separate fsnotify v1.10.1 controls: 36 registration/lifetime schedules and 18 namespace schedules, three repetitions on ext4/tmpfs on one Linux host. The event-name lookup checks bytes and inode identity; not a backup-product failure rate. [10]
  • Separate raw directory controls: 42 fixtures and 84 paired streams, seven cases repeated three times on ext4/tmpfs on Linux 6.8.0-149-generic. [14]
  • Separate review: 42 Python replay fixtures and 20 C fixtures across two compiler modes on the same host. These are not pooled failure-rate samples or independent-laboratory replication. [14]

JSON: /data/terms/inotify.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. inotify. Hesela. 2026-11-21. https://hesela.dev/terms/inotify/