@@ -728,6 +728,11 @@ static int do_one_pass(journal_t *journal,
728
728
continue ;
729
729
730
730
case JBD2_COMMIT_BLOCK :
731
+ if (pass != PASS_SCAN ) {
732
+ next_commit_ID ++ ;
733
+ continue ;
734
+ }
735
+
731
736
/* How to differentiate between interrupted commit
732
737
* and journal corruption ?
733
738
*
@@ -790,8 +795,7 @@ static int do_one_pass(journal_t *journal,
790
795
* much to do other than move on to the next sequence
791
796
* number.
792
797
*/
793
- if (pass == PASS_SCAN &&
794
- jbd2_has_feature_checksum (journal )) {
798
+ if (jbd2_has_feature_checksum (journal )) {
795
799
struct commit_header * cbh =
796
800
(struct commit_header * )bh -> b_data ;
797
801
unsigned found_chksum =
@@ -815,34 +819,33 @@ static int do_one_pass(journal_t *journal,
815
819
goto chksum_error ;
816
820
817
821
crc32_sum = ~0 ;
822
+ goto chksum_ok ;
818
823
}
819
- if (pass == PASS_SCAN &&
820
- !jbd2_commit_block_csum_verify (journal ,
821
- bh -> b_data )) {
822
- if (jbd2_commit_block_csum_verify_partial (
823
- journal ,
824
- bh -> b_data )) {
825
- pr_notice ("JBD2: Find incomplete commit block in transaction %u block %lu\n" ,
826
- next_commit_ID , next_log_block );
827
- goto chksum_ok ;
828
- }
829
- chksum_error :
830
- if (commit_time < last_trans_commit_time )
831
- goto ignore_crc_mismatch ;
832
- info -> end_transaction = next_commit_ID ;
833
- info -> head_block = head_block ;
834
824
835
- if (!jbd2_has_feature_async_commit (journal )) {
836
- journal -> j_failed_commit =
837
- next_commit_ID ;
838
- break ;
839
- }
825
+ if (jbd2_commit_block_csum_verify (journal , bh -> b_data ))
826
+ goto chksum_ok ;
827
+
828
+ if (jbd2_commit_block_csum_verify_partial (journal ,
829
+ bh -> b_data )) {
830
+ pr_notice ("JBD2: Find incomplete commit block in transaction %u block %lu\n" ,
831
+ next_commit_ID , next_log_block );
832
+ goto chksum_ok ;
840
833
}
841
- if (pass == PASS_SCAN ) {
842
- chksum_ok :
843
- last_trans_commit_time = commit_time ;
844
- head_block = next_log_block ;
834
+
835
+ chksum_error :
836
+ if (commit_time < last_trans_commit_time )
837
+ goto ignore_crc_mismatch ;
838
+ info -> end_transaction = next_commit_ID ;
839
+ info -> head_block = head_block ;
840
+
841
+ if (!jbd2_has_feature_async_commit (journal )) {
842
+ journal -> j_failed_commit = next_commit_ID ;
843
+ break ;
845
844
}
845
+
846
+ chksum_ok :
847
+ last_trans_commit_time = commit_time ;
848
+ head_block = next_log_block ;
846
849
next_commit_ID ++ ;
847
850
continue ;
848
851
0 commit comments