summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm-verity-target.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c
index 36e4ddfe2d15..24ba9a10444c 100644
--- a/drivers/md/dm-verity-target.c
+++ b/drivers/md/dm-verity-target.c
@@ -273,10 +273,8 @@ out:
if (v->mode == DM_VERITY_MODE_LOGGING)
return 0;
- if (v->mode == DM_VERITY_MODE_RESTART) {
- pr_emerg("dm-verity device corrupted\n");
- emergency_restart();
- }
+ if (v->mode == DM_VERITY_MODE_RESTART)
+ kernel_restart("dm-verity device corrupted");
if (v->mode == DM_VERITY_MODE_PANIC)
panic("dm-verity device corrupted");
@@ -599,23 +597,6 @@ static void verity_finish_io(struct dm_verity_io *io, blk_status_t status)
if (!static_branch_unlikely(&use_bh_wq_enabled) || !io->in_bh)
verity_fec_finish_io(io);
- if (unlikely(status != BLK_STS_OK) &&
- unlikely(!(bio->bi_opf & REQ_RAHEAD)) &&
- !verity_is_system_shutting_down()) {
- if (v->mode == DM_VERITY_MODE_RESTART ||
- v->mode == DM_VERITY_MODE_PANIC)
- DMERR_LIMIT("%s has error: %s", v->data_dev->name,
- blk_status_to_str(status));
-
- if (v->mode == DM_VERITY_MODE_RESTART) {
- pr_emerg("dm-verity device corrupted\n");
- emergency_restart();
- }
-
- if (v->mode == DM_VERITY_MODE_PANIC)
- panic("dm-verity device corrupted");
- }
-
bio_endio(bio);
}