[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABdmKX36bog6EvLd1bkGk+hd8FyPqjgqGZZ3T1gvskgvjZGxmw@mail.gmail.com>
Date: Tue, 10 Feb 2026 14:48:15 -0800
From: "T.J. Mercier" <tjmercier@...gle.com>
To: Tejun Heo <tj@...nel.org>
Cc: gregkh@...uxfoundation.org, driver-core@...ts.linux.dev,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org, shuah@...nel.org,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH 2/3] kernfs: send IN_DELETE_SELF and IN_IGNORED on file deletion
On Tue, Feb 10, 2026 at 2:42 PM Tejun Heo <tj@...nel.org> wrote:
>
> On Mon, Feb 09, 2026 at 04:38:00PM -0800, T.J. Mercier wrote:
> ...
> > static void __kernfs_remove(struct kernfs_node *kn)
> > {
> > struct kernfs_node *pos, *parent;
> > @@ -1520,6 +1538,9 @@ static void __kernfs_remove(struct kernfs_node *kn)
> > struct kernfs_iattrs *ps_iattr =
> > parent ? parent->iattr : NULL;
> >
> > + if (kernfs_type(kn) == KERNFS_FILE)
>
> kernfs_type(pos)?
Oh, yes you are right. Thanks.
> > + kernfs_notify_file_deleted(pos);
> > +
> ...
> > -static void kernfs_notify_workfn(struct work_struct *work)
> > +static int fsnotify_self_event(int event)
> > +{
> > + if (event == FS_DELETE)
> > + return FS_DELETE_SELF;
> > +
> > + return event;
> > +}
> > +
> > +void kernfs_notify_workfn(struct work_struct *work)
> > {
> > struct kernfs_node *kn;
> > struct kernfs_super_info *info;
> > struct kernfs_root *root;
> > u32 notify_event;
> > + u32 self_event;
> > repeat:
> > /* pop one off the notify_list */
> > spin_lock_irq(&kernfs_notify_lock);
> > @@ -929,6 +938,8 @@ static void kernfs_notify_workfn(struct work_struct *work)
> > kn->attr.notify_event = 0;
> > spin_unlock_irq(&kernfs_notify_lock);
> >
> > + self_event = fsnotify_self_event(notify_event);
>
> Maybe just inline the conversion?
Sure, sgtm. I figured the named function was a bit more
self-documenting, but it's just as easy to add checks for FS_DELETE
where self_event is used.
> Thanks.
>
> --
> tejun
Powered by blists - more mailing lists