Print this page
Fixup merge results
re #12393 rb3935 Kerberos and smbd disagree about who is our AD server (fix elf runtime attributes check)
re #11612 rb3907 Failing vdev of a mirrored pool should not take zfs operations out of action for extended periods of time.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zfs_fm.c
          +++ new/usr/src/uts/common/fs/zfs/zfs_fm.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24      - */
  25      -
  26      -/*
  27   24   * Copyright (c) 2012 by Delphix. All rights reserved.
       25 + * Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
  28   26   */
  29   27  
  30   28  #include <sys/spa.h>
  31   29  #include <sys/spa_impl.h>
  32   30  #include <sys/vdev.h>
  33   31  #include <sys/vdev_impl.h>
  34   32  #include <sys/zio.h>
  35   33  #include <sys/zio_checksum.h>
  36   34  
  37   35  #include <sys/fm/fs/zfs.h>
↓ open down ↓ 260 lines elided ↑ open up ↑
 298  296                   */
 299  297                  fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_ZIO_ERR,
 300  298                      DATA_TYPE_INT32, zio->io_error, NULL);
 301  299  
 302  300                  /*
 303  301                   * If the 'size' parameter is non-zero, it indicates this is a
 304  302                   * RAID-Z or other I/O where the physical offset and length are
 305  303                   * provided for us, instead of within the zio_t.
 306  304                   */
 307  305                  if (vd != NULL) {
 308      -                        if (size)
      306 +                        /*
      307 +                         * The 'stateoroffset' and 'size' parameters are
      308 +                         * overloaded to represent the timeout and latency,
      309 +                         * respectively, in a timeout report.
      310 +                         */
      311 +                        if (strcmp(subclass, FM_EREPORT_ZFS_TIMEOUT) == 0)
 309  312                                  fm_payload_set(ereport,
      313 +                                    FM_EREPORT_PAYLOAD_ZFS_ZIO_TIMEOUT,
      314 +                                    DATA_TYPE_UINT64, stateoroffset,
      315 +                                    FM_EREPORT_PAYLOAD_ZFS_ZIO_LATENCY,
      316 +                                    DATA_TYPE_UINT64, size, NULL);
      317 +                        else if (size)
      318 +                                fm_payload_set(ereport,
 310  319                                      FM_EREPORT_PAYLOAD_ZFS_ZIO_OFFSET,
 311  320                                      DATA_TYPE_UINT64, stateoroffset,
 312  321                                      FM_EREPORT_PAYLOAD_ZFS_ZIO_SIZE,
 313  322                                      DATA_TYPE_UINT64, size, NULL);
 314  323                          else
 315  324                                  fm_payload_set(ereport,
 316  325                                      FM_EREPORT_PAYLOAD_ZFS_ZIO_OFFSET,
 317  326                                      DATA_TYPE_UINT64, zio->io_offset,
 318  327                                      FM_EREPORT_PAYLOAD_ZFS_ZIO_SIZE,
 319  328                                      DATA_TYPE_UINT64, zio->io_size, NULL);
↓ open down ↓ 33 lines elided ↑ open up ↑
 353  362          *detector_out = detector;
 354  363  }
 355  364  
 356  365  /* if it's <= 128 bytes, save the corruption directly */
 357  366  #define ZFM_MAX_INLINE          (128 / sizeof (uint64_t))
 358  367  
 359  368  #define MAX_RANGES              16
 360  369  
 361  370  typedef struct zfs_ecksum_info {
 362  371          /* histograms of set and cleared bits by bit number in a 64-bit word */
 363      -        uint32_t zei_histogram_set[sizeof (uint64_t) * NBBY];
 364      -        uint32_t zei_histogram_cleared[sizeof (uint64_t) * NBBY];
      372 +        uint16_t zei_histogram_set[sizeof (uint64_t) * NBBY];
      373 +        uint16_t zei_histogram_cleared[sizeof (uint64_t) * NBBY];
 365  374  
 366  375          /* inline arrays of bits set and cleared. */
 367  376          uint64_t zei_bits_set[ZFM_MAX_INLINE];
 368  377          uint64_t zei_bits_cleared[ZFM_MAX_INLINE];
 369  378  
 370  379          /*
 371  380           * for each range, the number of bits set and cleared.  The Hamming
 372  381           * distance between the good and bad buffers is the sum of them all.
 373  382           */
 374  383          uint32_t zei_range_sets[MAX_RANGES];
↓ open down ↓ 4 lines elided ↑ open up ↑
 379  388                  uint32_t        zr_end;
 380  389          } zei_ranges[MAX_RANGES];
 381  390  
 382  391          size_t  zei_range_count;
 383  392          uint32_t zei_mingap;
 384  393          uint32_t zei_allowed_mingap;
 385  394  
 386  395  } zfs_ecksum_info_t;
 387  396  
 388  397  static void
 389      -update_histogram(uint64_t value_arg, uint32_t *hist, uint32_t *count)
      398 +update_histogram(uint64_t value_arg, uint16_t *hist, uint32_t *count)
 390  399  {
 391  400          size_t i;
 392  401          size_t bits = 0;
 393  402          uint64_t value = BE_64(value_arg);
 394  403  
 395  404          /* We store the bits in big-endian (largest-first) order */
 396  405          for (i = 0; i < 64; i++) {
 397  406                  if (value & (1ull << i)) {
 398  407                          hist[63 - i]++;
 399  408                          ++bits;
↓ open down ↓ 145 lines elided ↑ open up ↑
 545  554                          fm_payload_set(ereport,
 546  555                              FM_EREPORT_PAYLOAD_ZFS_CKSUM_BYTESWAP,
 547  556                              DATA_TYPE_BOOLEAN, 1,
 548  557                              NULL);
 549  558                  }
 550  559          }
 551  560  
 552  561          if (badbuf == NULL || goodbuf == NULL)
 553  562                  return (eip);
 554  563  
 555      -        ASSERT3U(nui64s, <=, UINT32_MAX);
      564 +        ASSERT3U(nui64s, <=, UINT16_MAX);
 556  565          ASSERT3U(size, ==, nui64s * sizeof (uint64_t));
 557  566          ASSERT3U(size, <=, SPA_MAXBLOCKSIZE);
 558  567          ASSERT3U(size, <=, UINT32_MAX);
 559  568  
 560  569          /* build up the range list by comparing the two buffers. */
 561  570          for (idx = 0; idx < nui64s; idx++) {
 562  571                  if (good[idx] == bad[idx]) {
 563  572                          if (start == -1)
 564  573                                  continue;
 565  574  
↓ open down ↓ 81 lines elided ↑ open up ↑
 647  656                      FM_EREPORT_PAYLOAD_ZFS_BAD_SET_BITS,
 648  657                      DATA_TYPE_UINT8_ARRAY,
 649  658                      inline_size, (uint8_t *)eip->zei_bits_set,
 650  659                      FM_EREPORT_PAYLOAD_ZFS_BAD_CLEARED_BITS,
 651  660                      DATA_TYPE_UINT8_ARRAY,
 652  661                      inline_size, (uint8_t *)eip->zei_bits_cleared,
 653  662                      NULL);
 654  663          } else {
 655  664                  fm_payload_set(ereport,
 656  665                      FM_EREPORT_PAYLOAD_ZFS_BAD_SET_HISTOGRAM,
 657      -                    DATA_TYPE_UINT32_ARRAY,
      666 +                    DATA_TYPE_UINT16_ARRAY,
 658  667                      NBBY * sizeof (uint64_t), eip->zei_histogram_set,
 659  668                      FM_EREPORT_PAYLOAD_ZFS_BAD_CLEARED_HISTOGRAM,
 660      -                    DATA_TYPE_UINT32_ARRAY,
      669 +                    DATA_TYPE_UINT16_ARRAY,
 661  670                      NBBY * sizeof (uint64_t), eip->zei_histogram_cleared,
 662  671                      NULL);
 663  672          }
 664  673          return (eip);
 665  674  }
 666  675  #endif
 667  676  
 668  677  void
 669  678  zfs_ereport_post(const char *subclass, spa_t *spa, vdev_t *vd, zio_t *zio,
 670  679      uint64_t stateoroffset, uint64_t size)
↓ open down ↓ 201 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX