Print this page
8074 need to add FMA event for SSD wearout

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fm/modules/common/zfs-retire/zfs_retire.c
          +++ new/usr/src/cmd/fm/modules/common/zfs-retire/zfs_retire.c
↓ open down ↓ 419 lines elided ↑ open up ↑
 420  420                  fault = faults[f];
 421  421  
 422  422                  fault_device = B_FALSE;
 423  423                  degrade_device = B_FALSE;
 424  424                  is_disk = B_FALSE;
 425  425  
 426  426                  if (nvlist_lookup_boolean_value(fault, FM_SUSPECT_RETIRE,
 427  427                      &retire) == 0 && retire == 0)
 428  428                          continue;
 429  429  
      430 +                if (fmd_nvl_class_match(hdl, fault,
      431 +                    "fault.io.disk.ssm-wearout") &&
      432 +                    fmd_prop_get_int32(hdl, "ssm_wearout_skip_retire") ==
      433 +                    FMD_B_TRUE) {
      434 +                        fmd_hdl_debug(hdl, "zfs-retire: ignoring SSM fault");
      435 +                        continue;
      436 +                }
      437 +
 430  438                  /*
 431  439                   * While we subscribe to fault.fs.zfs.*, we only take action
 432  440                   * for faults targeting a specific vdev (open failure or SERD
 433  441                   * failure).  We also subscribe to fault.io.* events, so that
 434  442                   * faulty disks will be faulted in the ZFS configuration.
 435  443                   */
 436  444                  if (fmd_nvl_class_match(hdl, fault, "fault.fs.zfs.vdev.io")) {
 437  445                          fault_device = B_TRUE;
 438  446                  } else if (fmd_nvl_class_match(hdl, fault,
 439  447                      "fault.fs.zfs.vdev.checksum")) {
↓ open down ↓ 114 lines elided ↑ open up ↑
 554  562  static const fmd_hdl_ops_t fmd_ops = {
 555  563          zfs_retire_recv,        /* fmdo_recv */
 556  564          NULL,                   /* fmdo_timeout */
 557  565          NULL,                   /* fmdo_close */
 558  566          NULL,                   /* fmdo_stats */
 559  567          NULL,                   /* fmdo_gc */
 560  568  };
 561  569  
 562  570  static const fmd_prop_t fmd_props[] = {
 563  571          { "spare_on_remove", FMD_TYPE_BOOL, "true" },
      572 +        { "ssm_wearout_skip_retire", FMD_TYPE_BOOL, "true"},
 564  573          { NULL, 0, NULL }
 565  574  };
 566  575  
 567  576  static const fmd_hdl_info_t fmd_info = {
 568  577          "ZFS Retire Agent", "1.0", &fmd_ops, fmd_props
 569  578  };
 570  579  
 571  580  void
 572  581  _fmd_init(fmd_hdl_t *hdl)
 573  582  {
↓ open down ↓ 28 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX