]> git.ipfire.org Git - thirdparty/systemd.git/commit
copy: retire splice use() for copying files on disk
authorLennart Poettering <lennart@amutable.com>
Tue, 12 May 2026 14:13:36 +0000 (16:13 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 13 May 2026 14:29:36 +0000 (15:29 +0100)
commit94e05aca0d1f8f37a4656947f6bf0aa77594364c
tree65ac5bf1e8f181655430639ebeaa8d81c2e18b59
parent3061ec2707c626ebdee0de03b130bca79727d70e
copy: retire splice use() for copying files on disk

Apparently splice() is quite problematic, hence just don't anymore. It's
also unnecessary these days since either copy_file_range() or sendfile()
nowadays typically work, the splice() fallback doesn't give us much
anymore.

(At least I am not aware of a combo of fds where splice() would work
where neither cfr nor sf would work).

This leaves one use of splice() in place, in
src/shared/socket-forward.c. We should probably kill that too, but
that'd require some reworking to use sendfile() I guess, and I am too
lazy for that right now. Moreover, in contrast to the other uses it's
probably even safe, since it uses an intermediary pipe always. But what
do I know...

Fixes: #29044
src/import/export-tar.c
src/shared/copy.c