Created attachment 876851 [details] readahead test program Description of problem: The LTP (Linux Test Project) readahead01.c test tries the readahead syscall on a pipe and a socket and it succeeds. It should fail and return EINVAL because it does not make sense to read ahead on a stream like a pipe or socket. I've extracted the readahead test from LTP into a standalone program and here's how it fails on Fedora 20: ~]# uname -r 3.13.6-200.fc20.x86_64 ~]# strace -e trace=readahead ./a.out test_invalid_fd pipe: readahead(3, 0, 4096) = 0 failure: readahead returned 0 failure: errno is 0 test_invalid_fd socket: readahead(3, 0, 4096) = 0 failure: readahead returned 0 failure: errno is 0 It works correctly on a 3.10.0 kernel: ~]# strace -e trace=readahead ./a.out test_invalid_fd pipe: readahead(3, 0, 4096) = -1 EINVAL (Invalid argument) success: readahead returned -1 success: errno is 22 test_invalid_fd socket: readahead(3, 0, 4096) = -1 EINVAL (Invalid argument) success: readahead returned -1 success: errno is 22 Version-Release number of selected component (if applicable): kernel-3.13.6-200.fc20.x86_64 How reproducible: every time Steps to Reproduce: 1. gcc readahead-pipe-socket.c (see attached) 2. ./a.out Actual results: readahead returns success on pipes and sockets Expected results: readahead returns EINVAL on pipes and sockets Additional info:
It looks like a recent commit broke this and it was reported on LKML, but not fixed yet: https://lkml.org/lkml/2013/12/19/906 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=63d0f0a3c7e1
OK, I believe this is fixed by: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=58d5640ebdb273cc Probably should have been CC'd to stable. I'll get that going.
Fixed in git. Picked up for 3.13.7 stable too.
kernel-3.13.7-200.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/kernel-3.13.7-200.fc20
kernel-3.13.7-100.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/kernel-3.13.7-100.fc19
Package kernel-3.13.7-200.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing kernel-3.13.7-200.fc20' as soon as you are able to, then reboot. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-4317/kernel-3.13.7-200.fc20 then log in and leave karma (feedback).
It works! Thanks! ~]$ uname -r 3.13.7-200.fc20.x86_64 ~]$ ./readahead test_invalid_fd pipe: success: readahead returned -1 success: errno is 22 test_invalid_fd socket: success: readahead returned -1 success: errno is 22
kernel-3.13.7-200.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
kernel-3.13.7-100.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.