Re: Re: [PATCH] fuse: fix inode initialization race
From: Horst Birthelmer
Date: Thu Mar 26 2026 - 11:01:42 EST
On Thu, Mar 26, 2026 at 03:51:18PM +0100, Miklos Szeredi wrote:
> On Wed, 18 Mar 2026 at 14:45, Horst Birthelmer <horst@xxxxxxxxxxxxxx> wrote:
> >
> > From: Horst Birthelmer <hbirthelmer@xxxxxxx>
> >
> > Fix a race between fuse_iget() and fuse_reverse_inval_inode() where
> > invalidation can arrive while an inode is being initialized, causing
> > the invalidation to be lost.
> >
> > Add a waitqueue to make fuse_reverse_inval_inode() wait when it
> > encounters an inode with attr_version == 0 (still initializing).
> > When fuse_change_attributes_common() completes initialization, it
> > wakes waiting threads.
>
> This should be relatively rare, right? In that case a single global
> waitq and wake_up_all() would be better, imo.
Well it depends on the use case. We send relatively many notifications
since they are bound to the DLM system and thus to changes done by a lot
of clients and so it happens that you get an invalidation while still
creating the inode.
What is wrong with one per connection?
>
> Thanks,
> Miklos