[Ocfs2-tools-devel] [PATCH 4/5] Add "Set sparse flag" to ocfs2-tools, take 2

tao.ma tao.ma at oracle.com
Tue Oct 30 23:22:21 PDT 2007


>> +
>> +static errcode_t set_func(ocfs2_filesys *fs, struct ocfs2_dinode *di)
>> +{
>> +	errcode_t ret;
>> +	ocfs2_cached_inode *ci = NULL;
>> +
>> +	ret = ocfs2_read_cached_inode(fs, di->i_blkno, &ci);
>> +	if (ret)
>> +		goto out;
>> +
>> +	ret = ocfs2_zero_tail_and_truncate(fs, ci, di->i_size, NULL);
>>     
>
> Are we missing writeout of the inode block here, for the case where
> i_clusters changed?
>   
Do we really need to handle this issue here? This is the work of 
fsck.ocfs2, not tunefs.ocfs2. If we have modified i_clusters, it means 
that the file is already corrupted. I am not sure whether we need to 
modify some inode information silently which the user don't want us to do.
So here I don't care about the new i_clusters here intentionally, giving 
NULL as the parameter.




More information about the Ocfs2-tools-devel mailing list