diff options
| author | ngkaho1234 <ngkaho1234@gmail.com> | 2015-11-29 02:57:05 +0000 |
|---|---|---|
| committer | ngkaho1234 <ngkaho1234@gmail.com> | 2015-11-29 02:57:05 +0000 |
| commit | e7519e14cb64ecc2ea8dcff1207e223432dd51c3 (patch) | |
| tree | e34ddd0746b971dc6c96fe51180d22917fdbfa4b | |
| parent | 9668eacad96304fd50a6d5bf8cda00ba915108a0 (diff) | |
ext4_journal: try to detect if any blocks are revoked in a transaction.
| -rw-r--r-- | lwext4/ext4_journal.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lwext4/ext4_journal.c b/lwext4/ext4_journal.c index 6297abc..074e374 100644 --- a/lwext4/ext4_journal.c +++ b/lwext4/ext4_journal.c @@ -32,6 +32,7 @@ struct recover_info { struct replay_arg { struct recover_info *info; uint32_t *this_block; + uint32_t this_trans_id; }; static int @@ -344,13 +345,15 @@ static void jbd_replay_block_tags(struct jbd_fs *jbd_fs, struct revoke_entry *revoke_entry; struct ext4_block journal_block, ext4_block; struct ext4_fs *fs = jbd_fs->inode_ref.fs; + ext4_dbg(DEBUG_JBD, "Replaying block in block_tag: %" PRIu64 "\n", block); (*this_block)++; revoke_entry = jbd_revoke_entry_lookup(info, block); - if (revoke_entry) + if (revoke_entry && + arg->this_trans_id < revoke_entry->trans_id) return; r = jbd_block_get(jbd_fs, &journal_block, *this_block); @@ -551,6 +554,8 @@ int jbd_iterate_log(struct jbd_fs *jbd_fs, struct replay_arg replay_arg; replay_arg.info = info; replay_arg.this_block = &this_block; + replay_arg.this_trans_id = this_trans_id; + jbd_replay_descriptor_block(jbd_fs, header, &replay_arg); } |
