]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
dm flakey: fix logic when corrupting a bio
authorMikulas Patocka <mpatocka@redhat.com>
Sun, 22 Jan 2023 19:03:56 +0000 (14:03 -0500)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:47:34 +0000 (16:47 +0100)
commitbe0cbe308147f79fd1e6752633b302b8fd21aada
tree70f452c150adb54d9573e7eb0da49fbb67923075
parentf6415a7d36ee4055b72f48dff98b97de5a6338ae
dm flakey: fix logic when corrupting a bio

BugLink: https://bugs.launchpad.net/bugs/2011425
commit aa56b9b75996ff4c76a0a4181c2fa0206c3d91cc upstream.

If "corrupt_bio_byte" is set to corrupt reads and corrupt_bio_flags is
used, dm-flakey would erroneously return all writes as errors. Likewise,
if "corrupt_bio_byte" is set to corrupt writes, dm-flakey would return
errors for all reads.

Fix the logic so that if fc->corrupt_bio_byte is non-zero, dm-flakey
will not abort reads on writes with an error.

Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/md/dm-flakey.c