Skip to content

Commit

Permalink
splice: remove detritus from generic_file_splice_read()
Browse files Browse the repository at this point in the history
i_size check is a leftover from the horrors that used to play with
the page cache in that function.  With the switch to ->read_iter(),
it's neither needed nor correct - for gfs2 it ends up being buggy,
since i_size is not guaranteed to be correct until later (inside
->read_iter()).

Spotted-by: Abhi Das <adas@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Nov 10, 2016
1 parent 6d6d36b commit e519e77
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,8 @@ ssize_t generic_file_splice_read(struct file *in, loff_t *ppos,
{
struct iov_iter to;
struct kiocb kiocb;
loff_t isize;
int idx, ret;

isize = i_size_read(in->f_mapping->host);
if (unlikely(*ppos >= isize))
return 0;

iov_iter_pipe(&to, ITER_PIPE | READ, pipe, len);
idx = to.idx;
init_sync_kiocb(&kiocb, in);
Expand Down

0 comments on commit e519e77

Please sign in to comment.