Author: jpaetzel
Date: Fri Apr 21 00:24:59 2017
New Revision: 317238
URL: https://svnweb.freebsd.org/changeset/base/317238

Log:
  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.wil...@delphix.com>
  Reviewed by: Paul Dagnelie <p...@delphix.com>
  Reviewed by: Dan Kimmel <dan.kim...@delphix.com>
  Reviewed by: Matthew Ahrens <mahr...@delphix.com>
  Approved by: Robert Mustacchi <r...@joyent.com>
  Author: Pavel Zakharov <pavel.zakha...@delphix.com>

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c  Fri Apr 
21 00:17:54 2017        (r317237)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c  Fri Apr 
21 00:24:59 2017        (r317238)
@@ -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_c
 
        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);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to