freebsd-dev/usr.sbin/makefs
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
..
cd9660 spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD 2023-05-12 10:44:04 -06:00
ffs Fix size differences between architectures of the UFS/FFS CGSIZE macro value. 2023-05-15 12:57:15 -07:00
msdos makefs: call brelse from bread 2023-04-16 15:45:17 -04:00
sys Fix makefs bootstrap after d485c77f20 2021-02-22 17:55:45 +00:00
tests spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
zfs spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
cd9660.c spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD 2023-05-12 10:44:04 -06:00
cd9660.h spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD 2023-05-12 10:44:04 -06:00
ffs.c makefs: call brelse from bread 2023-04-16 15:45:17 -04:00
ffs.h Allocate extra inodes in makefs when leaving free space in UFS images. 2021-04-06 13:43:29 -04:00
Makefile makefs: Add ZFS support 2022-08-05 13:42:29 -04:00
Makefile.depend Update Makefile.depend files 2019-12-11 17:37:53 +00:00
Makefile.depend.host Build host tools on non-FreeBSD host with DIRDEPS_BUILD 2023-04-22 13:13:22 -07:00
Makefile.depend.options Build host tools on non-FreeBSD host with DIRDEPS_BUILD 2023-04-22 13:13:22 -07:00
makefs.8 makefs: Add ZFS support 2022-08-05 13:42:29 -04:00
makefs.c makefs: remove vestigial '?' cases from top-level getopt(3) loop 2023-03-30 09:20:00 -04:00
makefs.h makefs: whitespace cleanup (remove space before tab) 2022-09-20 10:26:24 -04:00
msdos.c makefs: remove set but not used variables 2021-11-21 21:21:34 -05:00
msdos.h Fix makefs bootstrap after d485c77f20 2021-02-22 17:55:45 +00:00
mtree.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
walk.c
zfs.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00