提交 2c0468e0 编写于 作者: A Akilesh Kailash 提交者: Mike Snitzer

dm verity: skip redundant verity_handle_err() on I/O errors

Without FEC, dm-verity won't call verity_handle_err() when I/O fails,
but with FEC enabled, it currently does even if an I/O error has
occurred.

If there is an I/O error and FEC correction fails, return the error
instead of calling verity_handle_err() again.
Suggested-by: NSami Tolvanen <samitolvanen@google.com>
Signed-off-by: NAkilesh Kailash <akailash@google.com>
Reviewed-by: NSami Tolvanen <samitolvanen@google.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
上级 64570fbc
...@@ -475,6 +475,7 @@ static int verity_verify_io(struct dm_verity_io *io) ...@@ -475,6 +475,7 @@ static int verity_verify_io(struct dm_verity_io *io)
struct bvec_iter start; struct bvec_iter start;
unsigned b; unsigned b;
struct crypto_wait wait; 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++) { for (b = 0; b < io->n_blocks; b++) {
int r; int r;
...@@ -529,9 +530,17 @@ static int verity_verify_io(struct dm_verity_io *io) ...@@ -529,9 +530,17 @@ static int verity_verify_io(struct dm_verity_io *io)
else if (verity_fec_decode(v, io, DM_VERITY_BLOCK_TYPE_DATA, else if (verity_fec_decode(v, io, DM_VERITY_BLOCK_TYPE_DATA,
cur_block, NULL, &start) == 0) cur_block, NULL, &start) == 0)
continue; continue;
else if (verity_handle_err(v, DM_VERITY_BLOCK_TYPE_DATA, else {
cur_block)) if (bio->bi_status) {
return -EIO; /*
* Error correction failed; Just return error
*/
return -EIO;
}
if (verity_handle_err(v, DM_VERITY_BLOCK_TYPE_DATA,
cur_block))
return -EIO;
}
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册