Commit 17ca370
block: allow different-pgmap pages as separate bvecs in bio_add_page
bio_add_page() and bio_integrity_add_page() reject pages from a
different dev_pagemap entirely, returning 0 even when the page could
be added as a new bvec entry. The pgmap check was intended only to
prevent merging into the same bvec segment, not to block the page
from being added at all.
This causes callers to unnecessarily start a new bio when a buffer
spans pages from two different pgmaps, even though the bio has room
for another bvec.
Fix both functions by moving the zone_device_pages_have_same_pgmap()
check into the merge conditional. Pages from different pgmaps now
skip the merge attempt and fall through to be added as new separate
bvec entries.
This is safe because biovec_phys_mergeable() now also checks for
pgmap mismatches, preventing the downstream merge, DMA mapping, and
request coalescing paths from combining segments across pgmaps.
Fixes: 49580e6 ("block: add check when merging zone device pages")
Cc: stable@vger.kernel.org
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>1 parent 56d993a commit 17ca370
2 files changed
Lines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 170 | + | |
| 171 | + | |
174 | 172 | | |
175 | 173 | | |
176 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1070 | 1070 | | |
1071 | 1071 | | |
1072 | 1072 | | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
| 1073 | + | |
| 1074 | + | |
1077 | 1075 | | |
1078 | 1076 | | |
1079 | 1077 | | |
| |||
0 commit comments