aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-11-10 18:32:13 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2016-11-10 18:32:13 -0500
commite519e7774784f3fa7728657d780863805ed1c983 (patch)
tree57ed4eac0972a837383976c451fe76a3003bce0f /fs
parent6d6d36bc6e77f8b1f86d81884ad5149931bb4acd (diff)
splice: remove detritus from generic_file_splice_read()
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/splice.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 153d4f3bd441..dcaf185a5731 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -299,13 +299,8 @@ ssize_t generic_file_splice_read(struct file *in, loff_t *ppos,
299{ 299{
300 struct iov_iter to; 300 struct iov_iter to;
301 struct kiocb kiocb; 301 struct kiocb kiocb;
302 loff_t isize;
303 int idx, ret; 302 int idx, ret;
304 303
305 isize = i_size_read(in->f_mapping->host);
306 if (unlikely(*ppos >= isize))
307 return 0;
308
309 iov_iter_pipe(&to, ITER_PIPE | READ, pipe, len); 304 iov_iter_pipe(&to, ITER_PIPE | READ, pipe, len);
310 idx = to.idx; 305 idx = to.idx;
311 init_sync_kiocb(&kiocb, in); 306 init_sync_kiocb(&kiocb, in);