Re: [patch] fix for pagecache fs corruption (2.3.15-pre2) [Re:

Linus Torvalds (torvalds@transmeta.com)
Mon, 23 Aug 1999 10:08:30 -0700 (PDT)


On Mon, 23 Aug 1999, Andrea Arcangeli wrote:
>
> Chih-Chung Chang pointed me out that in 2.3.x it's been added a test in
> the CAN_UNUSE(inode) macro exactly to avoid freeing inodes with i_nrpages
> != 0. I didn't noticed such change, sorry (so no FS corruption could
> happen).
>
> But IMO such check is a dirty hack that can lead to a DoS. It seems to me
> that it's possible to leak inodes by simply allocating lots of inodes with
> only one page queued in them. The inode memory is not freeable.
>
> Now that truncate_inode_pages()/flushpage are capable of dealing with
> dirty/protected data we don't need such hack anymore to avoid
> fs-corruption. This patch goes on the top of my two previous
> page-cache patches:

You are wrong. This will cause "truncate_inode_pages()" to be called on
such an inode, which will in turn flush the dirty state without ever
writing it back to disk.

In short, major filesystem corruption and general disaster.

Please people DO NOT USE THIS PATCH. You will be sorry, and fsck will not
ever notice anything (you'll just have unexplicable data corruption in
your files that happens only very occasionally).

Linus

-
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/