diff options
| author | Shakeel Butt <shakeel.butt@linux.dev> | 2026-09-11 11:28:15 -0700 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-09-17 12:08:52 +0200 |
| commit | a4354906005d66a485a3258b6d7ddfe6fad0fef3 (patch) | |
| tree | 72eb6ad8aecda1bb12d9853d898c6e1e2202753c /tools/lib/python | |
| parent | 341c65579de5b632eb7913bb68b3e375eeeb3ddf (diff) | |
| download | linux-next-a4354906005d66a485a3258b6d7ddfe6fad0fef3.tar.gz linux-next-a4354906005d66a485a3258b6d7ddfe6fad0fef3.zip | |
selftests: cover readdir resuming at a removed entry
The kernfs tests list only directories that do not change, so nothing
covers the entry a listing stopped on being gone when it comes back.
readdir_resume_at_removed_entry takes a telldir(3) cookie for every
entry, then removes each entry in turn, seeks to its cookie and reads
the rest; nothing reported before it may come back. This is a resume
between two getdents(2) calls, and it fails without "kernfs: don't
repeat or skip an entry when readdir resumes".
readdir_resume_vs_internal_remove is a resume inside one call, which
"kernfs: don't hold kernfs_rwsem across dir_emit()" opens. It churns
cgroup.subtree_control rather than calling rmdir(2), which cannot reach
that window because iterate_dir() holds the listed directory's i_rwsem
for the whole listing. It is a stress test, has not been seen to catch
the ordering bug, and keeps the window busy for lockdep and KASAN. It
fails if the churn died and skips if the listings never overlapped it,
so it cannot pass having listed a static directory.
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Link: https://patch.msgid.link/20260911182815.1992483-5-shakeel.butt@linux.dev
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
