freebsd-src/sbin/fsck_ffs
Kirk McKusick 772430dd67 Ensure I/O buffers in libufs(3) are 128-byte aligned.
Various disk controllers require their buffers to be aligned to a
cache-line size (128 bytes). For buffers allocated in structures,
ensure that they are 128-byte aligned. Use aligned_malloc to allocate
memory to ensure that the returned memory is 128-byte aligned.

While we are here, we replace the dynamically allocated inode buffer
with a buffer allocated in the uufsd structure just as the superblock
and cylinder group buffers do.

This can be removed if/when the kernel is fixed. Because this problem
has existed on one I/O subsystem or another since the 1990's, we
are probably stuck with dealing with it forever.

The problem most recent showed up in Azure, see:
    https://reviews.freebsd.org/D41728
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267654
Before these fixes were applied, it was confirmed that the changes
in this commit also fixed the issue in Azure.

Reviewed-by: Warner Losh, kib
Tested-by:   Souradeep Chakrabarti of Microsoft (earlier version)
PR:          267654
Differential Revision: https://reviews.freebsd.org/D41724
2023-11-17 14:11:24 -08:00
..
dir.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
ea.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
fsck.h Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
fsck_ffs.8 SEE ALSO section improvements for tuning(7), tunefs(8) and fsck_ffs(8) 2023-11-17 19:24:22 +01:00
fsutil.c Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
gjournal.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
globs.c Delete snapshot after opening it when running fsck_ffs(9) in background. 2023-10-25 15:38:11 -07:00
inode.c Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
main.c Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
pass1.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
pass1b.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
pass2.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
pass3.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
pass4.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
pass5.c Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
setup.c Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
suj.c Ensure I/O buffers in libufs(3) are 128-byte aligned. 2023-11-17 14:11:24 -08:00
utilities.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00