dm flakey: Properly corrupt multi-page bios.
authorSweet Tea <sweettea@redhat.com>
Tue, 13 Nov 2018 13:04:24 +0000 (08:04 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:37:32 +0000 (15:37 +0100)
commitc6cd92fcabd6cc78bb1808c6a18245c842722fc1
treefd4e0e6e25ac8614da37b229dba81d7349dc76d3
parent0b2db05c8e561a53494fcac016d145dcfaa4fa7f
dm flakey: Properly corrupt multi-page bios.

[ Upstream commit a00f5276e26636cbf72f24f79831026d2e2868e7 ]

The flakey target is documented to be able to corrupt the Nth byte in
a bio, but does not corrupt byte indices after the first biovec in the
bio. Change the corrupting function to actually corrupt the Nth byte
no matter in which biovec that index falls.

A test device generating two-page bios, atop a flakey device configured
to corrupt a byte index on the second page, verified both the failure
to corrupt before this patch and the expected corruption after this
change.

Signed-off-by: John Dorminy <jdorminy@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-flakey.c