The patch titled Subject: mm/filemap: don't cast ->readpage to filler_t for do_read_cache_page has been added to the -mm tree. Its filename is mm-dont-cast-readpage-to-filler_t-for-do_read_cache_page.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-dont-cast-readpage-to-filler_t-for-do_read_cache_page.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-dont-cast-readpage-to-filler_t-for-do_read_cache_page.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Christoph Hellwig <hch@xxxxxx> Subject: mm/filemap: don't cast ->readpage to filler_t for do_read_cache_page We can just pass a NULL filler and do the right thing inside of do_read_cache_page based on the NULL parameter. Link: http://lkml.kernel.org/r/20190520055731.24538-3-hch@xxxxxx Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> Cc: Sami Tolvanen <samitolvanen@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/pagemap.h | 3 +-- mm/filemap.c | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) --- a/include/linux/pagemap.h~mm-dont-cast-readpage-to-filler_t-for-do_read_cache_page +++ a/include/linux/pagemap.h @@ -396,8 +396,7 @@ extern int read_cache_pages(struct addre static inline struct page *read_mapping_page(struct address_space *mapping, pgoff_t index, void *data) { - filler_t *filler = (filler_t *)mapping->a_ops->readpage; - return read_cache_page(mapping, index, filler, data); + return read_cache_page(mapping, index, NULL, data); } /* --- a/mm/filemap.c~mm-dont-cast-readpage-to-filler_t-for-do_read_cache_page +++ a/mm/filemap.c @@ -2772,7 +2772,11 @@ repeat: } filler: - err = filler(data, page); + if (filler) + err = filler(data, page); + else + err = mapping->a_ops->readpage(data, page); + if (err < 0) { put_page(page); return ERR_PTR(err); @@ -2884,9 +2888,7 @@ struct page *read_cache_page_gfp(struct pgoff_t index, gfp_t gfp) { - filler_t *filler = (filler_t *)mapping->a_ops->readpage; - - return do_read_cache_page(mapping, index, filler, NULL, gfp); + return do_read_cache_page(mapping, index, NULL, NULL, gfp); } EXPORT_SYMBOL(read_cache_page_gfp); _ Patches currently in -mm which might be from hch@xxxxxx are mm-fix-an-overly-long-line-in-read_cache_page.patch mm-dont-cast-readpage-to-filler_t-for-do_read_cache_page.patch jffs2-pass-the-correct-prototype-to-read_cache_page.patch 9p-pass-the-correct-prototype-to-read_cache_page.patch byteorder-sanity-check-toolchain-vs-kernel-endianess.patch