aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2
diff options
context:
space:
mode:
authorDuane Griffin <duaneg@dghda.com>2008-04-29 22:02:47 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-04-29 22:02:47 -0400
commit620de4e19890c623eb4ba293ec19b42e2e391b89 (patch)
treeaa10ed1a0f8321ab91b68568a2a9ece4b74e51a3 /fs/jbd2
parent5648ba5b2dc0d07a8108fabc7b9100962e9e1d88 (diff)
jbd2: only create debugfs and stats entries if init is successful
jbd2 debugfs and stats entries should only be created if cache initialisation is successful. At the moment they are being created unconditionally which will leave them dangling if cache (and hence module) initialisation fails. Signed-off-by: Duane Griffin <duaneg@dghda.com> Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2')
-rw-r--r--fs/jbd2/journal.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index d707a219e21b..64356e85a10f 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2307,10 +2307,12 @@ static int __init journal_init(void)
2307 BUILD_BUG_ON(sizeof(struct journal_superblock_s) != 1024); 2307 BUILD_BUG_ON(sizeof(struct journal_superblock_s) != 1024);
2308 2308
2309 ret = journal_init_caches(); 2309 ret = journal_init_caches();
2310 if (ret != 0) 2310 if (ret == 0) {
2311 jbd2_create_debugfs_entry();
2312 jbd2_create_jbd_stats_proc_entry();
2313 } else {
2311 jbd2_journal_destroy_caches(); 2314 jbd2_journal_destroy_caches();
2312 jbd2_create_debugfs_entry(); 2315 }
2313 jbd2_create_jbd_stats_proc_entry();
2314 return ret; 2316 return ret;
2315} 2317}
2316 2318