diff options
author | Josh Paetzel <jpaetzel@FreeBSD.org> | 2017-04-21 00:24:59 +0000 |
---|---|---|
committer | Josh Paetzel <jpaetzel@FreeBSD.org> | 2017-04-21 00:24:59 +0000 |
commit | 36064ac2d5055cd427be6c35bda60af3787c99d7 (patch) | |
tree | e8a9cc926ccea0d04dd0871c9e89a01c58d2e217 | |
parent | 9a625bd31c5146d07f50826840b5be855a0984fe (diff) | |
parent | 8f77e16c27ebea38f9806fbd23a7fcbe13059b2a (diff) |
MFV 316871
7490 real checksum errors are silenced when zinject is on
illumos/illumos-gate@6cedfc397d92d64e442f0aae4445ac507beaf58f
https://github.com/illumos/illumos-gate/commit/6cedfc397d92d64e442f0aae4445ac507beaf58f
https://www.illumos.org/issues/7490
When zinject is on, error codes from zfs_checksum_error() can be overwritten
due to an incorrect and overly-complex if condition.
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>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
Notes
Notes:
svn path=/head/; revision=317238
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c index 751f825e9191..3109e0b7c324 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2015 by Delphix. All rights reserved. + * Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. */ @@ -392,12 +392,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); } |