Commit c0c589f
f2fs: Accounting large folio subpages before bio submission
In f2fs_read_data_large_folio(), read_pages_pending is incremented only
after the subpage has been added to the BIO. With a heavily fragmented
file, each new subpage can force submission of the previous BIO.
If the BIO completes quickly, f2fs_finish_read_bio() may decrement
read_pages_pending to zero and call folio_end_read() while the read loop
is still processing other subpages of the same large folio.
Fix the ordering by incrementing read_pages_pending before any possible
BIO submission for the current subpage, matching the iomap ordering and
preventing premature folio_end_read().
Signed-off-by: Nanzhe Zhao <nzzhao@126.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>1 parent 00feea1 commit c0c589f
1 file changed
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2497 | 2497 | | |
2498 | 2498 | | |
2499 | 2499 | | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
2500 | 2512 | | |
2501 | 2513 | | |
2502 | 2514 | | |
| |||
2524 | 2536 | | |
2525 | 2537 | | |
2526 | 2538 | | |
2527 | | - | |
2528 | | - | |
2529 | | - | |
2530 | | - | |
2531 | | - | |
2532 | | - | |
2533 | | - | |
2534 | | - | |
2535 | | - | |
2536 | 2539 | | |
2537 | 2540 | | |
2538 | 2541 | | |
| |||
0 commit comments