Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7e55f60 authored by Akilesh Kailash's avatar Akilesh Kailash
Browse files

FROMLIST: dm-verity: skip verity_handle_error on I/O errors



If there is an I/O error and FEC correction fails, return
an error instead of calling verity_handle_error().

Suggested-by: default avatarSami Tolvanen <samitolvanen@google.com>
Signed-off-by: default avatarAkilesh Kailash <akailash@google.com>

Bug: 197830746
Change-Id: Idd5f65bb72c78a1cca44e5593e40880b2408b564
Link: https://lore.kernel.org/all/20210913092642.3237796-1-akailash@google.com/


Signed-off-by: default avatarElliot Berman <quic_eberman@quicinc.com>
(cherry picked from commit fca745e32dfec052ecc04431f0ca58d49cce8e94)
parent 4811a280
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -475,6 +475,7 @@ static int verity_verify_io(struct dm_verity_io *io)
	struct bvec_iter start;
	unsigned b;
	struct crypto_wait wait;
	struct bio *bio = dm_bio_from_per_bio_data(io, v->ti->per_io_data_size);

	for (b = 0; b < io->n_blocks; b++) {
		int r;
@@ -529,10 +530,18 @@ static int verity_verify_io(struct dm_verity_io *io)
		else if (verity_fec_decode(v, io, DM_VERITY_BLOCK_TYPE_DATA,
					   cur_block, NULL, &start) == 0)
			continue;
		else if (verity_handle_err(v, DM_VERITY_BLOCK_TYPE_DATA,
		else {
			if (bio->bi_status) {
				/*
				 * Error correction failed; Just return error
				 */
				return -EIO;
			}
			if (verity_handle_err(v, DM_VERITY_BLOCK_TYPE_DATA,
					   cur_block))
				return -EIO;
		}
	}

	return 0;
}