Files
linux/drivers/md
Benjamin Marzinski b7e80128bb dm-flakey: make corrupting read bios work
[ Upstream commit 13e79076c8 ]

dm-flakey corrupts the read bios in the endio function.  However, the
corrupt_bio_* functions checked bio_has_data() to see if there was data
to corrupt. Since this was the endio function, there was no data left to
complete, so bio_has_data() was always false. Fix this by saving a copy
of the bio's bi_iter in flakey_map(), and using this to initialize the
iter for corrupting the read bios. This patch also skips cloning the bio
for write bios with no data.

Reported-by: Kent Overstreet <kent.overstreet@linux.dev>
Fixes: a3998799fb ("dm flakey: add corrupt_bio_byte feature")
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-19 15:40:19 +02:00
..
2024-04-01 11:53:37 -06:00
2025-06-19 15:40:18 +02:00
2025-03-24 18:28:32 +01:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:07 -05:00
2024-02-20 14:22:51 -05:00
2025-01-17 22:24:04 +01:00
2024-12-23 08:17:23 -07:00
2023-02-14 14:23:06 -05:00
2024-11-20 11:38:04 +01:00
2025-01-13 07:36:29 -08:00
2025-01-13 07:36:29 -08:00