[Ocfs2-tools-devel] [PATCH 1/6] libocfs2: Make file truncate process return error in bad case.

Sunil Mushran sunil.mushran at oracle.com
Tue Sep 16 18:56:21 PDT 2008


Tao Ma wrote:
> Sunil Mushran wrote:
>> While this patch may work for this case, it may hurt us in other parts
>> of the fsck. Especially code paths where we call ocfs2_free_clusters()
>> because of an earlier error.
>>
>> So instead if making it treat this condition as an error, we could add
>> a conditional ocfs2_bitmap_test_generic() to test if all the bits we are
>> clearing are indeed set. If not, then we will know to trigger a full 
>> fsck.
>>
>> Thoughts?
> Not sure of it. ocfs2_free_clusters and ocfs2_truncate are common APIs 
> from libocfs2, so they really should return errors. I think it is fsck 
> that should handle the return error gracefully.
> I have gone through all the callers of ocfs2_free_clusters, thanks to 
> god, fsck doesn't use it directly except my 2 following patches. As 
> for ocfs2_truncate, there are only one place in mk_journal which may 
> be run in fsck. If you really care this, we may remove the ret check 
> in ocfs2_make_journal.

It is not only the ret check, but the fact that it terminates the loop
that is more worrying. In short, in almost all cases, freeing an already
freed bit is considered a low grade error. So low grade, that it is ignored.
So I don't think we should change that behavior.




More information about the Ocfs2-tools-devel mailing list