diff mbox series

mm: enable error injection at add_to_page_cache

Message ID 20190403152604.14008-1-josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series mm: enable error injection at add_to_page_cache | expand

Commit Message

Josef Bacik April 3, 2019, 3:26 p.m. UTC
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.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 mm/filemap.c | 1 +
 1 file changed, 1 insertion(+)

Comments

William Kucharski April 4, 2019, 11:41 a.m. UTC | #1
Reviewed-by: William Kucharski <william.kucharski@oracle.com>

> On Apr 3, 2019, at 9:26 AM, Josef Bacik <josef@toxicpanda.com> wrote:
> 
> ALLOW_ERROR_INJECTION
diff mbox series

Patch

diff --git a/mm/filemap.c b/mm/filemap.c
index 4157f858a9c6..a0fe0ce7a0df 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -882,6 +882,7 @@  static int __add_to_page_cache_locked(struct page *page,
 	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