linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-ext4@vger.kernel.org, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH] ext3: Return -EINVAL when start is beyond the end of fs in ext3_trim_fs()
Date: Wed, 22 Jun 2011 20:26:14 +0200	[thread overview]
Message-ID: <20110622182614.GD26160@quack.suse.cz> (raw)
In-Reply-To: <1308732669-6674-1-git-send-email-lczerner@redhat.com>

On Wed 22-06-11 10:51:09, Lukas Czerner wrote:
> We should return -EINVAL when the FITRIM parameters are not sane, but
> currently we are exiting silently if start is beyond the end of the
> file system. This commit fixes this so we return -EINVAL as other file
> systems do.
  Thanks. Merged.

								Honza
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> CC: Jan Kara <jack@suse.cz>
> ---
>  fs/ext3/balloc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
> index fe52297..790cdf3 100644
> --- a/fs/ext3/balloc.c
> +++ b/fs/ext3/balloc.c
> @@ -2100,7 +2100,7 @@ int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range)
>  	if (unlikely(minlen > EXT3_BLOCKS_PER_GROUP(sb)))
>  		return -EINVAL;
>  	if (start >= max_blks)
> -		goto out;
> +		return -EINVAL;
>  	if (start + len > max_blks)
>  		len = max_blks - start;
>  
> -- 
> 1.7.4.4
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      reply	other threads:[~2011-06-22 18:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22  8:51 [PATCH] ext3: Return -EINVAL when start is beyond the end of fs in ext3_trim_fs() Lukas Czerner
2011-06-22 18:26 ` Jan Kara [this message]

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=20110622182614.GD26160@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    /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 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).