[Ocfs2-tools-devel] fsck, lost+found, libocfs2 allocating

Zach Brown zach.brown at oracle.com
Mon Nov 22 14:30:16 CST 2004


I started teaching fsck to really create lost+found and populate it and
quickly ran into the parts of libocfs2 that need to be fleshed out to
enable this.  I was testing by trying to force creation of lost+found on
a freshly made file system and mkfs leaves each node's inode allocator
chains empty -- including node 0.  It seems reasonable to me that the
library should try to allocate from all the nodes, expanding them if
needed, but maybe I've missed out on some conclusive discussion.

So, barring objections, I think we should:

- teach ocfs2_new_inode() to try allocating bits from each node.  I
don't have strong preferences about trying to keep them balanced, or
anything, I would just walk them in order looking for a free bit.

- add some input to the chain allocator so that ocfs2_new_inode() can
ask to have a group created once it has discovered that all the node's
allocators don't have groups with free bits.
ocfs2_chain_alloc_expand()?  Whatever.

- implement ocfs2_chain_alloc_range() as the comments describe to
allocate the group.  This certainly wants a bitmap _alloc_range() helper
which will have explicit knowledge of the bitmap regions -- callers just
using test/set to find the range have to worry about unallocated regions
and that's no good.

I'm also holding off on these changes until I hear from Joel that he
hasn't already implemented them while on a plane :)

- z


More information about the Ocfs2-tools-devel mailing list