Commit 34cdb8c
block: ensure bio_iov_add_page can't fail
Adding the page could fail on the bio_full() condition, which checks for
either exceeding the bio's max segments or total size exceeding
UINT_MAX. We already ensure the max segments can't be exceeded, so just
ensure the total size won't reach the limit. This simplifies error
handling and removes unnecessary repeated bio_full() checks.
Signed-off-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20220712153256.2202024-2-kbusch@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 325347d commit 34cdb8c
1 file changed
Lines changed: 9 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
1168 | | - | |
1169 | | - | |
1170 | 1168 | | |
1171 | 1169 | | |
1172 | 1170 | | |
| |||
1228 | 1226 | | |
1229 | 1227 | | |
1230 | 1228 | | |
1231 | | - | |
| 1229 | + | |
| 1230 | + | |
1232 | 1231 | | |
1233 | 1232 | | |
1234 | 1233 | | |
| |||
1238 | 1237 | | |
1239 | 1238 | | |
1240 | 1239 | | |
1241 | | - | |
| 1240 | + | |
1242 | 1241 | | |
1243 | 1242 | | |
1244 | | - | |
1245 | | - | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1246 | 1249 | | |
1247 | | - | |
1248 | | - | |
1249 | | - | |
1250 | | - | |
1251 | 1250 | | |
1252 | 1251 | | |
1253 | 1252 | | |
| |||
0 commit comments