[Ocfs2-tools-devel] [PATCH 17/20] fsck.ocfs2: Make pass0 aware of discontig block group.

Tao Ma tao.ma at oracle.com
Sat Jul 17 07:40:51 PDT 2010



Joel Becker wrote:
> On Sat, Jul 17, 2010 at 04:22:59PM +0800, Tao Ma wrote:
>   
>> On 07/17/2010 08:06 AM, Joel Becker wrote:
>>     
>>> 	I didn't see a patch in this series where repair_group_desc()
>>> checks the extent list in the discontig descriptor.  Did I miss that?
>>>       
>> You are right. I don't implement it.
>> The reason is that we now never check allocations for any block
>> group. And also in case we find duplicate clusters for chain
>> allocator, we skip it and do nothing.
>>     
>
> 	Hmm?  We certainly do our best to sanity check the gd fields.
> You are right that duplicate clusters are handled separately.  But what
> about an l_next_free_rec that is too large?  What about a discontig bg
> whose extents don't add up to cl_cpg?
>   
I can add some basic sanity check for it.
> 	Right now, if we find a bad magic or bad generation, we'll just
> drop it.  Why not do the same for a really screwed up extent list.  I'm
> not asking to walk the extent list to see if the global bitmap has the
> bits or something.
>
>   
>> So do you think we should break this by adding extent list check for
>> the discontiguous block group?
>> If that is the truth, I think we may also need to check other block
>> group as well. And that would be a new task for ocfs2-tools.
>>     
>
> 	Btw, we do check the allocation of chains.  Their clusters are
> added to the bitmaps, and if they are overlapping other things, we copy
> out those other things in pass1d.  But that's not what I'm talking about
> here.
>   
yes, I knew that and actually my discontiguous block group will also be 
set in the
global bitmap in mark_group_used.

So let me describe what I think we need for discontiguous block group check:
1. do some sanity check for the extent list. includes 
l_tree_depth(should always be 0),
   l_count and l_next_free_rec.
2. for each extent_record, check whether we have a valid e_cpos.
3. for the whole extent list, check whether the total clusters number = cpg.
If there is any error during the check, just remove the whole group.

any comments?

Regards,
Tao




More information about the Ocfs2-tools-devel mailing list