All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, hch@infradead.org, rlove@google.com,
	msb@google.com, viro@zeniv.linux.org.uk
Subject: Re: [PATCH 2/3] vfs: remove redundant position check in do_sendfile
Date: Mon, 10 Aug 2009 16:56:41 +0200	[thread overview]
Message-ID: <20090810145641.GB4925@cmpxchg.org> (raw)
In-Reply-To: <1249906663-7572-3-git-send-email-jlayton@redhat.com>

On Mon, Aug 10, 2009 at 08:17:42AM -0400, Jeff Layton wrote:
> 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>

Thanks!

> ---
>  fs/read_write.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 6c8c55d..3ac2898 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)
> -- 
> 1.6.0.6

  reply	other threads:[~2009-08-10 14:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-10 12:17 [PATCH 0/3] vfs: change sb->s_maxbytes to loff_t (try #2) Jeff Layton
2009-08-10 12:17 ` [PATCH 1/3] vfs: make get_sb_pseudo set s_maxbytes to value that can be cast to signed Jeff Layton
2009-08-10 13:49   ` Christoph Hellwig
2009-08-10 14:08     ` Jeff Layton
2009-08-10 14:16       ` Christoph Hellwig
2009-08-10 12:17 ` [PATCH 2/3] vfs: remove redundant position check in do_sendfile Jeff Layton
2009-08-10 14:56   ` Johannes Weiner [this message]
2009-08-10 12:17 ` [PATCH 3/3] vfs: change sb->s_maxbytes to a loff_t Jeff Layton
2009-08-10 21:24   ` Mandeep Singh Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090810145641.GB4925@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msb@google.com \
    --cc=rlove@google.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.