Skip to contentSkip to conversation

vfs: remove redundant position check in do_sendfile

PATCH In review [email protected] 1 participant 1 message Sep 18, 2009 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 13/21 vfs: remove redundant position check in do_sendfile

From: Jeff Layton <[email protected]>

As Johannes Weiner pointed out, one of the range checks in do_sendfile is redundant and is already checked in rw_verify_area.

Cc Christoph Hellwig <[email protected]>
Cc Al Viro <[email protected]>
Cc Robert Love <[email protected]>
Cc Mandeep Singh Baines <[email protected]>

---

 fs/read_write.c |    3 ---
 1 file changed, 3 deletions(-)
fs/read_write.c renamed from fs/read_write.c~vfs-remove-redundant-position-check-in-do_sendfile +0 -3
diff -puN fs/read_write.c~vfs-remove-redundant-position-check-in-do_sendfile 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)

_