Towards basic filesystem checking (simplified)
phillips at phunq.net
Sun Dec 30 14:28:14 PST 2012
OK, here is a followup to the quick-and-dirty fsck proposal, an even simpler
idea that can be implemented more easily. The thing is, we don't really need a
bytemap - a bitmap is good enough for the checks I described. Start with an
empty "shadow" bitmap and walk the itable and dtrees, marking all referenced
blocks and reporting errors for any already referenced. Also walk the orphan
table (a sibling btree of the itable), and also mark off the log blocks and a
few miscellaneous blocks like the superblock. At the end of the walk, check
the shadow bitmap table against the bitmap table: it should match.
As noted above, Hirofumi's tux3graph command already provides a nice template
for the tree-of-trees walk, and as before, the shadow bitmap should just be an
inode, much like the normal bitmap but with a different backing method so that
unwritten blocks automatically appear as zeros, which among other niceties,
eliminates the need to initialize the table.
This simple idea is equally suitable for offline and online checking. Actually,
it is exciting to have the beginnings of an online fsck so near.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tux3