Hi!
This code looks quite confused: part of function returns 1 on corruption, part returns -errno. The problem is not stable-specific.
Best regards, Pavel
@@ -3058,6 +3061,17 @@ int f2fs_sanity_check_ckpt(struct f2fs_s return 1; }
- nat_blocks = nat_segs << log_blocks_per_seg;
- nat_bits_bytes = nat_blocks / BITS_PER_BYTE;
- nat_bits_blocks = F2FS_BLK_ALIGN((nat_bits_bytes << 1) + 8);
- if (__is_set_ckpt_flags(ckpt, CP_NAT_BITS_FLAG) &&
(cp_payload + F2FS_CP_PACKS +
NR_CURSEG_PERSIST_TYPE + nat_bits_blocks >= blocks_per_seg)) {
f2fs_warn(sbi, "Insane cp_payload: %u, nat_bits_blocks: %u)",
cp_payload, nat_bits_blocks);
return -EFSCORRUPTED;
- }
- if (unlikely(f2fs_cp_error(sbi))) { f2fs_err(sbi, "A bug case: need to run fsck"); return 1;