Skip to content

Commit 0b737f4

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: rename the old_crc variable in xlog_recover_process
old_crc is a very misleading name. Rename it to expected_crc as that described the usage much better. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent 3e5bdfe commit 0b737f4

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

fs/xfs/xfs_log_recover.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2894,20 +2894,19 @@ xlog_recover_process(
28942894
int pass,
28952895
struct list_head *buffer_list)
28962896
{
2897-
__le32 old_crc = rhead->h_crc;
2898-
__le32 crc;
2897+
__le32 expected_crc = rhead->h_crc, crc;
28992898

29002899
crc = xlog_cksum(log, rhead, dp, be32_to_cpu(rhead->h_len));
29012900

29022901
/*
29032902
* Nothing else to do if this is a CRC verification pass. Just return
29042903
* if this a record with a non-zero crc. Unfortunately, mkfs always
2905-
* sets old_crc to 0 so we must consider this valid even on v5 supers.
2906-
* Otherwise, return EFSBADCRC on failure so the callers up the stack
2907-
* know precisely what failed.
2904+
* sets expected_crc to 0 so we must consider this valid even on v5
2905+
* supers. Otherwise, return EFSBADCRC on failure so the callers up the
2906+
* stack know precisely what failed.
29082907
*/
29092908
if (pass == XLOG_RECOVER_CRCPASS) {
2910-
if (old_crc && crc != old_crc)
2909+
if (expected_crc && crc != expected_crc)
29112910
return -EFSBADCRC;
29122911
return 0;
29132912
}
@@ -2918,11 +2917,11 @@ xlog_recover_process(
29182917
* zero CRC check prevents warnings from being emitted when upgrading
29192918
* the kernel from one that does not add CRCs by default.
29202919
*/
2921-
if (crc != old_crc) {
2922-
if (old_crc || xfs_has_crc(log->l_mp)) {
2920+
if (crc != expected_crc) {
2921+
if (expected_crc || xfs_has_crc(log->l_mp)) {
29232922
xfs_alert(log->l_mp,
29242923
"log record CRC mismatch: found 0x%x, expected 0x%x.",
2925-
le32_to_cpu(old_crc),
2924+
le32_to_cpu(expected_crc),
29262925
le32_to_cpu(crc));
29272926
xfs_hex_dump(dp, 32);
29282927
}

0 commit comments

Comments
 (0)