]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dm-flakey: remove useless ERROR_READS check in flakey_end_io
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 22 Apr 2025 23:47:37 +0000 (19:47 -0400)
committerMikulas Patocka <mpatocka@redhat.com>
Sun, 4 May 2025 09:35:05 +0000 (11:35 +0200)
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>
drivers/md/dm-flakey.c

index 35f1708b62e801bb5f825aa07df2a045de011a87..0421f933668019547a58d178c40f337da7427d44 100644 (file)
@@ -511,8 +511,8 @@ static int flakey_map(struct dm_target *ti, struct bio *bio)
                pb->bio_submitted = true;
 
                /*
-                * Error reads if neither corrupt_bio_byte or drop_writes or error_writes are set.
-                * Otherwise, flakey_end_io() will decide if the reads should be modified.
+                * If ERROR_READS isn't set flakey_end_io() will decide if the
+                * reads should be modified.
                 */
                if (bio_data_dir(bio) == READ) {
                        if (test_bit(ERROR_READS, &fc->flags))
@@ -590,13 +590,6 @@ static int flakey_end_io(struct dm_target *ti, struct bio *bio,
                        if (rem < fc->random_read_corrupt)
                                corrupt_bio_random(bio);
                }
-               if (test_bit(ERROR_READS, &fc->flags)) {
-                       /*
-                        * Error read during the down_interval if drop_writes
-                        * and error_writes were not configured.
-                        */
-                       *error = BLK_STS_IOERR;
-               }
        }
 
        return DM_ENDIO_DONE;