]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dm-verity: don't crash if panic_on_corruption is not selected
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 29 Oct 2024 11:17:13 +0000 (12:17 +0100)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 4 Nov 2024 16:39:23 +0000 (17:39 +0100)
commita674d0cd56f47628e8057232833cd0654c85d50b
tree4ff2f7e14c67a17c4bb8fca8714aaf505fb31c83
parent5a4510c762fc04c74cff264cd4d9e9f5bf364bae
dm-verity: don't crash if panic_on_corruption is not selected

If the user sets panic_on_error and doesn't set panic_on_corruption,
dm-verity should not panic on data mismatch. But, currently it panics,
because it treats data mismatch as I/O error.

This commit fixes the logic so that if there is data mismatch and
panic_on_corruption or restart_on_corruption is not selected, the system
won't restart or panic.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Fixes: f811b83879fb ("dm-verity: introduce the options restart_on_error and panic_on_error")
drivers/md/dm-verity-target.c
drivers/md/dm-verity.h