From: OGAWA Hirofumi Date: Mon, 28 Apr 2008 09:16:28 +0000 (-0700) Subject: Add balance_dirty_pages_ratelimited() to cont_expand_zero() X-Git-Tag: firefly_0821_release~21202 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=061e97469f46f924cf14bbf1dd4805b46986691a;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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, goto out; BUG_ON(err != len); err = 0; + + balance_dirty_pages_ratelimited(mapping); } /* page covers the boundary, find the boundary offset */