freebsd-skq/sbin
Kirk McKusick 996d40f91d Various new check-hash checks have been added to the UFS filesystem
over various major releases. Superblock check hashes were added for
the 12 release and cylinder-group and inode check hashes will appear
in the 13 release.

When a disk with a UFS filesystem is writably mounted, the kernel
clears the feature flags for anything that it does not support. For
example, if a UFS disk from a 12-stable kernel is mounted on an
11-stable system, the 11-stable kernel will clear the flag in the
filesystem superblock that indicates that superblock check-hashs
are being maintained. Thus if the disk is later moved back to a
12-stable system, the 12-stable system will know to ignore its
incorrect check-hash.

If the only filesystem modification done on the earlier kernel is
to run a utility such as growfs(8) that modifies the superblock but
neither updates the check-hash nor clears the feature flag indicating
that it does not support the check-hash, the disk will fail to mount
if it is moved back to its original newer kernel.

This patch moves the code that clears the filesystem feature flags
from the mount code (ffs_mountfs()) to the code that reads the
superblock (ffs_sbget()). As ffs_sbget() is used by the kernel mount
code and is imported into libufs(3), all the filesystem utilities
will now also clear these flags when they make modifications to the
filesystem.

As suggested by John Baldwin, fsck_ffs(8) has been changed to accept
and repair bad superblock check-hashes rather than refusing to run.
This change allows fsck to recover filesystems that have been impacted
by utilities older than those created after this change and is a
sensible thing to do in any event.

Reported by:  John Baldwin (jhb@)
MFC after:    2 weeks
Sponsored by: Netflix
2020-10-25 00:43:48 +00:00
..
adjkerntz
bectl loader: zfs should support bootonce an nextboot 2020-09-21 09:01:10 +00:00
bsdlabel Remove deprecated GEOM classes 2019-08-13 20:06:55 +00:00
camcontrol camcontrol(8): Bugfixes for some issues reported by mandoc 2020-10-03 18:40:02 +00:00
ccdconfig
clri
comcontrol Remove sio(4). 2019-11-21 01:24:49 +00:00
conscontrol Remove sio(4). 2019-11-21 01:24:49 +00:00
ddb ddb: use 'textdump dump' instead of 'call doadump' 2019-10-18 12:32:01 +00:00
decryptcore Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00
devd Document the rather suprising behavior with ' inside action rules. 2020-10-13 05:19:00 +00:00
devfs devfs.rules: unhide pf in vnet jails 2020-10-05 19:26:54 +00:00
devmatch devmatch: First appeared in 12.0 2020-10-13 05:32:00 +00:00
dhclient dhclient(8): Bugfixes for some issues reported by mandoc 2020-10-03 18:42:15 +00:00
dmesg
dump Clean up some function and variable names. 2020-06-23 21:11:40 +00:00
dumpfs Print the fs last-mounted time too. 2020-05-02 00:10:25 +00:00
dumpon dumpon.8: Update minimum key size language 2020-04-23 18:04:52 +00:00
etherswitchcfg Add the 'drop tagged' flag support for ethernet switch ports. 2019-06-28 22:12:43 +00:00
fdisk Remove deprecated GEOM classes 2019-08-13 20:06:55 +00:00
ffsinfo
fsck Fix a few mandoc issues 2020-10-09 14:03:45 +00:00
fsck_ffs Various new check-hash checks have been added to the UFS filesystem 2020-10-25 00:43:48 +00:00
fsck_msdosfs Use %ju and cast to (uintmax_t) to avoid using PRI* macros. 2020-09-28 04:30:31 +00:00
fsdb fsdb(8): Fix an issue reported by mandoc 2020-10-03 18:44:13 +00:00
fsirand fsirand(8): Just use arc4random(3) 2019-12-13 04:12:13 +00:00
gbde
geom Remove all the RELEASE_CRUNCH defines, they are useless. 2019-12-16 21:06:24 +00:00
ggate ggate: Fix ggated/ggatec debug print of offsets. 2020-09-09 12:58:19 +00:00
growfs Add missing cylinder group check-hash updates when doing large expansions 2020-09-22 03:57:48 +00:00
gvinum gvinum(8): Fix an issue reported by mandoc 2020-10-03 18:49:00 +00:00
hastctl
hastd Fix typo in hastd.8 manual page. 2019-12-22 01:22:51 +00:00
ifconfig Fix for colliding change (r366917). 2020-10-22 10:36:16 +00:00
init Remove risky compatability with old kernels 2020-09-02 21:14:36 +00:00
ipf Create a link to the ipmon.conf.5 man page as documented in ipmon.5. 2019-06-27 12:37:44 +00:00
ipfw ipfw(8): Bugfixes for some issues reported by mandoc 2020-10-03 18:30:01 +00:00
iscontrol pkgbase: We can't easily have a package with either a - or a _ 2020-08-07 12:19:21 +00:00
kldconfig kldconfig(8): Add EXAMPLES to the man page 2020-09-29 17:52:15 +00:00
kldload
kldstat kldstat(8): Add EXAMPLES to the man page 2020-09-02 18:15:57 +00:00
kldunload
ldconfig ldconfig: add aout deprecation notice 2020-03-17 15:57:25 +00:00
md5 md5: return non-zero if built-in tests (-x) fail 2020-07-23 20:06:24 +00:00
mdconfig
mdmfs mdmfs(8): Fix an issue reported by mandoc 2020-10-03 18:47:50 +00:00
mknod
mksnap_ffs Deduplicate fsid comparisons 2020-05-21 01:55:35 +00:00
mount Move the mount name to bit mapping into sys/mount.h so it can be shared with the 2020-08-19 17:09:58 +00:00
mount_cd9660
mount_fusefs Correct a handful of typos/grammos. 2019-12-07 15:17:00 +00:00
mount_msdosfs Fix a few mandoc issues 2020-10-09 14:03:45 +00:00
mount_nfs mount_nfs(8): document alternate form of the gssname option 2020-07-17 21:55:24 +00:00
mount_nullfs
mount_udf
mount_unionfs
natd
newfs In the newfs(8) utility, use the more appropriate sbwrite() and cgwrite() 2020-09-13 22:57:50 +00:00
newfs_msdos Fix makefs bootstrap on macOS after D25563 2020-08-25 13:30:24 +00:00
nfsiod pkgbase: Create a FreeBSD-utilities package and make it the default one 2019-09-05 14:15:47 +00:00
nos-tun pkgbase: Create a FreeBSD-utilities package and make it the default one 2019-09-05 14:15:47 +00:00
nvmecontrol Fix nvmecontrol logpage -i parameter. 2020-10-15 15:36:08 +00:00
pfctl [pfctl_tests] Add missing void to empty function declaration 2020-10-15 14:56:51 +00:00
pfilctl Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00
pflogd
ping Make use of IP_VLAN_PCP setsockopt in ping and ping6. 2020-10-24 21:01:18 +00:00
ping6 Make use of IP_VLAN_PCP setsockopt in ping and ping6. 2020-10-24 21:01:18 +00:00
quotacheck
rcorder [rcorder] [crunch] Fix C function declarations to include void 2020-09-21 17:59:45 +00:00
reboot The nextboot(8) manual page currently says that the loader(8) would delete 2020-10-11 10:40:11 +00:00
recoverdisk Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00
resolvconf
restore Clean up global variable declarations in the dump and restore 2020-04-04 00:56:56 +00:00
route Skip sbin/route tests if jail not installed (WITHOUT_JAIL). 2020-08-04 21:34:13 +00:00
routed
rtsol Update Makefile.depend files 2019-12-11 17:37:53 +00:00
savecore savecore: accept device names without the /dev/ prefix 2020-06-29 22:12:23 +00:00
sconfig Fix the following -Werror warning from clang 10.0.0 in sconfig: 2020-02-13 18:37:17 +00:00
setkey Refer to AES-CBC as "aes-cbc" rather than "rijndael-cbc" for IPsec. 2020-06-04 22:58:37 +00:00
shutdown shutdown.8: Fix typo 2020-07-05 13:08:17 +00:00
spppcontrol
swapon The -F flag of swapon(8) requires -a to work. 2020-05-19 12:16:44 +00:00
sysctl sysctl+kern_sysctl: Honor SKIP for descendant nodes 2020-10-24 16:17:07 +00:00
tests
tunefs Only set WARNS if not defined 2020-09-11 13:28:37 +00:00
umount Document that umount -A does not unmount /dev 2020-06-18 23:12:55 +00:00
veriexec veriexec(8): Bugfix for an issue reported by mandoc 2020-10-03 18:46:42 +00:00
zfsbootcfg loader: zfs should support bootonce an nextboot 2020-09-21 09:01:10 +00:00
Makefile Remove NAND and NANDFS support 2019-06-25 04:50:09 +00:00
Makefile.amd64
Makefile.arm
Makefile.i386
Makefile.inc build: provide a default WARNS for all in-tree builds 2020-09-18 17:17:46 +00:00
Makefile.mips
Makefile.powerpc64