Failures they e2fsck doesn't find

Andreas Dilger adilger at
Thu Feb 10 17:23:41 UTC 2005

On Feb 10, 2005  14:40 +0100, Jörg Sommer wrote:
> > This is from the command-line.  Note specifically the '\' before ls, so
> > that you don't get anything like color-ls trying to stat all of the files.
> There are no errors with \ls.

Ok, this means there is a bug with the htree indexing, possibly due to
the use of 8-bit characters (though I can't see anything obvious in that
regard).  It might be that e2fsck is indexing them
incorrectly, or the kernel, or both.

> > If you run "tune2fs -O ^dir_index" does the ls work again?
> yes.
> Can I add the index again?

Yes, "tune2fs -O dir_index".  If you haven't created any large directories
or added files to large directories since it was turned off then there isn't
anything else to do (the htree indexing maintains internal consistency even
when disabled, at worst reverting to linear searching until "e2fsck -fD" is

After you do that can you run the following:

mkdir {new_dir}
cd {old_dir}
\ls | (cd {new_dir}; xargs touch)

and then

debugfs {dev}
debugfs> htree {old_dir}
debugfs> htree {new_dir}

What is of interest is whether the hash values of any of the entries are
different (which would imply that e2fsck and the kernel disagree in the
hash value of some entry).  In particular, the kernel is looking for
hash value H in a bucket (dir leaf block) that spans from (H-m) to (H+n)
and isn't finding it, but a linear directory search IS finding it.

Unfortunately, the debugfs "hash" function only calculates the dx_hash,
and your filesystem almost certainly isn't using that.  We probably need
a new "tea_hash" and "md4_2_hash" commands, and then "hash" by default
picks the current fs hash value (the seed optionally being specified for
each command).

Cheers, Andreas
Andreas Dilger   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the Ext3-users mailing list