Linux-kernel mailing list archive 1999-34,: Re: [patch] fix for pagecache fs corruption (2.3.15-pre2) [Re:

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

Andrea Arcangeli (andrea@suse.de)
Mon, 23 Aug 1999 15:52:55 +0200 (CEST)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Jerry Quinn: "MO-Disk on PPC with 53C94 SCSI-chip"
- Previous message: =?iso-8859-1?Q?Magnus_N=E4slund?=: "When are the number of processes/pthreads increase ?"

On Sun, 22 Aug 1999, Andrea Arcangeli wrote:

>To make the ramdisk drive working properly and to fix the other page-cache
>fs-corruption bugs you only need to apply the above patch against

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:

--- 2.3.15-pre2-pagecache2/fs/inode.c Mon Aug 23 15:15:44 1999
+++ 2.3.15-pre2-pagecache3/fs/inode.c Mon Aug 23 15:44:45 1999
@@ -339,7 +339,7 @@
* dispose_list.
*/
#define CAN_UNUSE(inode) \
- (((inode)->i_count | (inode)->i_state | (inode)->i_nrpages) == 0)
+ (((inode)->i_count | (inode)->i_state) == 0)
#define INODE(entry) (list_entry(entry, struct inode, i_list))
static int free_inodes(void)

A new global page-cache/ramdisk patch against clean 2.3.15-pre2 can be
downloaded here:

ftp://e-mind.com/pub/andrea/kernel-patches/pending-2.3.x/page-cache-2.3.15-pre2-3
ftp://ftp.suse.com/pub/people/andrea/kernel-patches/pending-2.3.x/page-cache-2.3.15-pre2-3

Andrea

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

- Next message: Jerry Quinn: "MO-Disk on PPC with 53C94 SCSI-chip"
- Previous message: =?iso-8859-1?Q?Magnus_N=E4slund?=: "When are the number of processes/pthreads increase ?"