From: Josef Bacik Date: Tue, 14 May 2019 00:21:04 +0000 (-0700) Subject: mm/filemap.c: enable error injection at add_to_page_cache() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=cfcbfb1382dbac331d8aa92d3a218a16b803b2a9;p=linux.git mm/filemap.c: enable error injection at add_to_page_cache() Recently I messed up the error handling in filemap_fault() because of an unexpected ENOMEM (related to cgroup memory limits) in add_to_page_cache. Enable error injection at this point so I can add a testcase to xfstests to verify I don't mess this up again. [akpm@linux-foundation.org: include linux/error-injection.h] Link: http://lkml.kernel.org/r/20190403152604.14008-1-josef@toxicpanda.com Signed-off-by: Josef Bacik Reviewed-by: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/filemap.c b/mm/filemap.c index 4157f858a9c68..0e929b4da48bc 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -882,6 +883,7 @@ error: put_page(page); return xas_error(&xas); } +ALLOW_ERROR_INJECTION(__add_to_page_cache_locked, ERRNO); /** * add_to_page_cache_locked - add a locked page to the pagecache