freebsd-dev/sbin/growfs
Kirk McKusick 0a6e34e950 Fix size differences between architectures of the UFS/FFS CGSIZE macro value.
The cylinder group header structure ended with `u_int8_t cg_space[1]'
representing the beginning of the inode bitmap array. Some architectures
like the i386 rounded this up to a 4-byte boundry while other
architectures like the amd64 rounded it up to an 8-byte boundry.
Thus sizeof(struct cg) was four bytes bigger on an amd64 machine
than on an i386 machine. If a filesystem created on an i386 machine
was moved to an amd64 machine, the size of the cylinder group
calculated by the CGSIZE macro would appear to grow by four bytes.
Filesystems whose cylinder groups were exactly equal to the block
size on an i386 machine would appear to have a cylinder group that
was four bytes too big when moved to an amd64 machine. Note that
although the structure appears to be too big, it in fact is fine.
It is just the calaculation of its size that is in error.

The fix is to remove the cg_space element from the cylinder-group
structure so that the calculated size of the structure is the same
size on all architectures.

Reported by:  Tijl Coosemans
Tested by:    Tijl Coosemans and Peter Holm
MFC after:    1 week
Sponsored by: The FreeBSD Foundation
2023-05-15 12:57:15 -07:00
..
tests Check the exit code from fsck_ffs instead of relying on MODIFIED being in the output 2017-10-10 05:58:33 +00:00
debug.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
debug.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
growfs.8 add Xr to the rc.d script... 2021-04-06 16:32:57 -07:00
growfs.c Fix size differences between architectures of the UFS/FFS CGSIZE macro value. 2023-05-15 12:57:15 -07:00
Makefile pkgbase: Put ufs related tools and lib in their own package 2022-10-26 19:46:34 +02:00
Makefile.depend Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00