]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
dm integrity: do not check integrity for failed read operations
authorHyunchul Lee <cheol.lee@lge.com>
Mon, 31 Jul 2017 07:22:20 +0000 (16:22 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2017 07:47:24 +0000 (09:47 +0200)
commit b7e326f7b7375392d06f9cfbc27a7c63181f69d7 upstream.

Even though read operations fail, dm_integrity_map_continue() calls
integrity_metadata() to check integrity.  In this case, just complete
these.

This also makes it so read I/O errors do not generate integrity warnings
in the kernel log.

Signed-off-by: Hyunchul Lee <cheol.lee@lge.com>
Acked-by: Milan Broz <gmazyland@gmail.com>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-integrity.c

index 3acce09bba35c54b1afe4e8af962766bfd90eb73..240941eb3f685324975485ea08a115c71c45c39c 100644 (file)
@@ -1697,7 +1697,11 @@ sleep:
 
        if (need_sync_io) {
                wait_for_completion_io(&read_comp);
-               integrity_metadata(&dio->work);
+               if (likely(!bio->bi_status))
+                       integrity_metadata(&dio->work);
+               else
+                       dec_in_flight(dio);
+
        } else {
                INIT_WORK(&dio->work, integrity_metadata);
                queue_work(ic->metadata_wq, &dio->work);