Skip to content

Commit

Permalink
OpenZFS 7490 - real checksum errors are silenced when zinject is on
Browse files Browse the repository at this point in the history
Authored by: Pavel Zakharov <[email protected]>
Reviewed by: George Wilson <[email protected]>
Reviewed by: Paul Dagnelie <[email protected]>
Reviewed by: Dan Kimmel <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Approved by: Robert Mustacchi <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Ported-by: George Melikov <[email protected]>

OpenZFS-issue: https://www.illumos.org/issues/7490
OpenZFS-commit: openzfs/openzfs@6cedfc3
Closes openzfs#5693
  • Loading branch information
gmelikov authored and behlendorf committed Jan 31, 2017
1 parent e2da829 commit 41425f7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions module/zfs/zio_checksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
*/
/*
* 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 2013 Saso Kiselkov. All rights reserved.
*/

#include <sys/zfs_context.h>
Expand Down Expand Up @@ -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,
offset, info);
if (error != 0 && zio_injection_enabled && !zio->io_error &&
(error = zio_handle_fault_injection(zio, ECKSUM)) != 0) {

info->zbc_injected = 1;
return (error);
if (zio_injection_enabled && error == 0 && zio->io_error == 0) {
error = zio_handle_fault_injection(zio, ECKSUM);
if (error != 0)
info->zbc_injected = 1;
}

return (error);
}

Expand Down

0 comments on commit 41425f7

Please sign in to comment.