@@ -489,12 +489,11 @@ static __always_inline int jbd2_do_replay(journal_t *journal,
489
489
struct recovery_info * info ,
490
490
struct buffer_head * bh ,
491
491
unsigned long * next_log_block ,
492
- unsigned int next_commit_ID ,
493
- int * success )
492
+ unsigned int next_commit_ID )
494
493
{
495
494
char * tagp ;
496
495
int flags ;
497
- int err ;
496
+ int ret = 0 ;
498
497
int tag_bytes = journal_tag_bytes (journal );
499
498
int descr_csum_size = 0 ;
500
499
unsigned long io_block ;
@@ -508,6 +507,7 @@ static __always_inline int jbd2_do_replay(journal_t *journal,
508
507
tagp = & bh -> b_data [sizeof (journal_header_t )];
509
508
while (tagp - bh -> b_data + tag_bytes <=
510
509
journal -> j_blocksize - descr_csum_size ) {
510
+ int err ;
511
511
512
512
memcpy (& tag , tagp , sizeof (tag ));
513
513
flags = be16_to_cpu (tag .t_flags );
@@ -517,7 +517,7 @@ static __always_inline int jbd2_do_replay(journal_t *journal,
517
517
err = jread (& obh , journal , io_block );
518
518
if (err ) {
519
519
/* Recover what we can, but report failure at the end. */
520
- * success = err ;
520
+ ret = err ;
521
521
pr_err ("JBD2: IO error %d recovering block %lu in log\n" ,
522
522
err , io_block );
523
523
} else {
@@ -539,7 +539,7 @@ static __always_inline int jbd2_do_replay(journal_t *journal,
539
539
(journal_block_tag3_t * )tagp ,
540
540
obh -> b_data , next_commit_ID )) {
541
541
brelse (obh );
542
- * success = - EFSBADCRC ;
542
+ ret = - EFSBADCRC ;
543
543
pr_err ("JBD2: Invalid checksum recovering data block %llu in journal block %lu\n" ,
544
544
blocknr , io_block );
545
545
goto skip_write ;
@@ -580,7 +580,7 @@ static __always_inline int jbd2_do_replay(journal_t *journal,
580
580
break ;
581
581
}
582
582
583
- return 0 ;
583
+ return ret ;
584
584
}
585
585
586
586
static int do_one_pass (journal_t * journal ,
@@ -719,9 +719,12 @@ static int do_one_pass(journal_t *journal,
719
719
* done here!
720
720
*/
721
721
err = jbd2_do_replay (journal , info , bh , & next_log_block ,
722
- next_commit_ID , & success );
723
- if (err )
724
- goto failed ;
722
+ next_commit_ID );
723
+ if (err ) {
724
+ if (err == - ENOMEM )
725
+ goto failed ;
726
+ success = err ;
727
+ }
725
728
726
729
continue ;
727
730
0 commit comments