Re: ext2 filesystem corruption?!?!??

Stephen C. Tweedie (
11 Apr 1997 22:24:05 +0100

Hi all, writes:

> From: "Stephen C. Tweedie" <>
> Date: Sat, 5 Apr 1997 22:43:08 +0100
> Maybe I'm missing things, but I couldn't see any way for a locked
> inode to get chosen in get_empty_inode the way things stand: the "goto
> found_good" shortcut only runs if inode is already known to be
> unlocked, unreferenced and clean.
> In the for loop, if all inodes are locked or dirty, then the "best"
> inode can be locked. See the for loop and consider what happens if for
> all inodes, they are locked or dirty....

Then you exit the loop with the "best" inode locked, and fall into:

if (best->i_lock) {
goto repeat;

The only way to bypass this test is the "goto found_good" which only
fires on unlocked inodes.