jbd2: remove useless 'block_error' variable

The judgement 'if (block_error && success == 0)' is never valid. Just
remove useless 'block_error' variable.

Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20240930005942.626942-6-yebin@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
pull/1083/head
Ye Bin 2024-09-30 08:59:41 +08:00 committed by Theodore Ts'o
parent ac626a3d52
commit 0f67827bf4
1 changed files with 2 additions and 7 deletions

View File

@ -490,7 +490,7 @@ static __always_inline int jbd2_do_replay(journal_t *journal,
struct buffer_head *bh, struct buffer_head *bh,
unsigned long *next_log_block, unsigned long *next_log_block,
unsigned int next_commit_ID, unsigned int next_commit_ID,
int *success, int *block_error) int *success)
{ {
char *tagp; char *tagp;
int flags; int flags;
@ -542,7 +542,6 @@ static __always_inline int jbd2_do_replay(journal_t *journal,
*success = -EFSBADCRC; *success = -EFSBADCRC;
pr_err("JBD2: Invalid checksum recovering data block %llu in journal block %lu\n", pr_err("JBD2: Invalid checksum recovering data block %llu in journal block %lu\n",
blocknr, io_block); blocknr, io_block);
*block_error = 1;
goto skip_write; goto skip_write;
} }
@ -596,7 +595,6 @@ static int do_one_pass(journal_t *journal,
unsigned int sequence; unsigned int sequence;
int blocktype; int blocktype;
__u32 crc32_sum = ~0; /* Transactional Checksums */ __u32 crc32_sum = ~0; /* Transactional Checksums */
int block_error = 0;
bool need_check_commit_time = false; bool need_check_commit_time = false;
__u64 last_trans_commit_time = 0, commit_time; __u64 last_trans_commit_time = 0, commit_time;
@ -721,8 +719,7 @@ static int do_one_pass(journal_t *journal,
* done here! * done here!
*/ */
err = jbd2_do_replay(journal, info, bh, &next_log_block, err = jbd2_do_replay(journal, info, bh, &next_log_block,
next_commit_ID, &success, next_commit_ID, &success);
&block_error);
if (err) if (err)
goto failed; goto failed;
@ -913,8 +910,6 @@ chksum_ok:
success = err; success = err;
} }
if (block_error && success == 0)
success = -EIO;
return success; return success;
failed: failed: