diff options
author | Rik van Riel <riel@redhat.com> | 2006-02-17 16:03:32 -0500 |
---|---|---|
committer | Marcelo Tosatti <marcelo@dmt.cnet> | 2006-02-17 13:39:25 -0600 |
commit | 6b44bd7d09357b24e4066df9284034a091f5922f (patch) | |
tree | 743d6cb042245e84593d2f06c7e7c35910027977 /fs | |
parent | 451d9e4e414133250a9243c8fe164c8974a12da4 (diff) | |
download | linux-2.4-6b44bd7d09357b24e4066df9284034a091f5922f.tar.gz |
[PATCH] fix overflow in inode.c
The following patch fixes an overflow in inode.c. This overflow can
cause a system to stop reclaiming inodes, with a large amount of memory
and zillions of inodes. This has caused systems to run out of low
memory in real world situations.
Thanks go out to Larry Woodman, as well as the unnamed customer who
first tracked this problem down. You know who you are.
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Larry Woodman <lwoodman@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/inode.c b/fs/inode.c index 1b3f24bfd480f9..5ec83f6e63b72f 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -854,8 +854,8 @@ void prune_icache(int goal) */ if (goal <= 0) return; - if (inodes_stat.nr_unused * sizeof(struct inode) * 10 < - freeable_lowmem() * PAGE_SIZE) + if (inodes_stat.nr_unused < + (freeable_lowmem() * PAGE_SIZE) / (sizeof(struct inode) * 10)) return; wakeup_bdflush(); |