CHROMIUM: md: dm-verity: Panic on transient errors

commit 650b9c786d10f ("CHROMIUM: md: dm-verity: call to verity_error missing")
[cros/chromeos-3_10]
Fixed the error path to be sure block read error are going through
the error path. Block errors are marked as transient.

commit 92d6d5931b747 ("CHROMIUM: md: dm-verity: error handling for bad block")
[cros/chromeos-3_10]
Changed the error path and was removing the transient attribute
before calling the chromeos error_handler: any transient block errors lead
to invalidating the kernel.

commit 03487230bcf36 ("dm-verity.c: restore transient error handling")
[cros/chromeos-3_10]
Restored the transient attribute but prevents the kernel from
crashing on transient read error of the root partition.

Although we should not invalidate the kernel and force a recovery,
we should panic, as the root device is not trustworthy and the
applications can not work properly.
1 - maybe by resetting the host and ssd controllers, the error will
go away.
2 - the errors will be reported, so we can analyze them.

BUG=chromium:328926
TEST=Trigger an transient error:
Use script from
https://bugs.chromium.org/p/chromium/issues/detail?id=328926#c37
Check that we crash when an error occurs.
We set up a dm-verify (/dev/dm-3) over dm-flakey (/dev/dm-2):
device-mapper: verity: Argument 0: 'payload=/dev/dm-2'
..
device-mapper: verity: Argument 5: 'error_behavior=notify'
..
device-mapper: verity: verification failure occurred: block failure (transient)
Kernel panic - not syncing: dm-verity failure: device:253:2
error:-5 block:18446744073709551615 message:block

Conflict: use drivers/md/dm-verity.c.

(cherry picked from commit 6c23d8bb5dd4491e000873dbc918b8185759d3d7)
Change-Id: I11941b70307796a4a454d7a309ccc9706efb81f9
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2149311
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2160056
1 file changed