[Ocfs2-tools-devel] thoughts on xattr fsck

Joel Becker Joel.Becker at oracle.com
Tue Mar 17 15:27:26 PDT 2009


On Tue, Mar 17, 2009 at 06:26:41PM +0800, Tiger Yang wrote:
> Joel Becker wrote:
>> Tiger,
>> 	Here's what I'm thinking.  First, you check the xh_count against
>> the detected_count.  I think you have to bound by both the max_count
>> calculation we discussed and the detected_count you originally coded.
>>
>>   1) Calculate the max_count as the largest N where
>>      ((N * sizeof(entry)) + (N * 4 /* min value */)) <= available space
>>   2) Use your old detect_count(), the one that just checks
>>      IS_LAST_ENTRY() and the name hash if it is a bucket.  But don't let
>>      it go past the max_count you computed in step (1).  This new
>>      detected_count is a safer value; it doesn't have as much of a
>>      problem with memmove().
>>   3) If xh_count is <= detected_count, do nothing
>>   4) If xh_count > max_count, ask the user if they want to set xh_count
>>      to detected_count.  If they don't, you just exit out of checking
>>      this xattr  object.  If they do, you fix xh_count and continue.
>
> I still have one question here.
> If deteted_count < xh_count <= max_count, what shall we do?

	Sorry, (4) should heave read detected_count.  Since we never let
detected_count go past the max_count,we are assured that detected_count
<= max_count.  Then, if xh_count > detected_count, we ask to fix it.

Joel


-- 

 print STDOUT q
 Just another Perl hacker,
 unless $spring
	- Larry Wall

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