Re: EXT2-fs errors...

Serge E. Hallyn (hallyn@CS.WM.EDU)
Tue, 16 Mar 1999 07:22:07 -0500


While the people who've responded are probably right - with stock ext2 I've
never seen this happen spontaneously - if you've modified the kernel at all to
slow down, oh, way, make_request and end_that_request_first (I'm doing this to
add crypto hooks...) you expose a race condition in fs/ext2/{i,b}alloc.c, in
the ext2_{free,new}_{block,inode}. While the superblock is locked around the
operation of modifying its count of free blocks/inodes, and the operation to
twiddle the bit in the bitmap signifying this operation is atomic, the
bh->b_data representing the bitmap is not locked. This means that it's
possible to change the bit in the bitmap and then read the disk's image of the
bitmap over your change (with a read started before the new_block or
free_block call). But, like I said, I believe this only happens when you slow
down the read operation.

-serge

> > Feb 12 11:23:05 michael kernel: EXT2-fs error (device 16:41):
> > ext2_check_inodes_
> > bitmap: Wrong free inodes count in group 75, stored = 1786, counted =
> > 1785
>
> 99.99% of the time, this is a hardware problem. Check your disks,
> controllers and cables. Shortening your IDE cables may help.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/