linux/fs/iomap
Ritesh Harjani (IBM) 3a16dc3ea8 iomap: Fix iomap_adjust_read_range for plen calculation
[ Upstream commit f5ceb1bbc9 ]

If the extent spans the block that contains i_size, we need to handle
both halves separately so that we properly zero data in the page cache
for blocks that are entirely outside of i_size. But this is needed only
when i_size is within the current folio under processing.
"orig_pos + length > isize" can be true for all folios if the mapped
extent length is greater than the folio size. That is making plen to
break for every folio instead of only the last folio.

So use orig_plen for checking if "orig_pos + orig_plen > isize".

Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/a32e5f9a4fcfdb99077300c4020ed7ae61d6e0f9.1715067055.git.ritesh.list@gmail.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
cc: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-25 09:49:12 +02:00
..
buffered-io.c iomap: Fix iomap_adjust_read_range for plen calculation 2024-07-25 09:49:12 +02:00
direct-io.c iomap: update ki_pos a little later in iomap_dio_complete 2023-12-08 08:51:20 +01:00
fiemap.c fs: Move many prototypes to pagemap.h 2022-03-21 12:59:02 -04:00
iter.c iomap: write iomap validity checks 2024-05-25 16:21:31 +02:00
Makefile iomap: build the block based code conditionally 2021-12-04 08:58:54 -08:00
seek.c iomap: switch iomap_seek_data to use iomap_iter 2021-08-16 21:26:33 -07:00
swapfile.c mm/swap: consider max pages in iomap_swapfile_add_extent 2021-08-18 12:47:52 -07:00
trace.c iomap: lift common tracing code from xfs to iomap 2019-10-21 08:51:59 -07:00
trace.h iomap: add a tracepoint for mappings returned by map_blocks 2022-10-02 11:42:19 -07:00