Page MenuHomeFreeBSD

Fix makefs inode initialization
ClosedPublic

Authored by markj on Dec 15 2017, 10:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 27 2024, 2:02 AM
Unknown Object (File)
Feb 20 2024, 1:00 AM
Unknown Object (File)
Feb 4 2024, 2:17 PM
Unknown Object (File)
Jan 7 2024, 7:20 AM
Unknown Object (File)
Jan 7 2024, 6:21 AM
Unknown Object (File)
Jan 7 2024, 6:21 AM
Unknown Object (File)
Jan 7 2024, 6:21 AM
Unknown Object (File)
Jan 4 2024, 4:46 PM
Subscribers
None

Details

Summary

UFS2 does lazy initialization of inodes. makefs emulates this, but fails
to take into account the fact that we might need to initialize multiple
blocks to write a given inode. If we don't, a later initialization will
clobber that inode.

Specific inode number allocation patterns are needed to hit this case,
so it's somewhat hard to test.

Test Plan

I have a VM image-building script which can trigger the problem.
In particular, it generates images which are not clean according to fsck:
it finds directory entries pointing to unallocated (clobbered) inodes.
With this change, fsck runs cleanly, and all makefs tests pass.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable