[chord] chordcd read fails with the 330th block and later

YAGI Toshiki yagi-toshiki at aist.go.jp
Mon Nov 1 21:59:30 EST 2004


Dear chord members,

We found out solution to issue No. 96 on Chord issue tracker.
It is as follows for details.


Title: chordcd read fails with the 2,703,360th byte and later
      (was sfsrodb/chordcd seems to max out a 2.6MB files)

Priority: bug

Factor:
  I found out some mistakes in routine that handles double_indirect (and I found
  almost same mistake in triple_indirect) in chordcd/server.C

  1. There are mistakes at deciding which addressing(direct, single indirect, double
   indirect, or triple indirect) should be used.
     correctly:
        0 <= direct < 128 (128 blocks)
        128 <= single indirect < 128 + 202 (202 blocks)
        128 + 202 <= double indirect < 128 + 202 + 202 * 202 (202 * 202 blocks)
        128 + 202 + 202 * 202 <= triple indirect < 128 + 202 + 202 * 202 + 202 * 202 * 202
            (202 * 202 * 202 blocks)
     but in the original code:
        0 <= direct < 128 (128 blocks)
        128 <= single indirect < 128 + 202 (202 blocks)
        128 + 202 <= double indirect < 128 + 202 * 202 (202 * 202 - 202 blocks)
        128 + 202 * 202 <= triple indirect < 128 + 202 * 202 * 202
            ( 202 * 202 * 202 - 202 * 202 blocks)

  2. There are mistakes at calculation what position should be read in double/triple
     indirect.
     Correctly, double indirect starts at (128 + 202)th block, but in the original
     code, double indirect seems to be starts at 128th block. It's same thing in
     calculating start block in triple indirect.

Solution:
    1. Modify conditional sentences so that the right addressing may be reffered to.
    2. Correct a formula that calculate what position should be read in.

A patch is apended.

--
Toshiki YAGI, National Institute of Advanced Industrial Science and Technology,
  Tsukuba Central 2, Umezono 1-1-1, Tsukuba, Ibaraki 305-8568, JAPAN
  E-mail:yagi-toshiki at aist.go.jp  Tel:+81-29-861-5862   Fax:+81-29-861-5979
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chordcd_server.C.diff
Type: application/octet-stream
Size: 1761 bytes
Desc: not available
Url : https://amsterdam.lcs.mit.edu/pipermail/chord/attachments/20041102/eee2273e/chordcd_server.C.obj


More information about the chord mailing list