inotify-tools icon indicating copy to clipboard operation
inotify-tools copied to clipboard

Fanotify mount watch

Open amir73il opened this issue 5 months ago • 8 comments

  • Add new option --mount to setup fanotify mount watch
  • Add tests for --mount and --filesystem (some skipped for non-root user)
  • Fixes to support watching overlayfs with --fanotify (>= v6.6)
  • Fixes to support watching btrfs sub-volume with --fanotify (>= v6.8)
  • Fixes for filesystem watches set on a bind mount path
  • Add tests for btrfs subvol and overlayfs (skipped if no kernel support)

amir73il avatar Jul 25 '25 14:07 amir73il

@ericcurtin I am not sure if you are up for merging new fanotify features to inotify-tools?

This PR adds one new command line option and improves support for more filesystems and common configurations (e.g. bind mounts) without any needed opt in from user. It also fixes existing fanotify tests and adds quite a few more.

The current CI build failures related to Coverity/Doxigen do not seem to be related to my changes? The Codacy static analysis issue seems like a bug or false positive? Will you have time to look into those CI issues?

I am planning to further implement subtree filtering feature to facilitate a setup of privileged --filesystem service, which provides a subtree filtered event stream to unprivileged fanotify event consumers, but first I wanted to know if you are willing to accept these new features. If not, I will try to look for another project to accept new fanotify features, so please let me know what you think.

amir73il avatar Jul 28 '25 11:07 amir73il

@amir73il sorry you caught me at a bad time when you pushed this, I'm up for it now

ericcurtin avatar Sep 22 '25 19:09 ericcurtin

Also I'm not a huge fan of rewrite in Rust culture, but I think I'm gonna do it here. inotify-tools is full of the kind of bugs that Rust is supposed to help with, so I hope we can eliminate some of those on the way.

ericcurtin avatar Sep 22 '25 19:09 ericcurtin

I fixed up some of the builds, so if we rebase and rerun this, it should be greener

ericcurtin avatar Sep 22 '25 19:09 ericcurtin

Also I'm not a huge fan of rewrite in Rust culture, but I think I'm gonna do it here. inotify-tools is full of the kind of bugs that Rust is supposed to help with, so I hope we can eliminate some of those on the way.

I have been wanting to get into Rust myself. Would be happy to help you with this effort. Please keep me posted on your plans and let me know if I can help.

amir73il avatar Sep 23 '25 04:09 amir73il

I fixed up some of the builds, so if we rebase and rerun this, it should be greener

Rebased. Some tests are failing in CI although on my Ubuntu 2404 laptop all tests pass as root and as non-root. Please help me understand what went wrong.

amir73il avatar Sep 23 '25 08:09 amir73il

Sorry @amir73il ... There's been limited contributions the last few year and the builds have gotten a bit stale...

They should be working again now...

ericcurtin avatar Sep 24 '25 09:09 ericcurtin

Sorry @amir73il ... There's been limited contributions the last few year and the builds have gotten a bit stale...

They should be working again now...

@ericcurtin no worries, but the CI is failing on actual inotifywait --fanotify tests which do pass on my laptop so when you have time, please see if the tests pass for you and why they fail in Github CI

amir73il avatar Sep 24 '25 11:09 amir73il