From: Matthew Wilcox (Oracle) Date: Thu, 12 May 2022 21:47:06 +0000 (-0400) Subject: filemap: Handle AOP_TRUNCATED_PAGE in do_read_cache_folio() X-Git-Tag: folio-6.0~60 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1dfa24a4bf3b00325d3957019e3ada2ec21d82cf;p=users%2Fwilly%2Fpagecache.git 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) --- diff --git a/mm/filemap.c b/mm/filemap.c index c821bc4a648bc..4e2601bfff505 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); }