Whamcloud - gitweb
e2fsck: only check for zero-length leaf extents
authorTheodore Ts'o <tytso@mit.edu>
Mon, 11 Jun 2012 04:25:45 +0000 (00:25 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Jun 2012 04:25:45 +0000 (00:25 -0400)
commit9c40d14841f04811097a123d6e8555e78ce56811
tree75f4971e2ed7e285217e07728e8fdbff36fe98c7
parente0e2c7db4d753aa0192a4a78974fb01bee8a2fb4
e2fsck: only check for zero-length leaf extents

The on-disk format for interior nodes in the extent tree does not
encode the length of each entry in the interior node; instead, it is
synthesized/simulated by the extent library code in libext2fs.
Unfortunately, this simulation is not perfect; in particular it does
not work for the last extent in the extent tree if there are
uninitialized blocks allocated using fallocate with
FALLOC_FL_KEEP_SIZE, and it leads to e2fsck incorrectly complaining
about an invalid zero-length extent.

We only need to worry about the extent length for the leaves of the
tree, since it is there were we are checking an on-disk value, as
opposed to a software-generated simulation.  So restrict the check of
extent length to leaf nodes in the extent tree.

Reported-by: Tao Ma <tm@tao.ma>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass1.c