Re: [PATCH v2 05/16] fanotify: introduce FAN_PRE_MODIFY permission event

Christian Brauner
2024-08-09T11:57:57Z

On Thu, Aug 08, 2024 at 03:27:07PM GMT, Josef Bacik wrote:
> From: Amir Goldstein <amir73il@gmail.com>
>
> Generate FAN_PRE_MODIFY permission event from fsnotify_file_perm()
> pre-write hook to notify fanotify listeners on an intent to make
> modification to a file.
>
> Like FAN_PRE_ACCESS, it is only allowed with FAN_CLASS_PRE_CONTENT
> and unlike FAN_MODIFY, it is only allowed on regular files.
>
> Like FAN_PRE_ACCESS, it is generated without sb_start_write() held,
> so it is safe to perform filesystem modifications in the context of
> event handler.
>
> This pre-content event is meant to be used by hierarchical storage
> managers that want to fill the content of files on first write access.
>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---

Reviewed-by: Christian Brauner <brauner@kernel.org>