diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2008-04-28 05:16:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:47 -0400 |
commit | 061e97469f46f924cf14bbf1dd4805b46986691a (patch) | |
tree | f89bae50777ff9d7a8dc917342f55218de132166 | |
parent | e69be4c9c4ac1b6bb6380512557da0afa6262e98 (diff) |
Add balance_dirty_pages_ratelimited() to cont_expand_zero()
On the systems, ftruncate() which expand size for FAT became the cause
of OOM. The cont_expand_zero() filled all memory with dirty pages,
and since disk is very slow, limit of page scanning was exceeded, then
it triggered OOM.
This adds balance_dirty_pages_ratelimited() to avoid filling memory
with dirty pages.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/buffer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 7d51e649b19a..3db4a26adc44 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -2246,6 +2246,8 @@ int cont_expand_zero(struct file *file, struct address_space *mapping, | |||
2246 | goto out; | 2246 | goto out; |
2247 | BUG_ON(err != len); | 2247 | BUG_ON(err != len); |
2248 | err = 0; | 2248 | err = 0; |
2249 | |||
2250 | balance_dirty_pages_ratelimited(mapping); | ||
2249 | } | 2251 | } |
2250 | 2252 | ||
2251 | /* page covers the boundary, find the boundary offset */ | 2253 | /* page covers the boundary, find the boundary offset */ |