All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] JBD/JBD2: free j_wbuf if journal init fails.
@ 2009-11-10  9:13 Tao Ma
  2009-11-10 21:22 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Tao Ma @ 2009-11-10  9:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: sunil.mushran, Tao Ma, Andrew Morton, Jan Kara

If journal init fails, we need to free j_wbuf.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Tao Ma <tao.ma@oracle.com>
---
 fs/jbd/journal.c  |    2 ++
 fs/jbd2/journal.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index bd3c073..49d5cd6 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -756,6 +756,7 @@ journal_t * journal_init_dev(struct block_device *bdev,
 
 	return journal;
 out_err:
+	kfree(journal->j_wbuf);
 	kfree(journal);
 	return NULL;
 }
@@ -820,6 +821,7 @@ journal_t * journal_init_inode (struct inode *inode)
 
 	return journal;
 out_err:
+	kfree(journal->j_wbuf);
 	kfree(journal);
 	return NULL;
 }
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index b0ab521..fed8538 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -913,6 +913,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
 
 	return journal;
 out_err:
+	kfree(journal->j_wbuf);
 	jbd2_stats_proc_exit(journal);
 	kfree(journal);
 	return NULL;
@@ -986,6 +987,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode)
 
 	return journal;
 out_err:
+	kfree(journal->j_wbuf);
 	jbd2_stats_proc_exit(journal);
 	kfree(journal);
 	return NULL;
-- 
1.5.4.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] JBD/JBD2: free j_wbuf if journal init fails.
  2009-11-10  9:13 [PATCH] JBD/JBD2: free j_wbuf if journal init fails Tao Ma
@ 2009-11-10 21:22 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2009-11-10 21:22 UTC (permalink / raw)
  To: Tao Ma; +Cc: linux-kernel, sunil.mushran, Andrew Morton, Jan Kara

On Tue 10-11-09 17:13:22, Tao Ma wrote:
> If journal init fails, we need to free j_wbuf.
  Thanks, added to my tree.

							Honza
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Jan Kara <jack@suse.cz>
> Signed-off-by: Tao Ma <tao.ma@oracle.com>
> ---
>  fs/jbd/journal.c  |    2 ++
>  fs/jbd2/journal.c |    2 ++
>  2 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
> index bd3c073..49d5cd6 100644
> --- a/fs/jbd/journal.c
> +++ b/fs/jbd/journal.c
> @@ -756,6 +756,7 @@ journal_t * journal_init_dev(struct block_device *bdev,
>  
>  	return journal;
>  out_err:
> +	kfree(journal->j_wbuf);
>  	kfree(journal);
>  	return NULL;
>  }
> @@ -820,6 +821,7 @@ journal_t * journal_init_inode (struct inode *inode)
>  
>  	return journal;
>  out_err:
> +	kfree(journal->j_wbuf);
>  	kfree(journal);
>  	return NULL;
>  }
> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
> index b0ab521..fed8538 100644
> --- a/fs/jbd2/journal.c
> +++ b/fs/jbd2/journal.c
> @@ -913,6 +913,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
>  
>  	return journal;
>  out_err:
> +	kfree(journal->j_wbuf);
>  	jbd2_stats_proc_exit(journal);
>  	kfree(journal);
>  	return NULL;
> @@ -986,6 +987,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode)
>  
>  	return journal;
>  out_err:
> +	kfree(journal->j_wbuf);
>  	jbd2_stats_proc_exit(journal);
>  	kfree(journal);
>  	return NULL;
> -- 
> 1.5.4.4
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-10 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-10  9:13 [PATCH] JBD/JBD2: free j_wbuf if journal init fails Tao Ma
2009-11-10 21:22 ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.