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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ssbrsekgkssixxq4wiybw6k7n24efg64ozh6vrzxuft2sdz2w7@3tfmzfnqdwbu>
Date: Tue, 3 Jun 2025 22:13:53 +0200
From: Jan Kara <jack@...e.cz>
To: Jeff Layton <jlayton@...nel.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>, 
	Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>, Chuck Lever <chuck.lever@...cle.com>, 
	Alexander Aring <alex.aring@...il.com>, Trond Myklebust <trondmy@...nel.org>, 
	Anna Schumaker <anna@...nel.org>, Steve French <sfrench@...ba.org>, 
	Paulo Alcantara <pc@...guebit.com>, Ronnie Sahlberg <ronniesahlberg@...il.com>, 
	Shyam Prasad N <sprasad@...rosoft.com>, Tom Talpey <tom@...pey.com>, 
	Bharath SM <bharathsm@...rosoft.com>, NeilBrown <neil@...wn.name>, 
	Olga Kornievskaia <okorniev@...hat.com>, Dai Ngo <Dai.Ngo@...cle.com>, Jonathan Corbet <corbet@....net>, 
	Amir Goldstein <amir73il@...il.com>, Miklos Szeredi <miklos@...redi.hu>, 
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org, linux-nfs@...r.kernel.org, 
	linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH RFC v2 21/28] fsnotify: export fsnotify_recalc_mask()

On Mon 02-06-25 10:02:04, Jeff Layton wrote:
> nfsd needs to call this when new directory delegations are set or unset.
> 
> Signed-off-by: Jeff Layton <jlayton@...nel.org>

So fsnotify_recalc_mask() is not a great API to export because it depends
on lifetime rules of mark connector - in particular the caller has to make
sure the connector stays alive while fsnotify_recalc_mask() is running. So
far the knowledge was internal in fsnotify subsystem but now NFSD needs to
know as well.

Generally you need to recalculate the mask when you modify events you
listen to in a mark. So perhaps we should provide an API like:

int fsnotify_modify_mark_mask(struct fsnotify_mark *mark, __u32 mask_clear,
			      __u32 mask_set);

which could be used to modify mark mask without having to care about
details like cached masks and connector locking rules?

								Honza

> ---
>  fs/notify/mark.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/notify/mark.c b/fs/notify/mark.c
> index 798340db69d761dd05c1b361c251818dee89b9cf..ff21409c3ca3ad948557225afc586da3728f7cbe 100644
> --- a/fs/notify/mark.c
> +++ b/fs/notify/mark.c
> @@ -308,6 +308,7 @@ void fsnotify_recalc_mask(struct fsnotify_mark_connector *conn)
>  	if (update_children)
>  		fsnotify_conn_set_children_dentry_flags(conn);
>  }
> +EXPORT_SYMBOL_GPL(fsnotify_recalc_mask);
>  
>  /* Free all connectors queued for freeing once SRCU period ends */
>  static void fsnotify_connector_destroy_workfn(struct work_struct *work)
> 
> -- 
> 2.49.0
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ