summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSasha Levin <sashal@kernel.org>2022-10-15 14:18:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-10-26 13:34:17 +0300
commit5ca155aa79e9b5ac14cecd0d062f1edc9fde3fbe (patch)
tree603a0d9c891f77493250020dd7a03ff9f9e1ae24
parenta3f2f5ac9d61e973e383f17a95cf2aa384e2d0c4 (diff)
downloadlinux-5ca155aa79e9b5ac14cecd0d062f1edc9fde3fbe.tar.xz
Revert "fs: check FMODE_LSEEK to control internal pipe splicing"
This reverts commit fd0a6e99b61e6c08fa5cf585d54fd956f70c73a6. Which was upstream commit 97ef77c52b789ec1411d360ed99dca1efe4b2c81. The commit is missing dependencies and breaks NFS tests, remove it for now. Reported-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/splice.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 3abcd7fbc9f2..5dbce4dcc1a7 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -814,15 +814,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;
/*