Commit 5956592
mm/filemap: fix page end in filemap_get_read_batch
I was running traces of the read code against an RAID storage system to
understand why read requests were being misaligned against the underlying
RAID strips. I found that the page end offset calculation in
filemap_get_read_batch() was off by one.
When a read is submitted with end offset 1048575, then it calculates the
end page for read of 256 when it should be 255. "last_index" is the index
of the page beyond the end of the read and it should be skipped when get a
batch of pages for read in @filemap_get_read_batch().
The below simple patch fixes the problem. This code was introduced in
kernel 5.12.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: cbd59c4 ("mm/filemap: use head pages in generic_file_buffered_read")
Signed-off-by: Qian Yingjin <[email protected]>
Reviewed-by: Matthew Wilcox (Oracle) <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent ce4d9a1 commit 5956592
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2588 | 2588 | | |
2589 | 2589 | | |
2590 | 2590 | | |
| 2591 | + | |
2591 | 2592 | | |
2592 | 2593 | | |
2593 | 2594 | | |
2594 | 2595 | | |
2595 | 2596 | | |
2596 | | - | |
| 2597 | + | |
2597 | 2598 | | |
2598 | 2599 | | |
2599 | 2600 | | |
2600 | 2601 | | |
2601 | 2602 | | |
2602 | | - | |
| 2603 | + | |
2603 | 2604 | | |
2604 | 2605 | | |
2605 | 2606 | | |
| |||
0 commit comments