summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-12 23:47:06 +0200
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-06-29 14:51:06 +0200
commit1dfa24a4bf3b00325d3957019e3ada2ec21d82cf (patch)
treeec8781971c4de203d0d0050d92c8775da4d991bf /mm
parentfilemap: Move 'filler' case to the end of do_read_cache_folio() (diff)
downloadlinux-1dfa24a4bf3b00325d3957019e3ada2ec21d82cf.tar.xz
linux-1dfa24a4bf3b00325d3957019e3ada2ec21d82cf.zip
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) <willy@infradead.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index c821bc4a648b..4e2601bfff50 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);
}