summaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2009-09-18 22:05:53 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2009-09-24 13:47:34 +0200
commitf9098980ffea9c749622ff8ddf3b6d5831902a46 (patch)
tree043b5bbb89f394c5508534d67102e8a02f6f9c64 /fs/read_write.c
parentvfs: change sb->s_maxbytes to a loff_t (diff)
downloadlinux-f9098980ffea9c749622ff8ddf3b6d5831902a46.tar.xz
linux-f9098980ffea9c749622ff8ddf3b6d5831902a46.zip
vfs: remove redundant position check in do_sendfile
As Johannes Weiner pointed out, one of the range checks in do_sendfile is redundant and is already checked in rw_verify_area. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Robert Love <rlove@google.com> Cc: Mandeep Singh Baines <msb@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index 6c8c55dec2bc..3ac28987f22a 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -839,9 +839,6 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
max = min(in_inode->i_sb->s_maxbytes, out_inode->i_sb->s_maxbytes);
pos = *ppos;
- retval = -EINVAL;
- if (unlikely(pos < 0))
- goto fput_out;
if (unlikely(pos + count > max)) {
retval = -EOVERFLOW;
if (pos >= max)