linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.31k stars 1.01k forks source link

splice07 fails on kernels <5.10 #1156

Closed edliaw closed 1 week ago

edliaw commented 5 months ago

splice07 seems to depend on https://github.com/torvalds/linux/commit/36e2c7421f02a22f71c9283e55fdb672a9eb58e7 ("fs: don't allow splice read/write without explicit ops") to pass. I've compiled a list of failing combinations on 5.4, but I'm not sure what's the right approach to modifying the test:

in_fd out_fd error
TST_FD_PIPE_READ TST_FD_EPOLL hangs
TST_FD_PIPE_READ TST_FD_EVENTFD hangs
TST_FD_PIPE_READ TST_FD_SIGNALFD hangs
TST_FD_PIPE_READ TST_FD_TIMERFD hangs
TST_FD_PIPE_READ TST_FD_PIDFD hangs
TST_FD_PIPE_READ TST_FD_PERF_EVENT hangs
TST_FD_PIPE_READ TST_FD_IO_URING hangs
TST_FD_PIPE_READ TST_FD_BPF_MAP hangs
TST_FD_PIPE_READ TST_FD_FSOPEN hangs
TST_FD_PIPE_READ TST_FD_FSPICK hangs
TST_FD_INOTIFY TST_FD_PIPE_WRITE hangs
TST_FD_DIR TST_FD_PIPE_WRITE EISDIR
TST_FD_PERF_EVENT TST_FD_PIPE_WRITE ENODATA
TST_FD_FSOPEN TST_FD_PIPE_WRITE ENODATA
TST_FD_FSPICK TST_FD_PIPE_WRITE ENODATA

Should it just be gated by kernel version or is there a preferred way to modify it so that it is backwards compatible?

pevik commented 4 months ago

Thanks for a detailed table.

@metan-ucw @mdoucha know more than me. AFAIK we noticed at least incorrect errno EISDIR (obviously there is also ENODATA) and hang on TST_FD_EPOLL (I did not know about the following hangs), although AFAIK we did not reported it to the kernel mainline ML (lore).

splice07 seems to depend on https://github.com/torvalds/linux/commit/36e2c7421f02a22f71c9283e55fdb672a9eb58e7 ("fs: don't allow splice read/write without explicit ops") to pass.

Yes (https://lore.kernel.org/ltp/ZbO-Pl9S7KH2cKkb@yuki/).

FYI before the latest release we whitelisted 2 cases: (c04218579773e3c7017a87d8bb121771e3e0f09c, e5970b2e64c3add251bed820f93443322b1eda05) and had a plan to add tests which actually test splice() on /dev/zero and /proc/self/maps for kernels between v4.4 and v5.3 where it was working (https://lore.kernel.org/ltp/20240126132046.GA508599@pevik/).

mdoucha commented 4 months ago

The right approach would be to fix the kernel since all these failures are kernel bugs (maybe except for inotify -> writable pipe). It does not make sense to modify the test, not even to add a kernel version check.