[Ocfs2-tools-devel] [PATCH 2/2] looped chain - Break loop in fsck
tristan
tristan.ye at oracle.com
Thu Mar 4 18:14:54 PST 2010
Sunil Mushran wrote:
> Let me also add my 2 cents worth.
>
> For the global bitmap, why don't we compute the list of expected values
> and check against that. That will be a lot more precise. This check can
> be added in CHAIN_LINK_RANGE.
Sorry, here I didn't quite understand your suggestion well, are we going
to validate the starting blkno of each cluster group in
CHAIN_LINK_RANGE? then correct them by our calculation if any mismatch
happened? if it's the case, it looks like s a strengthening to
CHAIN_LINK_RANGE? may that need a new prompt code in this case?
Or we're going to take this into account in CHAIN_LOOP case? that means,
we can break the loop by pointing to a correct blkno we calculated,
instead of terminating it as NULL.
Could you please explain more about the motivation?
>
> The calculation around this is simple. Excepting the first cluster group,
> the starting block number of all cluster groups is a multiple of:
> (ClustersPerGroup * Clustersize / Blocksize).
>
> Call this BlocksPerGroup or BPG.
>
> (The block number for the first cg is in the superblock.)
>
> The second info we need is the number of chains or cl_count. Last the
> volumesize in blocks.
>
> If we have that, we can determine the blocks of any chain# using the
> following formula: blocknum = (BlocksPerGroup * ((cl_count * i) +
> chain#))
>
> Format a volume with a small blocksize, clustersize (to get long chains)
> and run use the script to compare the results.
>
> VOLSIZEINBLKS=3563402752;
> BPG=2064384;
> CHAIN=27;
> CLCOUNT=243;
> blk=0;
> i=0;
> while test ${blk} -le $VOLSIZEINBLKS ;
> do
> blk=$[$BPG * $[$[$CLCOUNT * $i ] + $CHAIN]];
> if test ${blk} -le $VOLSIZEINBLKS ;
> then
> echo $blk;
> fi;
> i=$[$i+1];
> done;
>
> Sunil
More information about the Ocfs2-tools-devel
mailing list