diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 293a19652d5549a4ba494b0748a8fd8ebf463090..fe5ad640a0aab2b26019bcf47c2c881bc62a55e2 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -1702,7 +1702,11 @@ static void dm_integrity_map_continue(struct dm_integrity_io *dio, bool from_map 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);