[Ocfs2-tools-devel] [RFC] fsck.ocfs2 refcount.v3

Tao Ma tao.ma at oracle.com
Wed Dec 2 19:22:41 PST 2009



Joel Becker wrote:
> On Mon, Nov 23, 2009 at 04:12:34PM +0800, Tao Ma wrote:
>> 3. in o2fsck_check_blocks and o2fsck_check_xattr, if the ocfs2_extent_rec
>>    is refcounted, add it to the refcount_extent rb-tree(discribed below),
>>    and the file which share the same refcount tree will be in a list.
>>    Please note that we don't call o2fsck_mark_cluster_allocated against
>>    refcounted clusters. It will be handled in step 4.
> 
> 	Just make sure that step 4 is completed before we write out the
> bitmaps.
> 
>> 		o2fsck_mark_cluster_allocated(p_cpos, clusters, &has_setted);
>> 		if (has_setted) {
>> 			/*
>> 			 * There is other system file which has already set
>> 			 * the used clusters bitmap. So we have to add them
>> 			 * to duplicate clusters and let ocfs2_pass1_dup
>> 			 * handle them.
>> 			 */
>> 			add_to_dup_clusters(p_cpos, clusters);
>> 			ocfs2_refcount_punch_hole(p_cpos, p_cpos + clusters);
>> 			ref_rec = NULL;
>> 			r_offset = 0;
>> 			if (old_p_cpos < p_cpos + clusters)
>> 				old_p_pos = p_cpos + clusters;
>> 			goto next;
>> 		}
> 
> 	First, o2fsck_mark_cluster_allocated() takes one cluster at a
> time.  You'll have to loop on it.  It doesn't return has_setted, but you
> can easily check the dup map after you've called it.  You don't need to
> add to dup clusters, because o2fsck_mark_cluster_allocated() will do
> that for you.
oh, yes. So the old "dup_clusters" should work for me. Thanks for 
pointing it out.
> 	I see that you have changed the (old_cpos > p_cpos) to
> has_setted.  I assume you think anything less than old_cpos will have
> been set.  But couldn't certain corrupt overlaps have holes we wouldn't
> set?  I'm not sure if this is possible.
So my plan is to complete current schema first and if there is a hole, 
we can fix it up later.
> 	The rest looks good.
Thanks for the review.

Regards,
Tao



More information about the Ocfs2-tools-devel mailing list