From 1dfa24a4bf3b00325d3957019e3ada2ec21d82cf Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Thu, 12 May 2022 17:47:06 -0400 Subject: [PATCH] filemap: Handle AOP_TRUNCATED_PAGE in do_read_cache_folio() If the call to filler() returns AOP_TRUNCATED_PAGE, we need to retry the page cache lookup. Signed-off-by: Matthew Wilcox (Oracle) --- mm/filemap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index c821bc4..4e2601b 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3524,8 +3524,10 @@ repeat: folio_clear_error(folio); filler: err = filler(file, folio); - if (err < 0) { + if (err) { folio_put(folio); + if (err == AOP_TRUNCATED_PAGE) + goto repeat; return ERR_PTR(err); } -- 2.7.4