Skip to content

Commit e857271

Browse files
jmberggregkh
authored andcommitted
fs/pipe: allow sendfile() to pipe again
commit f8ad818 upstream. After commit 36e2c74 ("fs: don't allow splice read/write without explicit ops") sendfile() could no longer send data from a real file to a pipe, breaking for example certain cgit setups (e.g. when running behind fcgiwrap), because in this case cgit will try to do exactly this: sendfile() to a pipe. Fix this by using iter_file_splice_write for the splice_write method of pipes, as suggested by Christoph. Cc: stable@vger.kernel.org Fixes: 36e2c74 ("fs: don't allow splice read/write without explicit ops") Suggested-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Tested-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent eb5381e commit e857271

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/pipe.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,7 @@ const struct file_operations pipefifo_fops = {
12061206
.unlocked_ioctl = pipe_ioctl,
12071207
.release = pipe_release,
12081208
.fasync = pipe_fasync,
1209+
.splice_write = iter_file_splice_write,
12091210
};
12101211

12111212
/*

0 commit comments

Comments
 (0)