Re: [PATCH] fs: add might_sleep() annotation to iput() and more
From: Christian Brauner
Date: Fri Sep 19 2025 - 08:15:17 EST
On Wed, 17 Sep 2025 17:36:31 +0200, Max Kellermann wrote:
> When iput() drops the reference counter to zero, it may sleep via
> inode_wait_for_writeback(). This happens rarely because it's usually
> the dcache which evicts inodes, but really iput() should only ever be
> called in contexts where sleeping is allowed. This annotation allows
> finding buggy callers.
>
> Additionally, this patch annotates a few low-level functions that can
> call iput() conditionally.
>
> [...]
Applied to the vfs-6.18.inode.refcount.preliminaries branch of the vfs/vfs.git tree.
Patches in the vfs-6.18.inode.refcount.preliminaries 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-6.18.inode.refcount.preliminaries
[1/1] fs: add might_sleep() annotation to iput() and more
https://git.kernel.org/vfs/vfs/c/2ef435a872ab