diff options
author | Tom Caputi <[email protected]> | 2018-03-31 14:12:51 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-03-31 11:12:51 -0700 |
commit | a2c2ed1bd4c3dc6d52b6058b9c74245cad2ae331 (patch) | |
tree | de5ad1fd1bc04f0ee496316305871d0b0e26d74e /module/zfs/zio.c | |
parent | 4515b1d01c936b8cf156e20ba42cdb8916bca80b (diff) |
Decryption error handling improvements
Currently, the decryption and block authentication code in
the ZIO / ARC layers is a bit inconsistent with regards to
the ereports that are produces and the error codes that are
passed to calling functions. This patch ensures that all of
these errors (which begin as ECKSUM) are converted to EIO
before they leave the ZIO or ARC layer and that ereports
are correctly generated on each decryption / authentication
failure.
In addition, this patch fixes a bug in zio_decrypt() where
ECKSUM never gets written to zio->io_error.
Reviewed by: Matt Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tom Caputi <[email protected]>
Closes #7372
Diffstat (limited to 'module/zfs/zio.c')
-rw-r--r-- | module/zfs/zio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 44cf984d0..c6379bfd4 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -506,7 +506,7 @@ error: * the io_error. If this was not a speculative zio, create an ereport. */ if (ret == ECKSUM) { - ret = SET_ERROR(EIO); + zio->io_error = SET_ERROR(EIO); if ((zio->io_flags & ZIO_FLAG_SPECULATIVE) == 0) { zfs_ereport_post(FM_EREPORT_ZFS_AUTHENTICATION, spa, NULL, &zio->io_bookmark, zio, 0, 0); |