As in the title, the below program illustrates the problem. Expected output should include line "entry: after", actual output does not: ``` entry: . entry: .. entry: before ``` Program: ```c #include <unistd.h> #include <dirent.h> #include <stdlib.h> #include <sys/stat.h> #include <stdio.h> #include <fcntl.h> int main() { system("rm -rf /tmp/dirent-problems-test-dir"); if (mkdir("/tmp/dirent-problems-test-dir", 0755)) { abort(); } int fd = creat("/tmp/dirent-problems-test-dir/before", 0644); if (fd < 0) { abort(); } close(fd); DIR* dir = opendir("/tmp/dirent-problems-test-dir"); fd = creat("/tmp/dirent-problems-test-dir/after", 0644); if (fd < 0) { abort(); } close(fd); struct dirent* entry; while ((entry = readdir(dir))) { printf("entry: %s\n", entry->d_name); } closedir(dir); return 0; } ``` Affected kernel version: 6.10.10. Filesystem: ext4. Distribution: Arch Linux.
On Linux 6.6.51 it works as expected.
Could you check if 6.11 is still affected and bisect https://docs.kernel.org/next/admin-guide/bug-bisect.html ?
Regression first appeared in 6.10.7, 6.10.6 was good. I will further bisect tomorrow.
6.11 is still affected.
308b4fc2403b335894592ee9dc212a5e58bb309f is the first bad commit. Reverting it fixes the bug both on 6.10.11 and 6.11.
thx; can I CC you when forwarding this report by mail? this would expose your email address to the public
Ye, you can CC me.
TWIMC: forwarded https://lore.kernel.org/regressions/8196cf54-5783-4905-af00-45a869537f7c@leemhuis.info/