[Ocfs2-tools-devel] [PATCH 12/44] ocfs2: Decrement refcount when truncating refcounted extents.

Tao Ma tao.ma at oracle.com
Wed Dec 30 23:47:22 PST 2009



Joel Becker wrote:
> On Mon, Dec 28, 2009 at 05:00:57PM +0800, Tao Ma wrote:
>   
>> @@ -322,6 +344,11 @@ errcode_t ocfs2_xattr_tree_truncate(ocfs2_filesys *fs,
>>  	int changed;
>>  	struct ocfs2_extent_list *el = &xt->xt_list;
>>  
>> +	/*
>> +	 * ino is used to find refcount tree, as we never use refcount
>> +	 * in xattr tree, so set it to 0.
>> +	 */
>> +	ctxt.ino = 0;
>>  	ctxt.new_i_clusters = xt->xt_clusters;
>>  	ctxt.new_size_in_clusters = 0;
>>     
>
> 	I know we don't use refcount records in the xattr tree right
> now, but couldn't we some day?  What's the harm in adding ino here?  No
> extent will have REFCOUNTED_FL anyway.
>   
well, now we don't suppot refcount in xattr tree and I have added an 
"assert(ino)," in ocfs2_truncate_clusters.
So in case we get a refcounted xattr tree, it will woe and we can get 
that the disk is somehow corrupted.
Does it make sense?
So why not change this after we add support for refcounted xattr tree?

Regards,
Tao
> Joel
>
>   



More information about the Ocfs2-tools-devel mailing list