From: Jan Kara <jack@suse.cz>
To: Chengguang Xu <cgxu519@gmx.com>
Cc: jack@suse.com, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext2: remove redundant condition check
Date: Wed, 14 Nov 2018 13:15:32 +0100 [thread overview]
Message-ID: <20181114121532.GA19383@quack2.suse.cz> (raw)
In-Reply-To: <20181113232353.11011-1-cgxu519@gmx.com>
On Wed 14-11-18 07:23:53, Chengguang Xu wrote:
> ext2_xattr_destroy_cache() can handle NULL pointer correctly,
> so there is no need to check NULL pointer before calling
> ext2_xattr_destroy_cache().
>
> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Looks good. Applied. Thanks for the patch.
Honza
> ---
> fs/ext2/super.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/fs/ext2/super.c b/fs/ext2/super.c
> index cb91baa4275d..e4351c280608 100644
> --- a/fs/ext2/super.c
> +++ b/fs/ext2/super.c
> @@ -148,10 +148,9 @@ static void ext2_put_super (struct super_block * sb)
>
> ext2_quota_off_umount(sb);
>
> - if (sbi->s_ea_block_cache) {
> - ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
> - sbi->s_ea_block_cache = NULL;
> - }
> + ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
> + sbi->s_ea_block_cache = NULL;
> +
> if (!sb_rdonly(sb)) {
> struct ext2_super_block *es = sbi->s_es;
>
> @@ -1197,8 +1196,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
> sb->s_id);
> goto failed_mount;
> failed_mount3:
> - if (sbi->s_ea_block_cache)
> - ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
> + ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
> percpu_counter_destroy(&sbi->s_freeblocks_counter);
> percpu_counter_destroy(&sbi->s_freeinodes_counter);
> percpu_counter_destroy(&sbi->s_dirs_counter);
> --
> 2.17.2
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
prev parent reply other threads:[~2018-11-14 22:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-13 23:23 [PATCH] ext2: remove redundant condition check Chengguang Xu
2018-11-14 12:15 ` 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=20181114121532.GA19383@quack2.suse.cz \
--to=jack@suse.cz \
--cc=cgxu519@gmx.com \
--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;
as well as URLs for NNTP newsgroup(s).