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

login
register
mail settings
Submitter dingdinghua
Date May 26, 2011, 2:29 a.m.
Message ID <1306376941-13349-1-git-send-email-dingdinghua@nrchpc.ac.cn>
Download mbox | patch
Permalink /patch/97486/
State Not Applicable
Headers show

Comments

dingdinghua - May 26, 2011, 2:29 a.m.
journal_get_create_access should drop jh->b_jcount in error handling path

Signed-off-by: Ding Dinghua <dingdinghua@nrchpc.ac.cn>
---
 fs/jbd/transaction.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Jan Kara - May 30, 2011, 10:32 a.m.
On Thu 26-05-11 10:29:01, Ding Dinghua wrote:
> journal_get_create_access should drop jh->b_jcount in error handling path
> 
> Signed-off-by: Ding Dinghua <dingdinghua@nrchpc.ac.cn>
  Thanks. Merged into my tree.


								Honza
> ---
>  fs/jbd/transaction.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
> index f7ee81a..3b3b01f 100644
> --- a/fs/jbd/transaction.c
> +++ b/fs/jbd/transaction.c
> @@ -844,8 +844,8 @@ int journal_get_create_access(handle_t *handle, struct buffer_head *bh)
>  	 */
>  	JBUFFER_TRACE(jh, "cancelling revoke");
>  	journal_cancel_revoke(handle, jh);
> -	journal_put_journal_head(jh);
>  out:
> +	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/jbd/transaction.c b/fs/jbd/transaction.c
index f7ee81a..3b3b01f 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -844,8 +844,8 @@  int journal_get_create_access(handle_t *handle, struct buffer_head *bh)
 	 */
 	JBUFFER_TRACE(jh, "cancelling revoke");
 	journal_cancel_revoke(handle, jh);
-	journal_put_journal_head(jh);
 out:
+	journal_put_journal_head(jh);
 	return err;
 }