Skip to contentSkip to conversation

mm: enable error injection at add_to_page_cache

PATCH In review Josef Bacik 2 participants 2 messages Apr 3, 2019 – Apr 4, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: 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.

---
 mm/filemap.c | 1 +
 1 file changed, 1 insertion(+)
mm/filemap.c +1 -0
index 4157f858a9c6..a0fe0ce7a0df 100644
@@ -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
Signature · 1 line
2.14.3