From: Pankaj Raghav <p.raghav@xxxxxxxxxxx>Reviewed-by: Hannes Reinecke <hare@xxxxxxx>
Usually the page cache does not extend beyond the size of the inode,
therefore, no PTEs are created for folios that extend beyond the size.
But with LBS support, we might extend page cache beyond the size of the
inode as we need to guarantee folios of minimum order. Cap the PTE range
to be created for the page cache up to the max allowed zero-fill file
end, which is aligned to the PAGE_SIZE.
An fstests test has been created to trigger this edge case [0].
[0] https://lore.kernel.org/fstests/20240415081054.1782715-1-mcgrof@xxxxxxxxxx/
Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
Signed-off-by: Pankaj Raghav <p.raghav@xxxxxxxxxxx>
---
mm/filemap.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)