[Ocfs2-tools-devel] thoughts on xattr fsck

Tiger Yang tiger.yang at oracle.com
Tue Mar 17 03:26:41 PDT 2009


Joel,

Great thanks for you so kind help.

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?


thanks,
tiger



More information about the Ocfs2-tools-devel mailing list