Whamcloud - gitweb
e2fsck: always submit logical block 0 of a directory for pass 2
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 25 Jul 2014 12:39:45 +0000 (08:39 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 25 Jul 2014 12:39:45 +0000 (08:39 -0400)
commit0733835bf79748fb99aa19ad4a2bfa5b51ba2708
tree910c6b9dca29bf0a3d1389927bad029a7c0652ea
parent9f005a90f86fccdfb9b016e39a9e9eca3e8911b2
e2fsck: always submit logical block 0 of a directory for pass 2

Always iterate logical block 0 in a directory, even if no physical
block has been allocated.  Pass 2 will notice the lack of mapping and
offer to allocate a new directory block; this enables us to link the
directory into lost+found.

Previously, if there were no logical blocks mapped, we would fail to
pick up even block 0 of the directory for processing in pass 2.  This
meant that e2fsck never allocated a block 0 and therefore wouldn't fix
the missing . and .. entries for the directory; subsequent e2fsck runs
would complain about (yet never fix) the problem.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c
tests/f_emptydir/expect.1 [new file with mode: 0644]
tests/f_emptydir/expect.2 [new file with mode: 0644]
tests/f_emptydir/image.gz [new file with mode: 0644]
tests/f_emptydir/name [new file with mode: 0644]