Re: [BUG] fanotify: destroy/add race leaves a mark on a detached connector

From: Amir Goldstein

Date: Wed Sep 02 2026 - 13:27:07 EST


On Wed, Sep 2, 2026 at 6:52 PM Jan Kara <jack@xxxxxxx> wrote:
>
> On Tue 01-09-26 23:53:48, Amir Goldstein wrote:
> > On Tue, Sep 1, 2026 at 6:57 PM Jan Kara <jack@xxxxxxx> wrote:
> > >
> > > > + }
> > > > res = __d_find_any_alias(inode); /* recheck under lock */
> > > > if (likely(!res)) { /* still no alias, attach a disconnected dentry */
> > > > unsigned add_flags = d_flags_for_inode(inode);
> > >
> > > Thanks for looking into this!
> > >
> >
> > See attached patch (again helper named debatable).
>
> Thanks for the patch! I have somewhat massaged the changelog and names and

FYIW, I like your simplifications
and changelog definitely needed a touch up.

> sent it for inclusion to Christian. Since this is messing with dcache code,
> it should better go through his tree (plus I want to give him a chance to
> stop this somewhat hacky workaround ;)).

We'll see...

Thanks,
Amir.