* [PATCH -next] jbd2: add miss release buffer head in fc_do_one_pass()
@ 2022-09-17 9:38 Ye Bin
2022-09-19 12:43 ` Jan Kara
2022-09-30 3:19 ` Theodore Ts'o
0 siblings, 2 replies; 3+ messages in thread
From: Ye Bin @ 2022-09-17 9:38 UTC (permalink / raw)
To: tytso, adilger.kernel, linux-ext4; +Cc: linux-kernel, jack, Ye Bin
In fc_do_one_pass() miss release buffer head after use which will lead
to reference count leak.
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
fs/jbd2/recovery.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
index 1f878c315b03..8286a9ec122f 100644
--- a/fs/jbd2/recovery.c
+++ b/fs/jbd2/recovery.c
@@ -261,6 +261,7 @@ static int fc_do_one_pass(journal_t *journal,
err = journal->j_fc_replay_callback(journal, bh, pass,
next_fc_block - journal->j_fc_first,
expected_commit_id);
+ brelse(bh);
next_fc_block++;
if (err < 0 || err == JBD2_FC_REPLAY_STOP)
break;
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] jbd2: add miss release buffer head in fc_do_one_pass()
2022-09-17 9:38 [PATCH -next] jbd2: add miss release buffer head in fc_do_one_pass() Ye Bin
@ 2022-09-19 12:43 ` Jan Kara
2022-09-30 3:19 ` Theodore Ts'o
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2022-09-19 12:43 UTC (permalink / raw)
To: Ye Bin; +Cc: tytso, adilger.kernel, linux-ext4, linux-kernel, jack
On Sat 17-09-22 17:38:05, Ye Bin wrote:
> In fc_do_one_pass() miss release buffer head after use which will lead
> to reference count leak.
>
> Signed-off-by: Ye Bin <yebin10@huawei.com>
Indeed. Good catch! Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/jbd2/recovery.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
> index 1f878c315b03..8286a9ec122f 100644
> --- a/fs/jbd2/recovery.c
> +++ b/fs/jbd2/recovery.c
> @@ -261,6 +261,7 @@ static int fc_do_one_pass(journal_t *journal,
> err = journal->j_fc_replay_callback(journal, bh, pass,
> next_fc_block - journal->j_fc_first,
> expected_commit_id);
> + brelse(bh);
> next_fc_block++;
> if (err < 0 || err == JBD2_FC_REPLAY_STOP)
> break;
> --
> 2.31.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] jbd2: add miss release buffer head in fc_do_one_pass()
2022-09-17 9:38 [PATCH -next] jbd2: add miss release buffer head in fc_do_one_pass() Ye Bin
2022-09-19 12:43 ` Jan Kara
@ 2022-09-30 3:19 ` Theodore Ts'o
1 sibling, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2022-09-30 3:19 UTC (permalink / raw)
To: linux-ext4, adilger.kernel, yebin10; +Cc: Theodore Ts'o, linux-kernel, jack
On Sat, 17 Sep 2022 17:38:05 +0800, Ye Bin wrote:
> In fc_do_one_pass() miss release buffer head after use which will lead
> to reference count leak.
>
>
Applied, thanks!
[1/1] jbd2: add miss release buffer head in fc_do_one_pass()
commit: 0f04cd3834a988a9c725fd396e3f88fe334f9f29
Best regards,
--
Theodore Ts'o <tytso@mit.edu>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-30 3:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17 9:38 [PATCH -next] jbd2: add miss release buffer head in fc_do_one_pass() Ye Bin
2022-09-19 12:43 ` Jan Kara
2022-09-30 3:19 ` Theodore 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).