Patchwork [1/2] jbd2: fix a bug of leaking jh->b_jcount

login
register
mail settings
Submitter dingdinghua
Date May 26, 2011, 2:02 a.m.
Message ID <1306375374-12619-1-git-send-email-dingdinghua@nrchpc.ac.cn>
Download mbox | patch
Permalink /patch/97484/
State Superseded
Headers show

Comments

dingdinghua - May 26, 2011, 2:02 a.m.
From: Ding Dinghua <dingdinghua@nrchpc.ac.cn>

jbd2_journal_get_create_access should drop jh->b_jount in error
handling path
---
 fs/jbd2/transaction.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
dingdinghua - May 26, 2011, 2:10 a.m.
oops, I still forget to add signoff line, please ignore this patch,
i will resend it.

2011/5/26  <dingdinghua@nrchpc.ac.cn>:
> From: Ding Dinghua <dingdinghua@nrchpc.ac.cn>
>
> jbd2_journal_get_create_access should drop jh->b_jount in error
> handling path
> ---
>  fs/jbd2/transaction.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
> index 05fa77a..d66672a 100644
> --- a/fs/jbd2/transaction.c
> +++ b/fs/jbd2/transaction.c
> @@ -921,8 +921,8 @@ int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh)
>         */
>        JBUFFER_TRACE(jh, "cancelling revoke");
>        jbd2_journal_cancel_revoke(handle, jh);
> -       jbd2_journal_put_journal_head(jh);
>  out:
> +       jbd2_journal_put_journal_head(jh);
>        return err;
>  }
>
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Patch

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 05fa77a..d66672a 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -921,8 +921,8 @@  int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh)
 	 */
 	JBUFFER_TRACE(jh, "cancelling revoke");
 	jbd2_journal_cancel_revoke(handle, jh);
-	jbd2_journal_put_journal_head(jh);
 out:
+	jbd2_journal_put_journal_head(jh);
 	return err;
 }