Re: [PATCH] fuse: fix inode initialization race

From: Miklos Szeredi

Date: Thu Mar 26 2026 - 10:56:28 EST


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.

Thanks,
Miklos