From: Remy CARD (card@masi.ibp.fr)
Date: 06/28/93


From: card@masi.ibp.fr (Remy CARD)
Subject: Re: How to amuse e2fsck
Date: 28 Jun 1993 20:48:08 GMT

In article <C96D6o.rH@brunel.ac.uk> cs89rdb@brunel.ac.uk (Roger D Binns) writes:
>Here is a little repeatable process that causes no eventual harm, but
>confuses the hell out of e2fsck. In fact you have to run it twice!
>
>Have one shell having a directory as its current directory. From another
>shell, delete that directory. Now, hard reboot the machine. [Inbetween,
>you can run xv on a huge jpeg, hence requiring the use of the brs].
>
>e2fsck comlains bitterly about the directory that now has no links. It
>half fixes it. The kernel also gets rather upset about the directory.
>Running e2fsck again will clear the problem.

        OK. This is a problem introduced by the new ability of the ext 2 fs
to remove directories while they are busy. When a busy directory is removed,
its size is set to 0 and it is physically removed when it is last "closed".

        So, hard rebooting the machine does not allow the fs code to really
remove the directory. Thus, e2fsck complains about the directory not
being referenced in the fs tree and moves it to lost+found.

        Remember that the directory is now 0 bytes long and is not a valid
directory any more. e2fsck should really detect this case and simply mark
the inode as unused in the bitmap.

        The next e2fsck version will contain the fix.

>
>Roger

        Remy