Re: [PATCH v2 0/4] kernfs: don't hold kernfs_rwsem across dir_emit()
From: Christian Brauner
Date: Thu Sep 17 2026 - 06:12:40 EST
On Fri, 11 Sep 2026 11:28:11 -0700, Shakeel Butt wrote:
> kernfs: don't hold kernfs_rwsem across dir_emit()
>
> kernfs_fop_readdir() takes kernfs_rwsem for reading and holds it for the
> whole listing, dir_emit() included. dir_emit() copies into a userspace
> buffer, so it can fault, and under memory pressure that fault goes to
> reclaim.
>
> [...]
Applied to the vfs-7.4.kernfs branch of the vfs/vfs.git tree.
Patches in the vfs-7.4.kernfs 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-7.4.kernfs
[1/4] kernfs: don't repeat or skip an entry when readdir resumes
https://git.kernel.org/vfs/vfs/c/5ebcb578adee
[2/4] kernfs: resume readdir on the full entry key
https://git.kernel.org/vfs/vfs/c/45126ed80bb1
[3/4] kernfs: don't hold kernfs_rwsem across dir_emit()
https://git.kernel.org/vfs/vfs/c/341c65579de5
[4/4] selftests: cover readdir resuming at a removed entry
https://git.kernel.org/vfs/vfs/c/a4354906005d