Skip to content

Commit

Permalink
jbd2: deregister proc on failure in jbd2_journal_init_inode
Browse files Browse the repository at this point in the history
jbd2_journal_init_inode() does not call jbd2_stats_proc_exit() on all
failure paths after calling jbd2_stats_proc_init(). This leaves
dangling references to the fs in proc.

This patch fixes a bug reported by Sami Leides at:
http://bugzilla.kernel.org/show_bug.cgi?id=11493

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Sami Liedes authored and Theodore Ts'o committed Nov 3, 2008
1 parent 8c3f25d commit 2423840
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/jbd2/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode)
if (!journal->j_wbuf) {
printk(KERN_ERR "%s: Cant allocate bhs for commit thread\n",
__func__);
jbd2_stats_proc_exit(journal);
kfree(journal);
return NULL;
}
Expand All @@ -1098,6 +1099,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode)
if (err) {
printk(KERN_ERR "%s: Cannnot locate journal superblock\n",
__func__);
jbd2_stats_proc_exit(journal);
kfree(journal);
return NULL;
}
Expand Down

0 comments on commit 2423840

Please sign in to comment.