Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127934
b: refs/heads/master
c: fd98496
h: refs/heads/master
v: v3
  • Loading branch information
Theodore Ts'o committed Jan 6, 2009
1 parent 144517d commit e8cbfbc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0390131ba84fd3f726f9e24fc4553828125700bb
refs/heads/master: fd98496f467b3d26d05ab1498f41718b5ef13de5
27 changes: 25 additions & 2 deletions trunk/fs/jbd2/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/crc32.h>
#include <linux/writeback.h>
#include <linux/backing-dev.h>
#include <linux/bio.h>

/*
* Default IO end handler for temporary BJ_IO buffer_heads.
Expand Down Expand Up @@ -168,12 +169,34 @@ static int journal_submit_commit_record(journal_t *journal,
* This function along with journal_submit_commit_record
* allows to write the commit record asynchronously.
*/
static int journal_wait_on_commit_record(struct buffer_head *bh)
static int journal_wait_on_commit_record(journal_t *journal,
struct buffer_head *bh)
{
int ret = 0;

retry:
clear_buffer_dirty(bh);
wait_on_buffer(bh);
if (buffer_eopnotsupp(bh) && (journal->j_flags & JBD2_BARRIER)) {
printk(KERN_WARNING
"JBD2: wait_on_commit_record: sync failed on %s - "
"disabling barriers\n", journal->j_devname);
spin_lock(&journal->j_state_lock);
journal->j_flags &= ~JBD2_BARRIER;
spin_unlock(&journal->j_state_lock);

lock_buffer(bh);
clear_buffer_dirty(bh);
set_buffer_uptodate(bh);
bh->b_end_io = journal_end_buffer_io_sync;

ret = submit_bh(WRITE_SYNC, bh);
if (ret) {
unlock_buffer(bh);
return ret;
}
goto retry;
}

if (unlikely(!buffer_uptodate(bh)))
ret = -EIO;
Expand Down Expand Up @@ -799,7 +822,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
__jbd2_journal_abort_hard(journal);
}
if (!err && !is_journal_aborted(journal))
err = journal_wait_on_commit_record(cbh);
err = journal_wait_on_commit_record(journal, cbh);

if (err)
jbd2_journal_abort(journal, err);
Expand Down

0 comments on commit e8cbfbc

Please sign in to comment.