Skip to content

Commit 4319f0a

Browse files
bmarzinsMikulas Patocka
authored andcommitted
dm-flakey: remove useless ERROR_READS check in flakey_end_io
If ERROR_READS is set, flakey_map returns DM_MAPIO_KILL for read bios and flakey_end_io is never called, so there's no point in checking it there. Also clean up an incorrect comment about when read IOs are errored out. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
1 parent 40ed054 commit 4319f0a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/md/dm-flakey.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@ static int flakey_map(struct dm_target *ti, struct bio *bio)
511511
pb->bio_submitted = true;
512512

513513
/*
514-
* Error reads if neither corrupt_bio_byte or drop_writes or error_writes are set.
515-
* Otherwise, flakey_end_io() will decide if the reads should be modified.
514+
* If ERROR_READS isn't set flakey_end_io() will decide if the
515+
* reads should be modified.
516516
*/
517517
if (bio_data_dir(bio) == READ) {
518518
if (test_bit(ERROR_READS, &fc->flags))
@@ -590,13 +590,6 @@ static int flakey_end_io(struct dm_target *ti, struct bio *bio,
590590
if (rem < fc->random_read_corrupt)
591591
corrupt_bio_random(bio);
592592
}
593-
if (test_bit(ERROR_READS, &fc->flags)) {
594-
/*
595-
* Error read during the down_interval if drop_writes
596-
* and error_writes were not configured.
597-
*/
598-
*error = BLK_STS_IOERR;
599-
}
600593
}
601594

602595
return DM_ENDIO_DONE;

0 commit comments

Comments
 (0)