lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241120154448.onc2q5rsusfs4zsm@quack3>
Date: Wed, 20 Nov 2024 16:44:48 +0100
From: Jan Kara <jack@...e.cz>
To: Josef Bacik <josef@...icpanda.com>
Cc: kernel-team@...com, linux-fsdevel@...r.kernel.org, jack@...e.cz,
	amir73il@...il.com, brauner@...nel.org,
	torvalds@...ux-foundation.org, viro@...iv.linux.org.uk,
	linux-xfs@...r.kernel.org, linux-btrfs@...r.kernel.org,
	linux-mm@...ck.org, linux-ext4@...r.kernel.org
Subject: Re: [PATCH v8 13/19] fanotify: add a helper to check for pre content
 events

On Fri 15-11-24 10:30:26, Josef Bacik wrote:
> From: Amir Goldstein <amir73il@...il.com>
> 
> We want to emit events during page fault, and calling into fanotify
> could be expensive, so add a helper to allow us to skip calling into
> fanotify from page fault.  This will also be used to disable readahead
> for content watched files which will be handled in a subsequent patch.
> 
> Signed-off-by: Josef Bacik <josef@...icpanda.com>
> Signed-off-by: Amir Goldstein <amir73il@...il.com>
> ---
>  include/linux/fsnotify.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
> index 08893429a818..d5a0d8648000 100644
> --- a/include/linux/fsnotify.h
> +++ b/include/linux/fsnotify.h
> @@ -178,6 +178,11 @@ static inline void file_set_fsnotify_mode(struct file *file)
>  	}
>  }
>  
> +static inline bool fsnotify_file_has_pre_content_watches(struct file *file)
> +{
> +	return file && unlikely(FMODE_FSNOTIFY_HSM(file->f_mode));
> +}
> +

I was pondering about this and since we are trying to make these quick
checks more explicit, I'll probably drop this helper. Also the 'file &&'
part looks strange (I understand page_cache_[a]sync_ra() need it but I'd
rather handle it explicitely there).

								Honza
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ