Skip to content

Super block root watch

Amir Goldstein edited this page Apr 29, 2019 · 10 revisions

Motivation

Super block root watch is designed to solve the scalability issues with inotify recursive watches.

Other operating systems have a scalable way of watching changes on a large file system. Windows has USN Journal, macOS has FSEvents and BSD has kevents.

Currently, the only way in Linux to monitor file system dirent modification events (e.g. create/delete/move) is the recursive inotify watch way and this method scales very poorly for large enough directory trees. Beyond the exploding probability of a need for full scan, pinning all directory inodes wastes a lot of memory.

The efforts to merge fanotify took several steps in the direction of solving the scalability issue, but they did not go all the way to provide the functionality required to replace inotify.

The fanotify super block watch patch set is meant to fill this gap in functionality and add the functionality of a root watch.

Source code

The fanotify super block watch patches are available here.

The patches are arranged in 4 logical groups, which are denoted by 4 branch heads:

fsnotify_sb

This series adds the super block root watch functionality to the fsnotify infrastructure, without adding user API and without adding support for it in any backend. It was merged to kernel v4.20-rc1 .

fanotify_sb

This series adds the user API and functionality for reporting all events on a super block via the fanotify backend. It was merged to kernel v4.20-rc1.

fsnotify_dirent

This series adds reporting dirent modification events (e.g. create/delete/rename) to the fsnotify infrastructure, without adding user API and without adding support for it in any backend. It was merged to kernel v5.1-rc1.

fanotify_dirent

This series adds the user API and functionality of reporting dirent modification events (e.g. create/delete/rename) to the fanotify backend. It was merged to kernel v5.1-rc1.

Clone this wiki locally
You can’t perform that action at this time.