From 64522c903c51b16af6b1f3b8020d90f26618f449 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 9 Sep 2022 09:05:13 +0200 Subject: [PATCH] Revert "fs: check FMODE_LSEEK to control internal pipe splicing" This reverts commit ab37175dd3593b9098f2242e370a7b1af4c35368 which is commit 97ef77c52b789ec1411d360ed99dca1efe4b2c81 upstream. It causes VTS failures for some reason and needs to be reverted for now until the root cause is tracked down. Bug: 247779313 Signed-off-by: Greg Kroah-Hartman Change-Id: I19341cd7c5cf90780804e77dbbf2e32ecc2644fc --- fs/splice.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/splice.c b/fs/splice.c index ae5623244d5e..e509239d7e06 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -895,15 +895,17 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, { struct pipe_inode_info *pipe; long ret, bytes; + umode_t i_mode; size_t len; int i, flags, more; /* - * We require the input to be seekable, as we don't want to randomly - * drop data for eg socket -> socket splicing. Use the piped splicing - * for that! + * We require the input being a regular file, as we don't want to + * randomly drop data for eg socket -> socket splicing. Use the + * piped splicing for that! */ - if (unlikely(!(in->f_mode & FMODE_LSEEK))) + i_mode = file_inode(in)->i_mode; + if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode))) return -EINVAL; /*