All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Chengguang Xu <cgxu519@mykernel.net>
Cc: jack@suse.com, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext2: don't set count in the case of failure
Date: Fri, 25 Oct 2019 15:02:37 +0200	[thread overview]
Message-ID: <20191025130237.GA30163@quack2.suse.cz> (raw)
In-Reply-To: <20191022092720.24416-1-cgxu519@mykernel.net>

On Tue 22-10-19 17:27:20, Chengguang Xu wrote:
> In the case of failure, the num is still initialized value 0
> so we should not set it to *count because it will bring
> unexpected side effect to the caller.
> 
> Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>

Looks good to me but please ellaborate a bit in the changelog what are
visible effects of this bug. Thanks!

								Honza

> ---
>  fs/ext2/balloc.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
> index 18e75adcd2f6..cc516c7b7974 100644
> --- a/fs/ext2/balloc.c
> +++ b/fs/ext2/balloc.c
> @@ -736,7 +736,6 @@ ext2_try_to_allocate(struct super_block *sb, int group,
>  	*count = num;
>  	return grp_goal - num;
>  fail_access:
> -	*count = num;
>  	return -1;
>  }
>  
> -- 
> 2.20.1
> 
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2019-10-25 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22  9:27 [PATCH] ext2: don't set count in the case of failure Chengguang Xu
2019-10-25 13:02 ` 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=20191025130237.GA30163@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=cgxu519@mykernel.net \
    --cc=jack@suse.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 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.