RE: UFS checksum error during arm64 VM installation

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sat, 30 Jul 2022 01:14:30 UTC
Wei Hu <weh_at_microsoft.com> wrote on
Date: Fri, 29 Jul 2022 15:32:41 UTC :

> > > We are trying to bring up FreeBSD on ARM64 Hyper-V.  We are seeing the iso
> > image booted up fine and we can install the root disk with ZFS. However,
> > when choosing to install the root disk with UFS, we are seeing UFS checksum
> > errors as below and the installation just failed.
> > >
> > > ...
> > > UFS /dev/da0p2 (/mnt) cylinder checksum failed: cg 41, cgp: 0x45721f90
> > > != bp: 0x23b0cc8
> > ...
> > 
> > Hi Wei, I assume you're trying this on relatively recent main? (There were some
> > cylinder checksum issues some time ago, I think related to growfs, but as far as
> > I know they were all fixed long ago.)
> 
> Hi Ed, Yes, we are trying from recent main (June, 2022).

I do not know if the following is related or not. But
it can suggest avoiding late-May to until fairly recent
versions for activity that would read UFS superblocks or
create UFS file systems and such: possible rejections
could happen that later code would tolerate.


There has been a bunch of recent activity about valdiating
superblocks and such, starting in late may with:

QUOTE
author	Kirk McKusick <mckusick@FreeBSD.org>	2022-05-27 19:21:11 +0000
committer	Kirk McKusick <mckusick@FreeBSD.org>	2022-05-27 19:22:07 +0000
commit	076002f24d35962f0d21f44bfddd34ee4d7f015d (patch)
tree	5b6a4cb01a3afaefad15e7e6e9cc4cbcea0ffadf
parent	eca6e0f7e460bf9a4a6e1bd5198d75168280c88e (diff)
download	src-076002f24d35962f0d21f44bfddd34ee4d7f015d.tar.gz
src-076002f24d35962f0d21f44bfddd34ee4d7f015d.zip

Do comprehensive UFS/FFS superblock integrity checks when reading a superblock.
Historically only minimal checks were made of a superblock when it
was read in as it was assumed that fsck would have been run to
correct any errors before attempting to use the filesystem. Recently
several bug reports have been submitted reporting kernel panics
that can be triggered by deliberately corrupting filesystem superblocks,
see Bug 263979 - [meta] UFS / FFS / GEOM crash (panic) tracking
which is tracking the reported corruption bugs.

This change upgrades the checks that are performed. These additional
checks should prevent panics from a corrupted superblock. Although
it appears in only one place, the new code will apply to the kernel
modules and (through libufs) user applications that read in superblocks.

. . .
END QUOTE

There have been well over a dozen related updates since then,
including some activity in the last couple of weeks. Even growfs
got a fix. Some changes were to avoid false rejections from old
tool behavior that left behind somewhat odd UFS internal
information, leaving file systems in a not-obvious state.
Non-dangerous examples of such are now more tolerated.

Some of the issues did block (re)booting normally for various
folks for a time. These have been being fixed as they showed
up.


===
Mark Millard
marklmi at yahoo.com