diff options
| author | Mikulas Patocka <mpatocka@redhat.com> | 2026-11-06 19:41:56 +0100 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-11-06 20:36:34 +0100 |
| commit | 62ee9c09366cad69410330087d990e469dd92314 (patch) | |
| tree | 5fd39f845cb7367baa8cf67b93aa9e41b52d3b27 /rust/kernel/alloc/kvec/errors.rs | |
| parent | 421420758be348cb90715bfaa26e1211a12ff1d0 (diff) | |
dm-thin: fix data corruption if discard races with regular I/O
In the function break_up_discard_bio, if a discard hits the same block as
regular I/O, it was intended to skip the discard for the affected range.
However, the skip code only advances "data_begin", it doesn't advance
"virt_begin". So, the data_begin and virt_begin variables become
unsynchronized.
process_prepared_discard_passdown_pt1 calculates "data_end =
m->data_block + (m->virt_end - m->virt_begin);" - if m->data_block is
incremented and m->virt_begin isn't, it will overshoot the intended
discard range.
Cc: stable@vger.kernel.org
Fixes: e2dd8aca2d76 ("dm bio prison v1: improve concurrent IO performance")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions
