OpenZFS 7490 - real checksum errors are silenced when zinject is on

Authored by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov <mail@gmelikov.ru>

OpenZFS-issue: https://www.illumos.org/issues/7490
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/6cedfc3
Closes #5693
This commit is contained in:
George Melikov 2017-01-31 04:12:58 +03:00 committed by Brian Behlendorf
parent e2da829cc1
commit 41425f79da

View File

@ -20,8 +20,8 @@
*/ */
/* /*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013 Saso Kiselkov. All rights reserved.
* Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, 2016 by Delphix. All rights reserved.
* Copyright 2013 Saso Kiselkov. All rights reserved.
*/ */
#include <sys/zfs_context.h> #include <sys/zfs_context.h>
@ -441,12 +441,13 @@ zio_checksum_error(zio_t *zio, zio_bad_cksum_t *info)
error = zio_checksum_error_impl(spa, bp, checksum, data, size, error = zio_checksum_error_impl(spa, bp, checksum, data, size,
offset, info); offset, info);
if (error != 0 && zio_injection_enabled && !zio->io_error &&
(error = zio_handle_fault_injection(zio, ECKSUM)) != 0) {
info->zbc_injected = 1; if (zio_injection_enabled && error == 0 && zio->io_error == 0) {
return (error); error = zio_handle_fault_injection(zio, ECKSUM);
if (error != 0)
info->zbc_injected = 1;
} }
return (error); return (error);
} }