[Ocfs2-tools-devel] [PATCH 2/2] looped chain - Break loop in fsck

Sunil Mushran sunil.mushran at oracle.com
Thu Mar 4 16:39:07 PST 2010


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.

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