dm verity: add error handling modes for corrupted blocks
authorSami Tolvanen <samitolvanen@google.com>
Wed, 18 Mar 2015 15:52:14 +0000 (15:52 +0000)
committerMike Snitzer <snitzer@redhat.com>
Wed, 15 Apr 2015 16:10:22 +0000 (12:10 -0400)
commit65ff5b7ddf0541f2b6e5cc59c47bfbf6cbcd91b8
tree2a5391011a315f42e409a33d8238544451484c14
parent0e0e32c16cfd2eeaf4fd4f16aa6cccd1333ce1e0
dm verity: add error handling modes for corrupted blocks

Add device specific modes to dm-verity to specify how corrupted
blocks should be handled.  The following modes are defined:

  - DM_VERITY_MODE_EIO is the default behavior, where reading a
    corrupted block results in -EIO.

  - DM_VERITY_MODE_LOGGING only logs corrupted blocks, but does
    not block the read.

  - DM_VERITY_MODE_RESTART calls kernel_restart when a corrupted
    block is discovered.

In addition, each mode sends a uevent to notify userspace of
corruption and to allow further recovery actions.

The driver defaults to previous behavior (DM_VERITY_MODE_EIO)
and other modes can be enabled with an additional parameter to
the verity table.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Documentation/device-mapper/verity.txt
drivers/md/dm-verity.c
drivers/md/dm.c