[Ocfs2-tools-devel] [PATCH 5/6] Resend: Add unwritten extent support in ocfs2-tools, take 2

Joel Becker Joel.Becker at oracle.com
Wed Sep 26 18:50:16 PDT 2007


On Thu, Sep 27, 2007 at 09:40:21AM +0800, tao.ma wrote:
>> 	Oho!  We have a problem.  In ocfs2_read_whole_file, we have a
>> reader function (read_whole_func) that doesn't check unwritten extents.
>> That needs to be added to patch #6.  Of course, how to tell the
>> function?
>> 	Also, extras/set_random_bits.c uses it.  I think that the
>> fsck.ocfs2 users are safe (symlinks and directories).
>>   
> Yes, that is what I worry about. the callback has no idea of whether the 
> block is marked as unwritten. So maybe as I have said previously, add a new 
> parameter in callback's definition that this block exists in an unwritten 
> extent?
> Do you have any suggestion or just agree with me? :)

	If it was just read, we could easily pass a flag and expect the
callback to do the right thing.  However, write is much harder.
	I don't quite know the solution.  The rule is, if you have an
unwritten extent, you must zero the parts you don't actually write.  But
block_iterate() is block-based.  It doesn't know from extents.  I think
that block_iterate() will have to know about it.  Somehow know that a
block was written to by the callback and thus zero around it.  Mark, any
thoughts?

Joel

-- 

"And yet I fight,
 And yet I fight this battle all alone.
 No one to cry to;
 No place to call home."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list