Page MenuHomeFreeBSD

Fix makefs inode initialization
ClosedPublic

Authored by markj on Dec 15 2017, 10:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 29, 11:48 AM
Unknown Object (File)
Tue, Oct 29, 11:47 AM
Unknown Object (File)
Tue, Oct 29, 11:47 AM
Unknown Object (File)
Tue, Oct 29, 11:27 AM
Unknown Object (File)
Oct 5 2024, 6:06 AM
Unknown Object (File)
Oct 2 2024, 1:59 PM
Unknown Object (File)
Oct 2 2024, 9:20 AM
Unknown Object (File)
Oct 2 2024, 5:58 AM
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