Ryusuke Konishi 8bdf8f47c6 libsegment: add sanity checks for per-file summary information
On-disk summary information of files can fall into inconsistent
states in theory:

 - The block count recorded in finfo can exceed the number of
   remaining payload blocks.
 - The number of data blocks recorded in finfo can be larger than the
   number of total blocks of the file, or
 - The total size of finfo and binfo structures can exceed the size of
   summary information of the partial segment.

This adds sanity checks for these glitches to nilfs_file, and adds a
framework to handle these errors as well.

Also, this enhances the error output routine of dumpseg command to
handle these errors nicely.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
2016-09-30 00:13:14 +09:00
..