lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <20200811022128.32690-1-luoshijie1@huawei.com> Date: Mon, 10 Aug 2020 22:21:28 -0400 From: Shijie Luo <luoshijie1@...wei.com> To: <linux-ext4@...r.kernel.org> CC: <tytso@....edu>, <jack@...e.cz>, <linfeilong@...wei.com> Subject: [PATCH] jbd2: remove useless variable chksum_seen in do_one_pass This variable only indicates that we do checksum success, while chksum_err can also do. Moreover, condition "!chksum_seen" in else if bracket is pointless. Signed-off-by: Shijie Luo <luoshijie1@...wei.com> --- fs/jbd2/recovery.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c index 2ed278f0dced..575bb6426bcc 100644 --- a/fs/jbd2/recovery.c +++ b/fs/jbd2/recovery.c @@ -690,14 +690,12 @@ static int do_one_pass(journal_t *journal, * number. */ if (pass == PASS_SCAN && jbd2_has_feature_checksum(journal)) { - int chksum_err, chksum_seen; + int chksum_err = 0; struct commit_header *cbh = (struct commit_header *)bh->b_data; unsigned found_chksum = be32_to_cpu(cbh->h_chksum[0]); - chksum_err = chksum_seen = 0; - if (info->end_transaction) { journal->j_failed_commit = info->end_transaction; @@ -709,11 +707,10 @@ static int do_one_pass(journal_t *journal, cbh->h_chksum_type == JBD2_CRC32_CHKSUM && cbh->h_chksum_size == JBD2_CRC32_CHKSUM_SIZE) - chksum_seen = 1; + chksum_err = 0; else if (!(cbh->h_chksum_type == 0 && cbh->h_chksum_size == 0 && - found_chksum == 0 && - !chksum_seen)) + found_chksum == 0)) /* * If fs is mounted using an old kernel and then * kernel with journal_chksum is used then we -- 2.19.1
Powered by blists - more mailing lists