[Bug 267654] UFS "cylinder checksum failed" on temporary storage or data disk on arm64 vm in Azure

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 18 Nov 2022 05:58:51 UTC

--- Comment #9 from Kirk McKusick <mckusick@FreeBSD.org> ---
Newfs is generating the check hashes using the libufs cgwrite(3) routine. The
cgwrite(3) routine calls calculate_crc32c() which comes from
sys/libkern/gsb_crc32.c. The kernel check also uses calculate_crc32c() from
sys/libkern/gsb_crc32.c so they should be getting the same answer. If the
structures were somehow laid out differently that might explain it, but then a
lot of other things would also break. I also note that the same
calculate_crc32c() function is used for the superblock checksum and the inode
checksum which are both working fine which makes it even more of a mystery why
the cylinder group checksums are broken.

Another option is to disable cylinder group checksums in newfs(8) using
something like this patch:

diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index 48091d7882d0..5000adff138f 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -499,8 +499,10 @@ mkfs(struct partition *pp, char *fsys)
        if (Oflag > 1) {
                sblock.fs_flags |= FS_METACKHASH;
+#ifndef AZURE
                if (getosreldate() >= P_OSREL_CK_CYLGRP)
                        sblock.fs_metackhash |= CK_CYLGRP;
                if (getosreldate() >= P_OSREL_CK_SUPERBLOCK)
                        sblock.fs_metackhash |= CK_SUPERBLOCK;
                if (getosreldate() >= P_OSREL_CK_INODE)

You are receiving this mail because:
You are the assignee for the bug.