Re: [PATCH] fuse: fix inode initialization race

From: Miklos Szeredi

Date: Thu Mar 26 2026 - 11:37:38 EST


On Thu, 26 Mar 2026 at 16:13, Bernd Schubert <bernd@xxxxxxxxxxx> wrote:
>
>
>
> On 3/26/26 15:26, Christian Brauner wrote:
> > On Wed, Mar 25, 2026 at 08:54:57AM +0100, Bernd Schubert wrote:
> >>
> >>
> >> On 3/18/26 14:43, Horst Birthelmer wrote:
> >>> From: Horst Birthelmer <hbirthelmer@xxxxxxx>

> >>> fi->attr_version = atomic64_inc_return(&fc->attr_version);
> >>> + wake_up_all(&fc->attr_version_waitq);
> >>> fi->i_time = attr_valid;
>
>
> While I'm looking at this again, wouldn't it make sense to make this
> conditional? Because we wake this queue on every attr change for every
> inode. And the conditional in fuse_iget() based on I_NEW?

Right, should only wake if fi->attr_version old value was zero.

BTW I have a hunch that there are better solutions, but it's simple
enough as a stopgap measure.

Thanks,
Miklos