* [PATCH] jbd2: deregister proc on failure in jbd2_journal_init_inode
@ 2008-11-02 19:58 Sami Liedes
2008-11-02 23:48 ` Theodore Tso
0 siblings, 1 reply; 2+ messages in thread
From: Sami Liedes @ 2008-11-02 19:58 UTC (permalink / raw)
To: sct, akpm; +Cc: linux-ext4
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 bug #11493.
Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
---
I hope this is correct. I don't understand the code very well, but I
did test my patch and it seems to fix the problem. Please don't hit me
too hard, this is the first kernel patch I have ever submitted.
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 783de11..e70d657 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -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;
}
@@ -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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] jbd2: deregister proc on failure in jbd2_journal_init_inode
2008-11-02 19:58 [PATCH] jbd2: deregister proc on failure in jbd2_journal_init_inode Sami Liedes
@ 2008-11-02 23:48 ` Theodore Tso
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Tso @ 2008-11-02 23:48 UTC (permalink / raw)
To: Sami Liedes; +Cc: sct, akpm, linux-ext4
On Sun, Nov 02, 2008 at 09:58:57PM +0200, Sami Liedes wrote:
> 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 bug #11493.
>
> Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
>
> ---
>
> I hope this is correct. I don't understand the code very well, but I
> did test my patch and it seems to fix the problem. Please don't hit me
> too hard, this is the first kernel patch I have ever submitted.
The patch looks good. I'll get this into the ext4 patch queue and
queue it for submission to Linus. I normally reference kernel bugs
via the full URL, i.e:
This patch fixes a bug reported by Sami Leides at:
http://bugzilla.kernel.org/show_bug.cgi?id=11493
...but that's just a tiny nit. Thanks!!
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-02 23:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-02 19:58 [PATCH] jbd2: deregister proc on failure in jbd2_journal_init_inode Sami Liedes
2008-11-02 23:48 ` Theodore Tso
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).