diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-13 11:35:09 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-13 11:35:09 -0500 |
commit | bc7ecbcbc2c0ff235382077b55de7896775afc16 (patch) | |
tree | 9918b2f3fdeebd9c99a308af94d86bc13c80d0c8 /fs/jbd2 | |
parent | c52854018ad123c9ef83867462457b75bb56d452 (diff) | |
parent | 285eae0a4ba0f467341476fd4c6981e5cdafc6be (diff) |
Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into devel
Diffstat (limited to 'fs/jbd2')
-rw-r--r-- | fs/jbd2/commit.c | 6 | ||||
-rw-r--r-- | fs/jbd2/journal.c | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index d4cfd6d2779e..6a10238d2c63 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
@@ -286,7 +286,7 @@ static int journal_finish_inode_data_buffers(journal_t *journal, | |||
286 | if (err) { | 286 | if (err) { |
287 | /* | 287 | /* |
288 | * Because AS_EIO is cleared by | 288 | * Because AS_EIO is cleared by |
289 | * wait_on_page_writeback_range(), set it again so | 289 | * filemap_fdatawait_range(), set it again so |
290 | * that user process can get -EIO from fsync(). | 290 | * that user process can get -EIO from fsync(). |
291 | */ | 291 | */ |
292 | set_bit(AS_EIO, | 292 | set_bit(AS_EIO, |
@@ -636,6 +636,10 @@ void jbd2_journal_commit_transaction(journal_t *journal) | |||
636 | JBUFFER_TRACE(jh, "ph3: write metadata"); | 636 | JBUFFER_TRACE(jh, "ph3: write metadata"); |
637 | flags = jbd2_journal_write_metadata_buffer(commit_transaction, | 637 | flags = jbd2_journal_write_metadata_buffer(commit_transaction, |
638 | jh, &new_jh, blocknr); | 638 | jh, &new_jh, blocknr); |
639 | if (flags < 0) { | ||
640 | jbd2_journal_abort(journal, flags); | ||
641 | continue; | ||
642 | } | ||
639 | set_bit(BH_JWrite, &jh2bh(new_jh)->b_state); | 643 | set_bit(BH_JWrite, &jh2bh(new_jh)->b_state); |
640 | wbuf[bufs++] = jh2bh(new_jh); | 644 | wbuf[bufs++] = jh2bh(new_jh); |
641 | 645 | ||
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index fed85388ee86..b7ca3a92a4db 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -78,6 +78,7 @@ EXPORT_SYMBOL(jbd2_journal_errno); | |||
78 | EXPORT_SYMBOL(jbd2_journal_ack_err); | 78 | EXPORT_SYMBOL(jbd2_journal_ack_err); |
79 | EXPORT_SYMBOL(jbd2_journal_clear_err); | 79 | EXPORT_SYMBOL(jbd2_journal_clear_err); |
80 | EXPORT_SYMBOL(jbd2_log_wait_commit); | 80 | EXPORT_SYMBOL(jbd2_log_wait_commit); |
81 | EXPORT_SYMBOL(jbd2_log_start_commit); | ||
81 | EXPORT_SYMBOL(jbd2_journal_start_commit); | 82 | EXPORT_SYMBOL(jbd2_journal_start_commit); |
82 | EXPORT_SYMBOL(jbd2_journal_force_commit_nested); | 83 | EXPORT_SYMBOL(jbd2_journal_force_commit_nested); |
83 | EXPORT_SYMBOL(jbd2_journal_wipe); | 84 | EXPORT_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); |
@@ -1248,6 +1253,13 @@ int jbd2_journal_load(journal_t *journal) | |||
1248 | if (jbd2_journal_recover(journal)) | 1253 | if (jbd2_journal_recover(journal)) |
1249 | goto recovery_error; | 1254 | goto recovery_error; |
1250 | 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 | |||
1251 | /* OK, we've finished with the dynamic journal bits: | 1263 | /* OK, we've finished with the dynamic journal bits: |
1252 | * reinitialise the dynamic contents of the superblock in memory | 1264 | * reinitialise the dynamic contents of the superblock in memory |
1253 | * and reset them on disk. */ | 1265 | * and reset them on disk. */ |