* [patch 13/21] vfs: remove redundant position check in do_sendfile
@ 2009-09-18 20:05 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2009-09-18 20:05 UTC (permalink / raw)
To: viro; +Cc: linux-fsdevel, akpm, jlayton, hannes, hch, msb, rlove
From: Jeff Layton <jlayton@redhat.com>
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>
---
fs/read_write.c | 3 ---
1 file changed, 3 deletions(-)
diff -puN fs/read_write.c~vfs-remove-redundant-position-check-in-do_sendfile fs/read_write.c
--- a/fs/read_write.c~vfs-remove-redundant-position-check-in-do_sendfile
+++ a/fs/read_write.c
@@ -839,9 +839,6 @@ static ssize_t do_sendfile(int out_fd, i
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)
_
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-18 20:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-18 20:05 [patch 13/21] vfs: remove redundant position check in do_sendfile akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).