Thread (6 messages) 6 messages, 2 authors, 2022-07-01
STALE1466d
Revisions (3)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current

[PATCH v3 0/3] New fanotify API for ignoring events

From: Amir Goldstein <amir73il@gmail.com>
Date: 2022-06-29 14:42:30
Also in: linux-fsdevel

Hi Jan,

As we discussed [1], here is the implementation of the new
FAN_MARK_IGNORE API, to try and sort the historic mess of
FAN_MARK_IGNORED_MASK.

We use the opportunity of the new API to further restict the events
and flags that are allowed in ignore mask of a non-dir inode mark and
we require FAN_MARK_IGNORED_SURV_MODIFY for dir/mount/sb ignore mark
to remove from the test matrix a lot of notsensical combinations.

I extended the LTP tests [2] to cover the bug that you pointed out
in [v1] review. I verified that the 6 relevant test cases fail with
the buggy v1 version and pass in this version.

The man page draft [3] has been updated to reflect the new restrictions,
some of which have already been added by a Fixes patch [4].

Thanks,
Amir.

Changes since [v2]:
- Rebase on top of API restriction patch
- Require FAN_MARK_IGNORED_SURV_MODIFY for dir/mount/sb ignore mark
- Add test coverage and update man page with new restrictions

Changes since [v1]:
- Replace "sticky" semantics with EEXITS error
- Simplify EINVAL checks
- Add missing ignore mask accessors
- Add fsnotify_effective_ignore_mask() helper to fix bug

[v1] https://lore.kernel.org/linux-fsdevel/20220620134551.2066847-1-amir73il@gmail.com/ (local)
[v2] https://lore.kernel.org/linux-fsdevel/20220624143538.2500990-1-amir73il@gmail.com/ (local)
[1] https://lore.kernel.org/linux-fsdevel/20220428123824.ssq72ovqg2nao5f4@quack3.lan/ (local)
[2] https://github.com/amir73il/ltp/commits/fan_mark_ignore
[3] https://github.com/amir73il/man-pages/commits/fan_mark_ignore
[4] https://lore.kernel.org/linux-fsdevel/20220627174719.2838175-1-amir73il@gmail.com/ (local)

Amir Goldstein (3):
  fanotify: prepare for setting event flags in ignore mask
  fanotify: cleanups for fanotify_mark() input validations
  fanotify: introduce FAN_MARK_IGNORE

 fs/notify/fanotify/fanotify.c      |  19 ++---
 fs/notify/fanotify/fanotify.h      |   2 +
 fs/notify/fanotify/fanotify_user.c | 110 ++++++++++++++++++++++-------
 fs/notify/fdinfo.c                 |   6 +-
 fs/notify/fsnotify.c               |  21 +++---
 include/linux/fanotify.h           |  14 ++--
 include/linux/fsnotify_backend.h   |  89 +++++++++++++++++++++--
 include/uapi/linux/fanotify.h      |   8 +++
 8 files changed, 212 insertions(+), 57 deletions(-)

-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help