rmdir hangs on bad ext2 directory (1.2.11)

Marek Michalkiewicz (marekm@i17linuxb.ists.pwr.wroc.pl)
Wed, 12 Jul 1995 19:26:38 +0200 (MET DST)


Just a moment ago I tried to remove a directory which was a file before
the filesystem corruption (not detected by e2fsck) caused by bad RAM.

The directory disappeared, but rmdir hung, I can't kill it (even -9 doesn't
work, I guess I will have to reboot), ps shows it in the R state using over
90% of CPU time. The following message was found in syslog:

EXT2-fs warning (device 22/1): empty_dir: bad directory (dir 46195)

Maybe this information will help tracking down the problem further. This
is on the same filesystem which previously caused panic. Now the error
is detected but seems like it is not handled correctly (the rmdir syscall
should not hang, but return with some error code instead).

I really hope to see a new e2fsck able to fix this soon - I don't know
enough about filesystem structure to fix it by hand. Thanks and please
keep up the good work.

Just an idea: how about CRC checksums for inodes? This would allow easy
detection of such problems, and the hardware Linux is running on is not
always the highest quality... I can only dream about RAM with ECC, the
motherboard in this box doesn't even seem to support parity. Single bit
in an inode can make a big difference, and inodes are updated very often
compared to files.

Regards,
Marek