From 95713b6e8b2247c55dd0a04174a55ea9a7fde7f6 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 19 Jan 2021 09:26:15 -0800 Subject: [PATCH 1/4] pipe: allow sendfile() destination with splice_write Note that Al Viro is 100% right that this isn't needed for regular splicing (that treats pipes specially, since pipes _are_ the splice buffers). So the correct thing to do is to teach do_splice_direct() the same "hey, it's already a pipe", and fix sendfile() with a pipe destination that way. But this is the one-liner "make it work" thing, rather than the "do it properly" thing that Al will hopefully do. Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") Reported-by: Johannes Berg Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Linus Torvalds --- fs/pipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/pipe.c b/fs/pipe.c index c5989cfd564d..39c96845a72f 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -1206,6 +1206,7 @@ const struct file_operations pipefifo_fops = { .unlocked_ioctl = pipe_ioctl, .release = pipe_release, .fasync = pipe_fasync, + .splice_write = iter_file_splice_write, }; /* -- 2.29.2.157.g1d47791a39