Re: [PATCH] vfs: handle __wait_on_freeing_inode() and evict() race

From: Christian Brauner
Date: Fri Jul 19 2024 - 08:03:12 EST


On Thu, 18 Jul 2024 17:18:37 +0200, Mateusz Guzik wrote:
> Lockless hash lookup can find and lock the inode after it gets the
> I_FREEING flag set, at which point it blocks waiting for teardown in
> evict() to finish.
>
> However, the flag is still set even after evict() wakes up all waiters.
>
> This results in a race where if the inode lock is taken late enough, it
> can happen after both hash removal and wakeups, meaning there is nobody
> to wake the racing thread up.
>
> [...]

Thanks for that and the concise explanation!

---

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] vfs: handle __wait_on_freeing_inode() and evict() race
https://git.kernel.org/vfs/vfs/c/3ba35ec4b0ed