Skip to content

Commit

Permalink
Revert "fs: check FMODE_LSEEK to control internal pipe splicing"
Browse files Browse the repository at this point in the history
This reverts commit fd0a6e9.

Which was upstream commit 97ef77c.

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>
  • Loading branch information
Sasha Levin authored and Greg Kroah-Hartman committed Oct 17, 2022
1 parent 1d0da86 commit c248c33
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit c248c33

Please sign in to comment.