[Ocfs2-tools-devel] [PATCH 39/50] fsck.ocfs2: Check refcount of clusters.v3

Tao Ma tao.ma at oracle.com
Mon Feb 8 18:08:58 PST 2010



Joel Becker wrote:
> On Wed, Feb 03, 2010 at 04:29:13PM +0800, Tao Ma wrote:
>> +/*
>> + * Check all the files sharing the tree and if there is a file contains
>> + * the (p_cpos, len) with refcounted flag, we clear it.
>> + * Note:
>> + * This function is only called when checking a continuous clusters.
>> + * The pair (p_cpos, len) is a part of the original tuple we get from
>> + * get_refcounted_extent, so it can't be in 2 different refcount_extent.
>> + */
>> +static errcode_t o2fsck_clear_refcount(o2fsck_state *ost,
>> +				       struct refcount_tree *tree,
>> +				       uint64_t p_cpos,
>> +				       uint32_t len)
>> +{
>> +	errcode_t ret = 0;
>> +	struct refcount_extent *extent;
>> +	struct refcount_file *file;
>> +	struct list_head *p, *next;
>> +	struct rb_node **node;
> 
> 	Why is node a ** instead of just a *?  You never assign to
> '*node', so I don't think you're overwriting an existing pointer
> location.
oh, I just copied from other rb-tree codes. Blame my laziness. Will 
change it.
> 	Otherwise, I think it looks pretty good.  I'm assuming you've
> tested it ;-)
yeah, I have already tested it with fswreck. What's more, I create some 
sane file systems with tristan's test case. It works.

Regards,
Tao



More information about the Ocfs2-tools-devel mailing list