Whamcloud - gitweb
e2fsck: Fix directory with holes even when i_size is wrong
authorTheodore Ts'o <tytso@mit.edu>
Sat, 28 Nov 2009 14:35:37 +0000 (09:35 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 29 Nov 2009 06:02:46 +0000 (01:02 -0500)
commit4dbe79bcf3c693f9ae607506850eda7ea92892ab
tree9f11b9036721651161e2d648cca39ce019e909ef
parentbd6793fe8df72cdec48f3fbce5d7bf14b210bbb3
e2fsck: Fix directory with holes even when i_size is wrong

The old method for detecting directories with holes depended on i_size
being correct, even though the correct value of i_size hadn't been
calculated yet.  Hence, a directory inode with holes and an i_size of
0 would require two e2fsck passes to fix completely.

The replacement method for determining whether or not
ext2fs_add_dir_block() should be called is more reliable, and reduces
the size of e2fsck and makes the code more readable as a bonus.

Thanks to Mikulas Patocka for providing a sample file system which
demonstrated this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass1.c