aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/journal.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r--fs/jbd2/journal.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index b0ab5219becb..17af879e6e9e 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -78,6 +78,7 @@ EXPORT_SYMBOL(jbd2_journal_errno);
78EXPORT_SYMBOL(jbd2_journal_ack_err); 78EXPORT_SYMBOL(jbd2_journal_ack_err);
79EXPORT_SYMBOL(jbd2_journal_clear_err); 79EXPORT_SYMBOL(jbd2_journal_clear_err);
80EXPORT_SYMBOL(jbd2_log_wait_commit); 80EXPORT_SYMBOL(jbd2_log_wait_commit);
81EXPORT_SYMBOL(jbd2_log_start_commit);
81EXPORT_SYMBOL(jbd2_journal_start_commit); 82EXPORT_SYMBOL(jbd2_journal_start_commit);
82EXPORT_SYMBOL(jbd2_journal_force_commit_nested); 83EXPORT_SYMBOL(jbd2_journal_force_commit_nested);
83EXPORT_SYMBOL(jbd2_journal_wipe); 84EXPORT_SYMBOL(jbd2_journal_wipe);
@@ -358,6 +359,10 @@ repeat:
358 359
359 jbd_unlock_bh_state(bh_in); 360 jbd_unlock_bh_state(bh_in);
360 tmp = jbd2_alloc(bh_in->b_size, GFP_NOFS); 361 tmp = jbd2_alloc(bh_in->b_size, GFP_NOFS);
362 if (!tmp) {
363 jbd2_journal_put_journal_head(new_jh);
364 return -ENOMEM;
365 }
361 jbd_lock_bh_state(bh_in); 366 jbd_lock_bh_state(bh_in);
362 if (jh_in->b_frozen_data) { 367 if (jh_in->b_frozen_data) {
363 jbd2_free(tmp, bh_in->b_size); 368 jbd2_free(tmp, bh_in->b_size);
@@ -913,6 +918,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
913 918
914 return journal; 919 return journal;
915out_err: 920out_err:
921 kfree(journal->j_wbuf);
916 jbd2_stats_proc_exit(journal); 922 jbd2_stats_proc_exit(journal);
917 kfree(journal); 923 kfree(journal);
918 return NULL; 924 return NULL;
@@ -986,6 +992,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode)
986 992
987 return journal; 993 return journal;
988out_err: 994out_err:
995 kfree(journal->j_wbuf);
989 jbd2_stats_proc_exit(journal); 996 jbd2_stats_proc_exit(journal);
990 kfree(journal); 997 kfree(journal);
991 return NULL; 998 return NULL;
@@ -1246,6 +1253,13 @@ int jbd2_journal_load(journal_t *journal)
1246 if (jbd2_journal_recover(journal)) 1253 if (jbd2_journal_recover(journal))
1247 goto recovery_error; 1254 goto recovery_error;
1248 1255
1256 if (journal->j_failed_commit) {
1257 printk(KERN_ERR "JBD2: journal transaction %u on %s "
1258 "is corrupt.\n", journal->j_failed_commit,
1259 journal->j_devname);
1260 return -EIO;
1261 }
1262
1249 /* OK, we've finished with the dynamic journal bits: 1263 /* OK, we've finished with the dynamic journal bits:
1250 * reinitialise the dynamic contents of the superblock in memory 1264 * reinitialise the dynamic contents of the superblock in memory
1251 * and reset them on disk. */ 1265 * and reset them on disk. */
@@ -2101,7 +2115,8 @@ static void __init jbd2_create_debugfs_entry(void)
2101{ 2115{
2102 jbd2_debugfs_dir = debugfs_create_dir("jbd2", NULL); 2116 jbd2_debugfs_dir = debugfs_create_dir("jbd2", NULL);
2103 if (jbd2_debugfs_dir) 2117 if (jbd2_debugfs_dir)
2104 jbd2_debug = debugfs_create_u8(JBD2_DEBUG_NAME, S_IRUGO, 2118 jbd2_debug = debugfs_create_u8(JBD2_DEBUG_NAME,
2119 S_IRUGO | S_IWUSR,
2105 jbd2_debugfs_dir, 2120 jbd2_debugfs_dir,
2106 &jbd2_journal_enable_debug); 2121 &jbd2_journal_enable_debug);
2107} 2122}