public inbox for linux-ext4@vger.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: check err when partial != NULL
Date: Tue, 5 Nov 2019 10:41:54 +0100	[thread overview]
Message-ID: <20191105094154.GK22379@quack2.suse.cz> (raw)
In-Reply-To: <20191105045100.7104-1-cgxu519@mykernel.net>

On Tue 05-11-19 12:51:00, Chengguang Xu wrote:
> Check err when partial == NULL is meaningless because
> partial == NULL means getting branch successfully without
> error.
> 
> Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>

Good catch! Added to my tree. Thanks!

							Honza

> ---
>  fs/ext2/inode.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
> index 7004ce581a32..a16c53655e77 100644
> --- a/fs/ext2/inode.c
> +++ b/fs/ext2/inode.c
> @@ -701,10 +701,13 @@ static int ext2_get_blocks(struct inode *inode,
>  		if (!partial) {
>  			count++;
>  			mutex_unlock(&ei->truncate_mutex);
> -			if (err)
> -				goto cleanup;
>  			goto got_it;
>  		}
> +
> +		if (err) {
> +			mutex_unlock(&ei->truncate_mutex);
> +			goto cleanup;
> +		}
>  	}
>  
>  	/*
> -- 
> 2.20.1
> 
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2019-11-05  9:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05  4:51 [PATCH] ext2: check err when partial != NULL Chengguang Xu
2019-11-05  9:41 ` 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=20191105094154.GK22379@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox