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: <b5f480e8d2c52860f43b14f6338aa5b03023e49b.camel@kernel.org>
Date: Tue, 03 Jun 2025 16:17:01 -0400
From: Jeff Layton <jlayton@...nel.org>
To: Jan Kara <jack@...e.cz>
Cc: Alexander Viro <viro@...iv.linux.org.uk>, Christian Brauner	
 <brauner@...nel.org>, 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 Tue, 2025-06-03 at 22:13 +0200, Jan Kara wrote:
> 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?
> 

That sounds like a reasonable thing to do. I'll plan to do something
along those lines. Thanks for the review!

> 
> > ---
> >  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
> > 

-- 
Jeff Layton <jlayton@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ