Re: [PATCH] mm/filemap: do not allocate cache pages beyond end of file at read

From: Linus Torvalds
Date: Mon Oct 28 2019 - 08:47:39 EST

On Mon, Oct 28, 2019 at 1:42 PM Kirill A. Shutemov <kirill@xxxxxxxxxxxxx> wrote:
> I've tried something of this sort back in 2013:
> and I've got push back.
> Apparently, some filesystems may not have valid i_size before >readpage().
> Not sure if it's still the case...

Well, I agree that there might be some network filesystem that might
have inode sizes that are stale, but if that's the case then I don't
think your previous patch works either.

It too will avoid the readpage() if the read position is beyond i_size.