linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [regression] getdents() does not list entries created after opening the directory
@ 2024-10-01 11:29 Linux regression tracking (Thorsten Leemhuis)
  2024-10-01 12:18 ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: Linux regression tracking (Thorsten Leemhuis) @ 2024-10-01 11:29 UTC (permalink / raw)
  To: yangerkun
  Cc: Christian Brauner, linux-fsdevel, Alexander Viro,
	Linux kernel regressions list, LKML, Krzysztof Małysa

Hi, Thorsten here, the Linux kernel's regression tracker.

yangerkun, I noticed a report about a regression in bugzilla.kernel.org
that appears to be caused by the following change of yours:

64a7ce76fb901b ("libfs: fix infinite directory reads for offset dir")
[merged via: "Merge tag 'vfs-6.11-rc4.fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs"; v6.11-rc4]

As many (most?) kernel developers don't keep an eye on the bug tracker,
I decided to write this mail. To quote from
https://bugzilla.kernel.org/show_bug.cgi?id=219285:

> 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.

> Regression first appeared in 6.10.7, 6.10.6 was good. I will further
> bisect tomorrow.

> 6.11 is still affected.

See the ticket for more details. Reporter ist CCed. I made no judgement
if the code provided is sane, I'm just assumed forwarding the issue was
a good idea.

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.

P.S.: let me use this mail to also add the report to the list of tracked
regressions to ensure it's doesn't fall through the cracks:

#regzbot introduced: 64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a
#regzbot title: libfs: getdents() does not list entries created after
opening the directory
#regzbot from: Krzysztof Małysa <varqox@gmail.com>
#regzbot duplicate: https://bugzilla.kernel.org/show_bug.cgi?id=219285
#regzbot ignore-activity

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-01 19:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01 11:29 [regression] getdents() does not list entries created after opening the directory Linux regression tracking (Thorsten Leemhuis)
2024-10-01 12:18 ` Matthew Wilcox
2024-10-01 12:49   ` Linux regression tracking (Thorsten Leemhuis)
2024-10-01 18:59     ` Christian Heusel
2024-10-01 19:15     ` Krzysztof Małysa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).