+ bh->b_end_io = journal_end_buffer_io_sync;
+
+ if (journal->j_flags & JFS_BARRIER &&
-+ !JFS_HAS_COMPAT_FEATURE(journal,
++ !JFS_HAS_INCOMPAT_FEATURE(journal,
+ JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)) {
+
set_buffer_ordered(bh);
- ret = sync_dirty_buffer(bh);
+ ret = submit_bh(WRITE, bh);
+
+ if (barrier_done)
+ clear_buffer_ordered(bh);
/* is it possible for another commit to fail at roughly
- * the same time as this one? If so, we don't want to
- * trust the barrier flag in the super, but instead want
@@ -153,12 +172,84 @@ static int journal_write_commit_record(j
clear_buffer_ordered(bh);
set_buffer_uptodate(bh);
/*
* First job: lock down the current transaction and wait for
-@@ -395,37 +488,14 @@ write_out_data:
+@@ -395,38 +488,15 @@ write_out_data:
}
/*
+ * Wait for all previously submitted IO to complete if commit
+ * record is to be written synchronously.
*/
+ spin_lock(&journal->j_list_lock);
- while (commit_transaction->t_locked_list) {
- struct buffer_head *bh;
+ if (!JFS_HAS_INCOMPAT_FEATURE(journal,
+#define JFS_KNOWN_COMPAT_FEATURES JFS_FEATURE_COMPAT_CHECKSUM
#define JFS_KNOWN_ROCOMPAT_FEATURES 0
-#define JFS_KNOWN_INCOMPAT_FEATURES JFS_FEATURE_INCOMPAT_REVOKE
-+#define JFS_KNOWN_INCOMPAT_FEATURES JFS_FEATURE_INCOMPAT_REVOKE | \
-+ JFS_FEATURE_INCOMPAT_ASYNC_COMMIT
++#define JFS_KNOWN_INCOMPAT_FEATURES (JFS_FEATURE_INCOMPAT_REVOKE | \
++ JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)
#ifdef __KERNEL__
#endif
/*
-@@ -307,6 +308,37 @@ int journal_skip_recovery(journal_t *jou
+@@ -307,6 +308,38 @@ int journal_skip_recovery(journal_t *jou
return err;
}
+ *crc32_sum = crc32_be(*crc32_sum, (void *)obh->b_data,
+ obh->b_size);
+ }
++ put_bh(obh);
+ }
+ return 0;
+}
static int do_one_pass(journal_t *journal,
struct recovery_info *info, enum passtype pass)
{
-@@ -318,6 +350,7 @@ static int do_one_pass(journal_t *journa
+@@ -318,6 +351,7 @@ static int do_one_pass(journal_t *journa
struct buffer_head * bh;
unsigned int sequence;
int blocktype;
/* Precompute the maximum metadata descriptors in a descriptor block */
int MAX_BLOCKS_PER_DESC;
-@@ -409,9 +442,24 @@ static int do_one_pass(journal_t *journa
+@@ -409,9 +443,24 @@ static int do_one_pass(journal_t *journa
switch(blocktype) {
case JFS_DESCRIPTOR_BLOCK:
/* If it is a valid descriptor block, replay it
next_log_block +=
count_tags(bh, journal->j_blocksize);
wrap(journal, next_log_block);
-@@ -506,9 +554,97 @@ static int do_one_pass(journal_t *journa
+@@ -506,9 +555,97 @@ static int do_one_pass(journal_t *journa
continue;
case JFS_COMMIT_BLOCK:
+ if (chksum_err) {
+ info->end_transaction = next_commit_ID;
+
-+ if (!JFS_HAS_COMPAT_FEATURE(journal,
++ if (!JFS_HAS_INCOMPAT_FEATURE(journal,
+ JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)){
+ printk(KERN_ERR
+ "JBD: Transaction %u "
brelse(bh);
next_commit_ID++;
continue;
-@@ -543,9 +679,10 @@ static int do_one_pass(journal_t *journa
+@@ -543,9 +680,10 @@ static int do_one_pass(journal_t *journa
* transaction marks the end of the valid log.
*/