filemap: Handle AOP_TRUNCATED_PAGE in do_read_cache_folio()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 12 May 2022 21:47:06 +0000 (17:47 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 29 Jun 2022 12:51:06 +0000 (08:51 -0400)
If the call to filler() returns AOP_TRUNCATED_PAGE, we need to
retry the page cache lookup.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
mm/filemap.c

index c821bc4a648bcddddc7ce373505a80813ccb16fe..4e2601bfff505ac91a8c39449e2a976ecd77562c 100644 (file)
@@ -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);
        }