generic: test reading a large directory while renaming its files

Test that on a fairly large directory if we keep renaming files while
holding the directory open and doing readdir(3) calls, we don't end up
in an infinite loop.

This exercise a bug that existed in btrfs and was fixed in kernel 6.5
by commit 9b378f6ad48c ("btrfs: fix infinite directory reads").

Signed-off-by: Filipe Manana <>
Reviewed-by: Zorro Lang <>
Signed-off-by: Zorro Lang <>
5 files changed