* [PATCH] ext4: remove redundant operation that set bh to NULL
@ 2020-10-20 11:41 xiakaixu1987
2020-10-21 1:10 ` zhangyi (F)
0 siblings, 1 reply; 3+ messages in thread
From: xiakaixu1987 @ 2020-10-20 11:41 UTC (permalink / raw)
To: linux-ext4; +Cc: tytso, adilger.kernel, Kaixu Xia
From: Kaixu Xia <kaixuxia@tencent.com>
The out_fail branch path don't release the bh and the second bh is
valid only in the for statement, so we don't need to set them to NULL.
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
fs/ext4/super.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 5308f0d5fb5a..3ebfabc6061a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4093,7 +4093,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
if (IS_ERR(bh)) {
ext4_msg(sb, KERN_ERR, "unable to read superblock");
ret = PTR_ERR(bh);
- bh = NULL;
goto out_fail;
}
/*
@@ -4721,7 +4720,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
"can't read group descriptor %d", i);
db_count = i;
ret = PTR_ERR(bh);
- bh = NULL;
goto failed_mount2;
}
rcu_read_lock();
--
2.20.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: remove redundant operation that set bh to NULL
2020-10-20 11:41 [PATCH] ext4: remove redundant operation that set bh to NULL xiakaixu1987
@ 2020-10-21 1:10 ` zhangyi (F)
2020-12-03 14:15 ` Theodore Y. Ts'o
0 siblings, 1 reply; 3+ messages in thread
From: zhangyi (F) @ 2020-10-21 1:10 UTC (permalink / raw)
To: xiakaixu1987, linux-ext4; +Cc: tytso, adilger.kernel, Kaixu Xia
On 2020/10/20 19:41, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
>
> The out_fail branch path don't release the bh and the second bh is
> valid only in the for statement, so we don't need to set them to NULL.
>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Thanks for the patch. It looks good to me.
Reviewed-by: zhangyi (F) <yi.zhang@huawei.com>
Yi.
> ---
> fs/ext4/super.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 5308f0d5fb5a..3ebfabc6061a 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -4093,7 +4093,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
> if (IS_ERR(bh)) {
> ext4_msg(sb, KERN_ERR, "unable to read superblock");
> ret = PTR_ERR(bh);
> - bh = NULL;
> goto out_fail;
> }
> /*
> @@ -4721,7 +4720,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
> "can't read group descriptor %d", i);
> db_count = i;
> ret = PTR_ERR(bh);
> - bh = NULL;
> goto failed_mount2;
> }
> rcu_read_lock();
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: remove redundant operation that set bh to NULL
2020-10-21 1:10 ` zhangyi (F)
@ 2020-12-03 14:15 ` Theodore Y. Ts'o
0 siblings, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-12-03 14:15 UTC (permalink / raw)
To: zhangyi (F); +Cc: xiakaixu1987, linux-ext4, adilger.kernel, Kaixu Xia
On Wed, Oct 21, 2020 at 09:10:18AM +0800, zhangyi (F) wrote:
> On 2020/10/20 19:41, xiakaixu1987@gmail.com wrote:
> > From: Kaixu Xia <kaixuxia@tencent.com>
> >
> > The out_fail branch path don't release the bh and the second bh is
> > valid only in the for statement, so we don't need to set them to NULL.
> >
> > Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
>
> Thanks for the patch. It looks good to me.
> Reviewed-by: zhangyi (F) <yi.zhang@huawei.com>
Applied, thanks.
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-03 14:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 11:41 [PATCH] ext4: remove redundant operation that set bh to NULL xiakaixu1987
2020-10-21 1:10 ` zhangyi (F)
2020-12-03 14:15 ` Theodore Y. Ts'o
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).