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)
committerMike Snitzer <snitzer@redhat.com>
Mon, 11 Sep 2017 14:07:34 +0000 (10:07 -0400)
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.

Cc: stable@vger.kernel.org
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>
drivers/md/dm-integrity.c

index 293a19652d5549a4ba494b0748a8fd8ebf463090..fe5ad640a0aab2b26019bcf47c2c881bc62a55e2 100644 (file)
@@ -1702,7 +1702,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);