summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-03-02 04:36:44 -0800
committerDavid S. Miller <davem@nuts.ninka.net>2003-03-02 04:36:44 -0800
commit29da03f1d5a0d4600187f1221c97cd02dc6e8d13 (patch)
treef51daa14a515285222ce43c109d23adc3b8cc740 /kernel
parent159b58552626a4adb581a81711d2649d6ca9208c (diff)
[PATCH] loop: Fix OOM and oops
The loop driver takes a copy of the data which it is writing. When this happens on the try_to_free_pages() path, loop can easily consume ALL memory and bio_copy() will fail to allocate a page. Loop forgets to check the bio_copy() return value and oopses. Fix this by dropping PF_MEMALLOC and throttling to the block writeout speed. The patch exports blk_congestion_wait() to modules for this. This is a needed export: several filesystems have a "try to allocate and yield if it failed" loop and blk_congestion_wait() is a more appropriate way of implementing the sleep in this situation.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/ksyms.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/ksyms.c b/kernel/ksyms.c
index f30934957b82..aff3e9298b77 100644
--- a/kernel/ksyms.c
+++ b/kernel/ksyms.c
@@ -119,6 +119,7 @@ EXPORT_SYMBOL(find_vma);
EXPORT_SYMBOL(get_unmapped_area);
EXPORT_SYMBOL(init_mm);
EXPORT_SYMBOL(blk_queue_bounce);
+EXPORT_SYMBOL(blk_congestion_wait);
#ifdef CONFIG_HIGHMEM
EXPORT_SYMBOL(kmap_high);
EXPORT_SYMBOL(kunmap_high);