Commit 7833b86
btrfs: fix iomap_begin length for nocow writes
can_nocow_extent can reduce the len passed in, which needs to be
propagated to btrfs_dio_iomap_begin so that iomap does not submit
more data then is mapped.
This problems exists since the btrfs_get_blocks_direct helper was added
in commit c5794e5 ("btrfs: Factor out write portion of
btrfs_get_blocks_direct"), but the ordered_extent splitting added in
commit b73a6fd ("btrfs: split partial dio bios before submit")
added a WARN_ON that made a syzkaller test fail.
Reported-by: [email protected]
Fixes: c5794e5 ("btrfs: Factor out write portion of btrfs_get_blocks_direct")
CC: [email protected] # 6.1+
Tested-by: [email protected]
Reviewed-by: Filipe Manana <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent 79b8ee7 commit 7833b86
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7264 | 7264 | | |
7265 | 7265 | | |
7266 | 7266 | | |
7267 | | - | |
| 7267 | + | |
7268 | 7268 | | |
7269 | 7269 | | |
7270 | 7270 | | |
| |||
7275 | 7275 | | |
7276 | 7276 | | |
7277 | 7277 | | |
| 7278 | + | |
7278 | 7279 | | |
7279 | 7280 | | |
7280 | 7281 | | |
| |||
7345 | 7346 | | |
7346 | 7347 | | |
7347 | 7348 | | |
7348 | | - | |
7349 | | - | |
| 7349 | + | |
| 7350 | + | |
| 7351 | + | |
| 7352 | + | |
7350 | 7353 | | |
7351 | 7354 | | |
7352 | 7355 | | |
7353 | 7356 | | |
7354 | 7357 | | |
7355 | | - | |
7356 | | - | |
| 7358 | + | |
| 7359 | + | |
| 7360 | + | |
| 7361 | + | |
7357 | 7362 | | |
7358 | 7363 | | |
7359 | 7364 | | |
| |||
7394 | 7399 | | |
7395 | 7400 | | |
7396 | 7401 | | |
| 7402 | + | |
7397 | 7403 | | |
7398 | 7404 | | |
7399 | 7405 | | |
| |||
7570 | 7576 | | |
7571 | 7577 | | |
7572 | 7578 | | |
7573 | | - | |
| 7579 | + | |
7574 | 7580 | | |
7575 | 7581 | | |
7576 | 7582 | | |
| |||
0 commit comments