Skip to content

Commit

Permalink
Add balance_dirty_pages_ratelimited() to cont_expand_zero()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
OGAWA Hirofumi authored and Linus Torvalds committed Apr 28, 2008
1 parent e69be4c commit 061e974
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,8 @@ int cont_expand_zero(struct file *file, struct address_space *mapping,
goto out;
BUG_ON(err != len);
err = 0;

balance_dirty_pages_ratelimited(mapping);
}

/* page covers the boundary, find the boundary offset */
Expand Down

0 comments on commit 061e974

Please sign in to comment.