The patch titled vfs: remove redundant checks in do_sendfile has been added to the -mm tree. Its filename is vfs-remove-redundant-checks-in-do_sendfile.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: vfs: remove redundant checks in do_sendfile From: Jeff Layton <jlayton@xxxxxxxxxx> As Johannes Weiner pointed out, a couple of the range checks in do_sendfile are redundant and are already checked in rw_verify_area. Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Robert Love <rlove@xxxxxxxxxx> Cc: Mandeep Singh Baines <msb@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/read_write.c | 11 ----------- 1 file changed, 11 deletions(-) diff -puN fs/read_write.c~vfs-remove-redundant-checks-in-do_sendfile fs/read_write.c --- a/fs/read_write.c~vfs-remove-redundant-checks-in-do_sendfile +++ a/fs/read_write.c @@ -792,7 +792,6 @@ static ssize_t do_sendfile(int out_fd, i { struct file * in_file, * out_file; struct inode * in_inode, * out_inode; - loff_t pos; ssize_t retval; int fput_needed_in, fput_needed_out, fl; @@ -838,17 +837,7 @@ static ssize_t do_sendfile(int out_fd, i if (!max) 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) - goto fput_out; - count = max - pos; - } - fl = 0; #if 0 /* _ Patches currently in -mm which might be from jlayton@xxxxxxxxxx are vfs-make-get_sb_pseudo-set-s_maxbytes-to-value-that-can-be-cast-to-signed.patch vfs-explicitly-cast-s_maxbytes-in-fiemap_check_ranges.patch vfs-change-sb-s_maxbytes-to-a-loff_t.patch vfs-remove-redundant-checks-in-do_sendfile.patch vfs-remove-redundant-position-check-in-do_sendfile.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html